how about getting those devices a static ip(4 and/or 6) and block it on ip, or when several, making an alias with those ips and blocking it. I am using that for my kids devices to block the internet for them to support bedtime :-)
Those MAC addresses as aliases don't seem t work. About a year ago I tried that approach in the captive portal and got an answer back like what @bartjsmit is saying that opnsense/freebsd does not firewall mac addresses.That is when I set up all devices on the network with static ip, not a known device, no connection, and being able to control the connection of every device. Would be an awesome feature if the MAC addresses would be included also
Out of curiousity I set up a MAC alias for my Android phone and turned on IPv6 support on my Wifi vlan and RA service with Assisted mode. I could see my phone got a SLAAC address and the MAC alias from OPNSense's Diagnostics->Aliases also resolved to the same address.Then I setup a block rule for that MAC alias and it seems to be working as expected.So it looks like OPNSense can firewall by MAC address just fine, what do I miss here?
More precisely the pf firewall in FreeBSD according to the documentation only works on layer 3 and layer 4 information. There are three different firewalls in FreeBSD and e.g. ipfw works perfectly well on MAC addresses (layer 2).Why pfSense and consequently OPNsense picked pf over ipfw I don't know. But that's the state of affairs it seems. During the years I built FreeBSD based routers and VPN gateways from scratch I always used ipfw.