Hey everyone,
I operate my AC68 in AP mode behind pfSense firewall and I needed to prevent guest wifi clients from accessing network services or other devices on the network. In the past, I used to run a separate wireless router for guests that made isolation super easy because of NAT but I decided against it to cut my energy consumption and be more environmentally friendly. There are no firewall rules in AP mode and interfaces are simply bridged. I did not see any prior example of this being done so I came with the following for services-start shell script:
#!/bin/sh
/usr/sbin/ebtables -t filter -N LANDROP
/usr/sbin/ebtables -t filter -P LANDROP DROP
/usr/sbin/ebtables -t filter -P FORWARD DROP
/usr/sbin/ebtables -t filter -A FORWARD -j LANDROP
/usr/sbin/ebtables -t filter -A LANDROP -p arp -i wl0.1 --arp-ip-dst 192.168.0.1 -j ACCEPT
/usr/sbin/ebtables -t filter -A LANDROP -p arp -i wl1.1 --arp-ip-dst 192.168.0.1 -j ACCEPT
/usr/sbin/ebtables -t filter -A LANDROP -p ipv4 -i wl0.1 --ip-dst ! 192.168.0.0/16 -j ACCEPT
/usr/sbin/ebtables -t filter -A LANDROP -p ipv4 -i wl1.1 --ip-dst ! 192.168.0.0/16 -j ACCEPT
/usr/sbin/ebtables -t filter -A LANDROP -p ipv4 -i wl0.1 --ip-proto udp --ip-dport 67 -j ACCEPT
/usr/sbin/ebtables -t filter -A LANDROP -p ipv4 -i wl1.1 --ip-proto udp --ip-dport 67 -j ACCEPT
/usr/sbin/ebtables -t filter -A LANDROP -i wl0.1 -j RETURN
/usr/sbin/ebtables -t filter -A LANDROP -i wl1.1 -j RETURN
/usr/sbin/ebtables -t filter -A LANDROP -j ACCEPT
/usr/sbin/ebtables -t filter -A INPUT -p ipv4 -i wl0.1 -j DROP
/usr/sbin/ebtables -t filter -A INPUT -p ipv4 -i wl1.1 -j DROP
Now, it is working as expected and network access is severely restricted for guest wifi clients, but, one issue is because these clients are on the same subnet as other devices and being served by the same pfSense device, I am unable to limit access to pfSense device from these guest clients. pfSense IP is 192.168.0.1 and if I try to limit access to it then packet routing is impacted. Is there some approach to tackle this issue? Also, any flaws in my approach to limit guest wifi clients? Sorry for not commenting the script.
Thanks
Ron
I operate my AC68 in AP mode behind pfSense firewall and I needed to prevent guest wifi clients from accessing network services or other devices on the network. In the past, I used to run a separate wireless router for guests that made isolation super easy because of NAT but I decided against it to cut my energy consumption and be more environmentally friendly. There are no firewall rules in AP mode and interfaces are simply bridged. I did not see any prior example of this being done so I came with the following for services-start shell script:
#!/bin/sh
/usr/sbin/ebtables -t filter -N LANDROP
/usr/sbin/ebtables -t filter -P LANDROP DROP
/usr/sbin/ebtables -t filter -P FORWARD DROP
/usr/sbin/ebtables -t filter -A FORWARD -j LANDROP
/usr/sbin/ebtables -t filter -A LANDROP -p arp -i wl0.1 --arp-ip-dst 192.168.0.1 -j ACCEPT
/usr/sbin/ebtables -t filter -A LANDROP -p arp -i wl1.1 --arp-ip-dst 192.168.0.1 -j ACCEPT
/usr/sbin/ebtables -t filter -A LANDROP -p ipv4 -i wl0.1 --ip-dst ! 192.168.0.0/16 -j ACCEPT
/usr/sbin/ebtables -t filter -A LANDROP -p ipv4 -i wl1.1 --ip-dst ! 192.168.0.0/16 -j ACCEPT
/usr/sbin/ebtables -t filter -A LANDROP -p ipv4 -i wl0.1 --ip-proto udp --ip-dport 67 -j ACCEPT
/usr/sbin/ebtables -t filter -A LANDROP -p ipv4 -i wl1.1 --ip-proto udp --ip-dport 67 -j ACCEPT
/usr/sbin/ebtables -t filter -A LANDROP -i wl0.1 -j RETURN
/usr/sbin/ebtables -t filter -A LANDROP -i wl1.1 -j RETURN
/usr/sbin/ebtables -t filter -A LANDROP -j ACCEPT
/usr/sbin/ebtables -t filter -A INPUT -p ipv4 -i wl0.1 -j DROP
/usr/sbin/ebtables -t filter -A INPUT -p ipv4 -i wl1.1 -j DROP
Now, it is working as expected and network access is severely restricted for guest wifi clients, but, one issue is because these clients are on the same subnet as other devices and being served by the same pfSense device, I am unable to limit access to pfSense device from these guest clients. pfSense IP is 192.168.0.1 and if I try to limit access to it then packet routing is impacted. Is there some approach to tackle this issue? Also, any flaws in my approach to limit guest wifi clients? Sorry for not commenting the script.
Thanks
Ron