Again guest wifi on dumb AP

Hi, I'm a bit frustrated aftere 2 weeks of trying...
topology:

VDSL ------- tp link Archer VR1210 modem router wifi stock(192.168.1.1) ------- td w8970(wlan + guest) (192.168.1.82 static) (192.168.2.1 dhcp)

I saved from brick my tp link td w8970 stock modem router with openwrt.
I installed 22.03.5 to make a simple WLAN access point to extend my WLAN with same subnet of my cable LAN.
All perfect.

Now I want to add a guest wifi on this router on different subnet using the w8970.
I made a tons of trying with all diferent guides, but every guide is different (https://openwrt.org/docs/guide-user/network/wifi/guestwifi/start)
and using different openwrt web gui. In some guide there are vague notations about difference in firewall settings.

my problems: with some test I obtain the ip in guest subnet, but never internet access.
To have internet I have to bridge to other device but then I lost firewall isolation rules.

sorry for my errors, I did firstboot maybe.. 10 times :wink:

files following

uci show network
network.loopback=interface
network.loopback.device='lo'
network.loopback.proto='static'
network.loopback.ipaddr='127.0.0.1'
network.loopback.netmask='255.0.0.0'
network.globals=globals
network.globals.ula_prefix='fd66:8aec:0cd7::/48'
network.atm=atm-bridge
network.atm.vpi='1'
network.atm.vci='32'
network.atm.encaps='llc'
network.atm.payload='bridged'
network.atm.nameprefix='dsl'
network.dsl=dsl
network.dsl.annex='a'
network.dsl.tone='av'
network.dsl.ds_snr_offset='0'
network.@device[0]=device
network.@device[0].name='br-lan'
network.@device[0].type='bridge'
network.@device[0].ports='lan1' 'lan2' 'lan3' 'lan4'
network.@device[0].ipv6='0'
network.lan=interface
network.lan.device='br-lan'
network.lan.proto='static'
network.lan.ip6assign='60'
network.lan.gateway='192.168.1.1'
network.lan.ipaddr='192.168.1.82/24'
network.lan.dns='8.8.8.8'
network.@device[1]=device
network.@device[1].name='dsl0'
network.@device[1].macaddr='e8:94:f6:e3:b0:c3'
network.wan=interface
network.wan.device='dsl0'
network.wan.proto='pppoe'
network.wan.username='username'
network.wan.password='password'
network.wan.ipv6='1'
network.wan6=interface
network.wan6.device='@wan'
network.wan6.proto='dhcpv6'
network.guest=interface
network.guest.proto='static'
network.guest.ipaddr='192.168.2.1'
network.guest.netmask='255.255.255.0'
network.guest.gateway='192.168.1.1'
network.guest.dns='8.8.8.8' '192.168.1.1'
network.guest.device='wlan0-1'

wireless.radio0=wifi-device
wireless.radio0.type='mac80211'
wireless.radio0.path='pci0000:00/0000:00:00.0/0000:01:00.0'
wireless.radio0.channel='1'
wireless.radio0.band='2g'
wireless.radio0.htmode='HT20'
wireless.radio0.cell_density='0'
wireless.default_radio0=wifi-iface
wireless.default_radio0.device='radio0'
wireless.default_radio0.mode='ap'
wireless.default_radio0.ssid='ASUS1'
wireless.default_radio0.encryption='psk2'
wireless.default_radio0.key='xxxyyy'
wireless.default_radio0.network='lan guest'
wireless.wifinet1=wifi-iface
wireless.wifinet1.device='radio0'
wireless.wifinet1.mode='ap'
wireless.wifinet1.ssid='guest'
wireless.wifinet1.encryption='psk2'
wireless.wifinet1.key='xxx'
wireless.wifinet1.network='guest'

firewall.@defaults[0]=defaults
firewall.@defaults[0].input='ACCEPT'
firewall.@defaults[0].output='ACCEPT'
firewall.@defaults[0].forward='REJECT'
firewall.@defaults[0].synflood_protect='1'
firewall.@zone[0]=zone
firewall.@zone[0].name='wan'
firewall.@zone[0].network='wan' 'wan6'
firewall.@zone[0].input='REJECT'
firewall.@zone[0].output='ACCEPT'
firewall.@zone[0].forward='REJECT'
firewall.@zone[0].masq='1'
firewall.@zone[0].mtu_fix='1'
firewall.@zone[1]=zone
firewall.@zone[1].name='lan'
firewall.@zone[1].network='lan'
firewall.@zone[1].input='ACCEPT'
firewall.@zone[1].output='ACCEPT'
firewall.@zone[1].forward='ACCEPT'
firewall.@zone[2]=zone
firewall.@zone[2].name='guest'
firewall.@zone[2].output='ACCEPT'
firewall.@zone[2].forward='REJECT'
firewall.@zone[2].network='guest'
firewall.@zone[2].input='REJECT'
firewall.@forwarding[0]=forwarding
firewall.@forwarding[0].src='lan'
firewall.@forwarding[0].dest='wan'
firewall.@rule[0]=rule
firewall.@rule[0].name='Allow-DHCP-Renew'
firewall.@rule[0].src='wan'
firewall.@rule[0].proto='udp'
firewall.@rule[0].dest_port='68'
firewall.@rule[0].target='ACCEPT'
firewall.@rule[0].family='ipv4'
firewall.@rule[1]=rule
firewall.@rule[1].name='Allow-Ping'
firewall.@rule[1].src='wan'
firewall.@rule[1].proto='icmp'
firewall.@rule[1].icmp_type='echo-request'
firewall.@rule[1].family='ipv4'
firewall.@rule[1].target='ACCEPT'
firewall.@rule[2]=rule
firewall.@rule[2].name='Allow-IGMP'
firewall.@rule[2].src='wan'
firewall.@rule[2].proto='igmp'
firewall.@rule[2].family='ipv4'
firewall.@rule[2].target='ACCEPT'
firewall.@rule[3]=rule
firewall.@rule[3].name='Allow-DHCPv6'
firewall.@rule[3].src='wan'
firewall.@rule[3].proto='udp'
firewall.@rule[3].dest_port='546'
firewall.@rule[3].family='ipv6'
firewall.@rule[3].target='ACCEPT'
firewall.@rule[4]=rule
firewall.@rule[4].name='Allow-MLD'
firewall.@rule[4].src='wan'
firewall.@rule[4].proto='icmp'
firewall.@rule[4].src_ip='fe80::/10'
firewall.@rule[4].icmp_type='130/0' '131/0' '132/0' '143/0'
firewall.@rule[4].family='ipv6'
firewall.@rule[4].target='ACCEPT'
firewall.@rule[5]=rule
firewall.@rule[5].name='Allow-ICMPv6-Input'
firewall.@rule[5].src='wan'
firewall.@rule[5].proto='icmp'
firewall.@rule[5].icmp_type='echo-request' 'echo-reply' 'destination-unreachable' 'packet-too-big' 'time-exceeded' 'bad-header' 'unknown-header-type' 'router-solicitation' 'neighbour-solicitation' 'router-advertisement' 'neighbour-advertisement'
firewall.@rule[5].limit='1000/sec'
firewall.@rule[5].family='ipv6'
firewall.@rule[5].target='ACCEPT'
firewall.@rule[6]=rule
firewall.@rule[6].name='Allow-ICMPv6-Forward'
firewall.@rule[6].src='wan'
firewall.@rule[6].dest='*'
firewall.@rule[6].proto='icmp'
firewall.@rule[6].icmp_type='echo-request' 'echo-reply' 'destination-unreachable' 'packet-too-big' 'time-exceeded' 'bad-header' 'unknown-header-type'
firewall.@rule[6].limit='1000/sec'
firewall.@rule[6].family='ipv6'
firewall.@rule[6].target='ACCEPT'
firewall.@rule[7]=rule
firewall.@rule[7].name='Allow-IPSec-ESP'
firewall.@rule[7].src='wan'
firewall.@rule[7].dest='lan'
firewall.@rule[7].proto='esp'
firewall.@rule[7].target='ACCEPT'
firewall.@rule[8]=rule
firewall.@rule[8].name='Allow-ISAKMP'
firewall.@rule[8].src='wan'
firewall.@rule[8].dest='lan'
firewall.@rule[8].dest_port='500'
firewall.@rule[8].proto='udp'
firewall.@rule[8].target='ACCEPT'
firewall.@forwarding[1]=forwarding
firewall.@forwarding[1].src='guest'
firewall.@forwarding[1].dest='wan'
firewall.@rule[9]=rule
firewall.@rule[9].name='guest dhcp'
firewall.@rule[9].proto='udp'
firewall.@rule[9].src='guest'
firewall.@rule[9].target='ACCEPT'
firewall.@rule[9].dest_port='67'
firewall.@rule[10]=rule
firewall.@rule[10].name='guest dns'
firewall.@rule[10].src='guest'
firewall.@rule[10].src_port='53'
firewall.@rule[10].target='ACCEPT'
firewall.@rule[10].src_ip='192.168.2.0'
firewall.@rule[11]=rule
firewall.@rule[11].name='guest block lan'
firewall.@rule[11].proto='all'
firewall.@rule[11].src='guest'
firewall.@rule[11].dest='lan'
firewall.@rule[11].dest_ip='192.168.1.0/24'
firewall.@rule[11].target='DROP'

dhcp.@dnsmasq[0]=dnsmasq
dhcp.@dnsmasq[0].domainneeded='1'
dhcp.@dnsmasq[0].boguspriv='1'
dhcp.@dnsmasq[0].filterwin2k='0'
dhcp.@dnsmasq[0].localise_queries='1'
dhcp.@dnsmasq[0].rebind_protection='1'
dhcp.@dnsmasq[0].rebind_localhost='1'
dhcp.@dnsmasq[0].local='/lan/'
dhcp.@dnsmasq[0].domain='lan'
dhcp.@dnsmasq[0].expandhosts='1'
dhcp.@dnsmasq[0].nonegcache='0'
dhcp.@dnsmasq[0].authoritative='1'
dhcp.@dnsmasq[0].readethers='1'
dhcp.@dnsmasq[0].leasefile='/tmp/dhcp.leases'
dhcp.@dnsmasq[0].resolvfile='/tmp/resolv.conf.d/resolv.conf.auto'
dhcp.@dnsmasq[0].nonwildcard='1'
dhcp.@dnsmasq[0].localservice='1'
dhcp.@dnsmasq[0].ednspacket_max='1232'
dhcp.lan=dhcp
dhcp.lan.interface='lan'
dhcp.lan.start='100'
dhcp.lan.limit='150'
dhcp.lan.leasetime='12h'
dhcp.lan.dhcpv4='server'
dhcp.lan.ignore='1'
dhcp.lan.dynamicdhcp='0'
dhcp.wan=dhcp
dhcp.wan.interface='wan'
dhcp.wan.ignore='1'
dhcp.odhcpd=odhcpd
dhcp.odhcpd.maindhcp='0'
dhcp.odhcpd.leasefile='/tmp/hosts/odhcpd'
dhcp.odhcpd.leasetrigger='/usr/sbin/odhcpd-update'
dhcp.odhcpd.loglevel='4'
dhcp.guest=dhcp
dhcp.guest.interface='guest'
dhcp.guest.start='100'
dhcp.guest.limit='150'
dhcp.guest.leasetime='1h'

There are several errors and I'm not sure I found them all.
Run this and if it still doesn't work, repost the configs.

uci add network device
uci set network.@device[-1].name='br-guest'
uci set network.@device[-1].type='bridge'
uci del network.guest.gateway
uci del network.guest.dns
uci set network.guest.device='br-guest'
uci set firewall.@zone[1].masq='1'
uci set firewall.@forwarding[1].dest='lan'
uci del firewall.@rule[10].src_port
uci del firewall.@rule[10].src_ip
uci set firewall.@rule[10].proto='udp'
uci set firewall.@rule[10].dest_port='53'
uci commit
/etc/init.d/network restart
/etc/init.d/firewall restart
1 Like

Allow forwarding from Guest to LAN?

Enable Masquerading on the LAN zone?

Wrong gateway?

You know the default gateway must be on the same subnet, right?

Yes of course I was mistaken this gateway with the DHCP gateway for the guest clients (not used to reading uci it is like the matrix for me, I find looking at config files much easier, but that is probably just me)

@pavelgl
thanks, with your few lines all is working.

why do you remove firewall rule on port 53?
now i'm looking for my errors and maybe I forgot every time to restart (or LUCI restart automagically?)

Not removed, just fixed.

You must use the destination port, not the source port.

Specifying a (source) subnet requires CIDR notation and you missed the suffix.

It does if you use the "Save & Apply" button.