Is there anyway to prevent LAN and Wi-Fi connected devices (i.e., IoT) from probing the local network ?
Is there anyway to prevent LAN and Wi-Fi connected devices (i.e., IoT) from probing the local network ?
ebtables -t broute -I BROUTING -p ARP -j CONTINUE --log --log-arp --log-level 7
ebtables -I INPUT -p ARP -j CONTINUE --log --log-arp --log-level 7
ebtables -I OUTPUT -p ARP -j CONTINUE --log --log-arp --log-level 7
ebtables -I FORWARD -p ARP -j CONTINUE --log --log-arp --log-level 7
watch -n 1 dmesg
ebtables -t broute -D BROUTING -p ARP -j CONTINUE --log --log-arp --log-level 7
ebtables -D INPUT -p ARP -j CONTINUE --log --log-arp --log-level 7
ebtables -D OUTPUT -p ARP -j CONTINUE --log --log-arp --log-level 7
ebtables -D FORWARD -p ARP -j CONTINUE --log --log-arp --log-level 7
I'm looking for a way to make it so that none of the devices connected to the router can discover and access another LAN device (excluding the router).
1) Does Asuswrt-Merlin support dynamic VLANs ?
2) How do you use VLANs to isolate devices from the network and provide them to access the WAN without allowing them to probe the local network ?
If it will help you, here's how I customized my Asus Guest Network.Do you have to duplicate iptables rules to support the new VLAN interface ?
#!/bin/sh
WANIF="$1"
IPADDR=$(/usr/sbin/nvram get lan_ipaddr)
NETADDR=$(/usr/sbin/ip route|/bin/grep br0|/usr/bin/cut -d' ' -f1)
HWADDR="$(nvram get lan_hwaddr)"
#########################################################################################################
# LAN port 4 on the RT-AC68U is a trunk port for a 24-port managed gigabit Ethernet switch
# that has 12 guest Ethernet ports (vlan14), 11 full access Ethernet ports (vlan1),
# and 1 uplink Ethernet port (vlan1 + vlan14)
/usr/sbin/robocfg show | /bin/grep -qF "vlan14:"
if [ $? -ne 0 ]; then
/usr/sbin/robocfg vlan 1 ports "1 2 3 4 5t" # port 4 is tagged vlan1 by the switch
/usr/sbin/robocfg vlan 14 ports "4t 5t" # port 4 is tagged vlan14 by the switch
# /usr/sbin/robocfg vlan 1 ports "1 2 3 5t" # Asus router leaves ports 1-3 untagged
# /usr/sbin/robocfg vlan 14 ports "4t 5t" # Asus router tags port 4 with vlan14
/sbin/vconfig add eth0 14
/sbin/ifconfig vlan14 up
/usr/sbin/brctl addif br0 vlan14
fi
#########################################################################################################
# Re-implementation of device isolation for AsusWRT Guest Network
ebtables() {
local cmdline="$@"
local deleteline="$(/bin/echo $cmdline | /bin/sed -r 's/(\s*-)(I|A)(\s+[a-zA-Z]\w*)(\s+[0-9]*\s+|\s+)(.*)/\1D\3 \5/')"
# if the rule is Insert or Add, then remove all duplicates
if [ "$deleteline" != "$cmdline" ]; then
/usr/sbin/ebtables $deleteline > /dev/null 2>&1
while [ $? -eq 0 ]; do
/usr/sbin/ebtables $deleteline > /dev/null 2>&1
done
fi
# apply the rule
/usr/sbin/ebtables $cmdline
}
for IF_GUEST in wl0.1 wl1.1 vlan14 ; do
# Remove the AsusWRT guest network rules, if any
ebtables -t broute -D BROUTING -p IPv4 -i $IF_GUEST --ip-dst $NETADDR --ip-proto tcp -j DROP
# For each guest network physical interface, un-bridge all frames entering the
# bridge interface (br0) that are destined for the local network,
# for protocols IPv4 and ARP
ebtables -t broute -I BROUTING -p IPv4 -i $IF_GUEST --ip-dst $NETADDR -j DROP
ebtables -t broute -I BROUTING -p ARP -i $IF_GUEST --arp-ip-dst $NETADDR -j DROP
#ebtables -t broute -I BROUTING -p IPv6 -i $IF_GUEST --ip6-dst $NETADDR -j DROP
# Stay bridged (br0): ARP broadcasts
ebtables -t broute -I BROUTING -p ARP -i $IF_GUEST -d ff:ff:ff:ff:ff:ff -j ACCEPT
# Stay bridged (br0): ARP reply from/to router
ebtables -t broute -I BROUTING -p ARP -i $IF_GUEST --arp-ip-src $IPADDR -j ACCEPT
ebtables -t broute -I BROUTING -p ARP -i $IF_GUEST --arp-ip-dst $IPADDR -j ACCEPT
# Stay bridged (br0): DHCP client: Discover, Request
ebtables -t broute -I BROUTING -p IPv4 -i $IF_GUEST --ip-src 0.0.0.0 --ip-dst 255.255.255.255 --ip-proto udp --ip-sport 68 --ip-dport 67 -j ACCEPT
# Stay bridged (br0): DHCP client: Release
ebtables -t broute -I BROUTING -p IPv4 -i $IF_GUEST --ip-src $NETADDR --ip-dst $IPADDR --ip-proto udp --ip-sport 68 --ip-dport 67 -j ACCEPT
# Stay bridged (br0): DHCP server: Offer, ACK
ebtables -t broute -I BROUTING -p IPv4 -i $IF_GUEST --ip-src $IPADDR --ip-dst $NETADDR --ip-proto udp --ip-sport 67 --ip-dport 68 -j ACCEPT
# Stay bridged (br0): DNS
ebtables -t broute -I BROUTING -p IPv4 -i $IF_GUEST --ip-src $NETADDR --ip-dst $IPADDR --ip-proto udp --ip-dport 53 -j ACCEPT
# Stay bridged (br0): NTP
ebtables -t broute -I BROUTING -p IPv4 -i $IF_GUEST --ip-src $NETADDR --ip-dst $IPADDR --ip-proto udp --ip-dport 123 -j ACCEPT
# Stay bridged (br0): MiniDLNA
ebtables -t broute -I BROUTING -p IPv4 -i $IF_GUEST --ip-dst $IPADDR --ip-proto tcp --ip-dport 8200 -j ACCEPT
# Stay bridged (br0): HP printer
ebtables -t broute -I BROUTING -p IPv4 -i $IF_GUEST -s xx:xx:xx:xx:xx:xx --ip-proto tcp --ip-sport 9100 -j ACCEPT
# Drop all un-bridged frames for this physical interface (device isolation happens here)
ebtables -I FORWARD -o $IF_GUEST -j DROP
ebtables -I FORWARD -i $IF_GUEST -j DROP
# Allow SSDP multicast to discover MiniDLNA
ebtables -I FORWARD -i $IF_GUEST -p IPv4 --ip-proto udp -d 01:00:5e:7f:ff:fa --ip-dport 1900 -j ACCEPT
done
Thread starter | Title | Forum | Replies | Date |
---|---|---|---|---|
Q | [Feature Request] Schedule DoS Protection state and/or whitelist option | Asuswrt-Merlin | 5 |
Welcome To SNBForums
SNBForums is a community for anyone who wants to learn about or discuss the latest in wireless routers, network storage and the ins and outs of building and maintaining a small network.
If you'd like to post a question, simply register and have at it!
While you're at it, please check out SmallNetBuilder for product reviews and our famous Router Charts, Ranker and plenty more!