Hi,
I got a AC68U. Instead of AP isolation for Guest network, I would like to create a bridge for Guest network and control the access by iptables. also I would like the guest network has its own ip range and DHCP server.
So here is what I did. in firewall-start script I do something like this
then in dnsmasq.conf.add
But the real problem is connected client not getting proper ip. Whenever I try to connect to wl0.1 guest AP, I get a ip as 169.254.211.250 and with limited access. it seems the DHCP change is not working. but I am sure my custom config is added as the dnsmasq.conf is updated with my custom config.
here is my bridge config
Any help is appreciated.
Thanks
Leon
I got a AC68U. Instead of AP isolation for Guest network, I would like to create a bridge for Guest network and control the access by iptables. also I would like the guest network has its own ip range and DHCP server.
So here is what I did. in firewall-start script I do something like this
Code:
exec 1>>/tmp/firewall-start.log 2>&1
date
set -x
WANIP=$(/sbin/ifconfig eth0|grep 'inet addr'|cut -d':' -f2|awk '{print $1}')
# remove guest1/guest2 2.4Ghz/5Ghz from br0
brctl delif br0 wl0.1
# create br1 and br2
brctl addbr br1
brctl addif br1 wl0.1
ifconfig br1 192.168.2.1 netmask 255.255.255.0 broadcast 192.168.2.255
iptables -t nat -I POSTROUTING -o eth0 -j SNAT --to $WANIP
iptables -I FORWARD -i br1 -m state --state NEW -j ACCEPT
iptables -I FORWARD -i br1 -o br0 -m state --state NEW -j DROP
iptables -I FORWARD -i br1 -d 192.168.1.0/24 -m state --state NEW -j DROP
then in dnsmasq.conf.add
Code:
log-facility=/tmp/dnsmasq.log
log-queries
interface=br1
dhcp-range=br1,192.168.2.2,192.168.2.254,255.255.255.0,86400s
dhcp-option=br1,3,192.168.2.1
But the real problem is connected client not getting proper ip. Whenever I try to connect to wl0.1 guest AP, I get a ip as 169.254.211.250 and with limited access. it seems the DHCP change is not working. but I am sure my custom config is added as the dnsmasq.conf is updated with my custom config.
Code:
pid-file=/var/run/dnsmasq.pid
user=nobody
bind-dynamic
interface=br0
interface=ppp1*
no-dhcp-interface=ppp1*
resolv-file=/tmp/resolv.conf
servers-file=/tmp/resolv.dnsmasq
no-poll
no-negcache
cache-size=1500
min-port=4096
dhcp-range=lan,192.168.1.2,192.168.1.254,255.255.255.0,86400s
dhcp-option=lan,3,192.168.1.1
dhcp-option=lan,252,"\n"
dhcp-authoritative
read-ethers
addn-hosts=/etc/hosts.dnsmasq
# Logging
log-facility=/tmp/dnsmasq.log
log-queries
interface=br1
dhcp-range=br1,192.168.2.2,192.168.2.254,255.255.255.0,86400s
dhcp-option=br1,3,192.168.2.1
here is my bridge config
Code:
admin@RT-AC68U-B778:/tmp/home/root# brctl show
bridge name bridge id STP enabled interfaces
br0 8000.54a050cfb778 yes vlan1
eth1
eth2
br1 8000.54a050cfb779 no wl0.1
Any help is appreciated.
Thanks
Leon
Last edited: