This is my /jffs/scripts/firewall-start:
#!/bin/sh
logger firewall-start
ebtables -t filter -A FORWARD -p IPv4 -i wl0.1 --ip-dst 192.168.0.1 -j ACCEPT
ebtables -t filter -A FORWARD -p IPv4 -o wl0.1 --ip-src 192.168.0.1 -j ACCEPT
ebtables -t filter -A FORWARD -p IPv4 -i wl0.1 --ip-dst 192.168.0.16/29 -j ACCEPT
ebtables -t filter -A FORWARD -p IPv4 -o wl0.1 --ip-src 192.168.0.16/29 -j ACCEPT
ebtables -t filter -A FORWARD -p IPv4 -i wl0.1 --ip-dst 192.168.0.0/24 -j DROP
ebtables -t filter -A FORWARD -p IPv4 -o wl0.1 --ip-src 192.168.0.0/24 -j DROP
ebtables -t filter -A FORWARD -p IPv4 -i wl1.1 --ip-dst 192.168.0.1 -j ACCEPT
ebtables -t filter -A FORWARD -p IPv4 -o wl1.1 --ip-src 192.168.0.1 -j ACCEPT
ebtables -t filter -A FORWARD -p IPv4 -i wl1.1 --ip-dst 192.168.0.16/29 -j ACCEPT
ebtables -t filter -A FORWARD -p IPv4 -o wl1.1 --ip-src 192.168.0.16/29 -j ACCEPT
ebtables -t filter -A FORWARD -p IPv4 -i wl1.1 --ip-dst 192.168.0.0/24 -j DROP
ebtables -t filter -A FORWARD -p IPv4 -o wl1.1 --ip-src 192.168.0.0/24 -j DROP
ebtables -I FORWARD -d Broadcast -j ACCEPT
what this does is allow traffic between the guests and 192.168.0.1 (main router) and 8 addresses starting at 192.168.0.16 while dropping all the other LAN traffic from guests. Broadcasts are allowed for DHCP etc.
Note that in the Asus config page LAN, under the 'Route' tab, I have a static route to netmask&IP 0.0.0.0 with gateway set to 192.168.0.1. This is needed so all the traffic to the internet goes via the main router. Under DHCP server, I hardcoded the DNS to 192.168.0.1 and disabled DHCP. Under WAN, I also set the DNS 1 to 192.168.0.1. The WAN IP is pretty random 192.168.2.252 with gateway 192.168.0.1. WAN is on but NAT and UPnP are off on the Asus. Certain things don't work if you disable WAN. The firewall on the Asus is off, as my main router serves that function.
#!/bin/sh
logger firewall-start
ebtables -t filter -A FORWARD -p IPv4 -i wl0.1 --ip-dst 192.168.0.1 -j ACCEPT
ebtables -t filter -A FORWARD -p IPv4 -o wl0.1 --ip-src 192.168.0.1 -j ACCEPT
ebtables -t filter -A FORWARD -p IPv4 -i wl0.1 --ip-dst 192.168.0.16/29 -j ACCEPT
ebtables -t filter -A FORWARD -p IPv4 -o wl0.1 --ip-src 192.168.0.16/29 -j ACCEPT
ebtables -t filter -A FORWARD -p IPv4 -i wl0.1 --ip-dst 192.168.0.0/24 -j DROP
ebtables -t filter -A FORWARD -p IPv4 -o wl0.1 --ip-src 192.168.0.0/24 -j DROP
ebtables -t filter -A FORWARD -p IPv4 -i wl1.1 --ip-dst 192.168.0.1 -j ACCEPT
ebtables -t filter -A FORWARD -p IPv4 -o wl1.1 --ip-src 192.168.0.1 -j ACCEPT
ebtables -t filter -A FORWARD -p IPv4 -i wl1.1 --ip-dst 192.168.0.16/29 -j ACCEPT
ebtables -t filter -A FORWARD -p IPv4 -o wl1.1 --ip-src 192.168.0.16/29 -j ACCEPT
ebtables -t filter -A FORWARD -p IPv4 -i wl1.1 --ip-dst 192.168.0.0/24 -j DROP
ebtables -t filter -A FORWARD -p IPv4 -o wl1.1 --ip-src 192.168.0.0/24 -j DROP
ebtables -I FORWARD -d Broadcast -j ACCEPT
what this does is allow traffic between the guests and 192.168.0.1 (main router) and 8 addresses starting at 192.168.0.16 while dropping all the other LAN traffic from guests. Broadcasts are allowed for DHCP etc.
Note that in the Asus config page LAN, under the 'Route' tab, I have a static route to netmask&IP 0.0.0.0 with gateway set to 192.168.0.1. This is needed so all the traffic to the internet goes via the main router. Under DHCP server, I hardcoded the DNS to 192.168.0.1 and disabled DHCP. Under WAN, I also set the DNS 1 to 192.168.0.1. The WAN IP is pretty random 192.168.2.252 with gateway 192.168.0.1. WAN is on but NAT and UPnP are off on the Asus. Certain things don't work if you disable WAN. The firewall on the Asus is off, as my main router serves that function.
Last edited: