No internet Access on AP mode

Hi,

I try to setup my device on AP mode with 3 differents Lan for wifi.
DHCP works fine on the 3 Lans but i haven't got any internet connection ?

---------- Network ------------

config interface 'loopback'
option device 'lo'
option proto 'static'
option ipaddr '127.0.0.1'
option netmask '255.0.0.0'

config globals 'globals'
option ula_prefix 'fd87:9671:a8b7::/48'
option packet_steering '1'

config device
option name 'br-lan'
option type 'bridge'
list ports 'lan1'
list ports 'lan2'
list ports 'lan3'
list ports 'lan4'

config device
option name 'lan1'
option macaddr '90:8d:78:23:b3:20'

config device
option name 'lan2'
option macaddr '90:8d:78:23:b3:20'

config device
option name 'lan3'
option macaddr '90:8d:78:23:b3:20'

config device
option name 'lan4'
option macaddr '90:8d:78:23:b3:20'

config interface 'lan'
option device 'br-lan'
option proto 'static'
option ipaddr '192.168.0.252'
option netmask '255.255.255.0'
option ip6assign '60'
option gateway '192.168.0.254'
list dns '192.168.0.7'

config device
option name 'wan'
option macaddr '90:8d:78:23:b3:23'

config interface 'wan'
option device 'wan'
option proto 'dhcp'

config interface 'Private'
option proto 'static'
option ipaddr '192.168.210.254'
option netmask '255.255.255.0'
list dns '192.168.0.7'

config interface 'Guest'
option proto 'static'
option ipaddr '192.168.220.254'
option netmask '255.255.255.0'
list dns '192.168.0.7'

config interface 'Iot'
option proto 'static'
option ipaddr '192.168.230.254'
option netmask '255.255.255.0'
list dns '192.168.0.7'
option broadcast '192.168.30.255'

------ DHCP ----

config dnsmasq
option domainneeded '1'
option boguspriv '1'
option filterwin2k '0'
option localise_queries '1'
option rebind_protection '1'
option rebind_localhost '1'
option local '/lan/'
option domain 'lan'
option expandhosts '1'
option nonegcache '0'
option cachesize '1000'
option authoritative '1'
option readethers '1'
option leasefile '/tmp/dhcp.leases'
option resolvfile '/tmp/resolv.conf.d/resolv.conf.auto'
option nonwildcard '1'
option localservice '1'
option ednspacket_max '1232'
option filter_aaaa '0'
option filter_a '0'

config dhcp 'lan'
option interface 'lan'
option start '100'
option limit '150'
option leasetime '12h'
option dhcpv4 'server'
option ignore '1'

config dhcp 'wan'
option interface 'wan'
option ignore '1'

config odhcpd 'odhcpd'
option maindhcp '0'
option leasefile '/tmp/hosts/odhcpd'
option leasetrigger '/usr/sbin/odhcpd-update'
option loglevel '4'

config dhcp 'Private'
option interface 'Private'
option start '10'
option limit '50'
option leasetime '12h'

config dhcp 'Guest'
option interface 'Guest'
option start '10'
option limit '50'
option leasetime '12h'

config dhcp 'Iot'
option interface 'Iot'
option start '10'
option limit '50'
option leasetime '12h'

---- FW ------

config defaults
option input 'REJECT'
option output 'ACCEPT'
option forward 'REJECT'
option synflood_protect '1'

config zone
option name 'lan'
option input 'ACCEPT'
option output 'ACCEPT'
option forward 'ACCEPT'
list network 'lan'

config zone
option name 'private'
option input 'ACCEPT'
option output 'ACCEPT'
option forward 'ACCEPT'
option log '1'
list network 'Private'

config zone
option name 'guest'
option input 'ACCEPT'
option output 'ACCEPT'
option forward 'ACCEPT'
option log '1'
list network 'Guest'

config zone
option name 'iot'
option input 'ACCEPT'
option output 'ACCEPT'
option forward 'ACCEPT'
option log '1'
list network 'Iot'

config rule
option name 'Allow DHCP'
list proto 'udp'
option dest_port '67'
option target 'ACCEPT'
option src '*'

config rule
option name 'Allow DNS'
option src '*'
option dest_port '53'
option target 'ACCEPT'

config zone
option name 'wan'
option input 'ACCEPT'
option output 'ACCEPT'
option forward 'ACCEPT'
list network 'wan'

config forwarding
option src 'iot'
option dest 'wan'

config forwarding
option src 'guest'
option dest 'wan'

config forwarding
option src 'private'
option dest 'wan'

--- wireless -----

config wifi-device 'radio0'
option type 'mac80211'
option path '1e140000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0'
option channel '36'
option band '5g'
option htmode 'VHT80'
option disabled '1'

config wifi-iface 'default_radio0'
option device 'radio0'
option network 'lan'
option mode 'ap'
option ssid 'OpenWrt'
option encryption 'none'

config wifi-device 'radio1'
option type 'mac80211'
option path '1e140000.pcie/pci0000:00/0000:00:01.0/0000:02:00.0'
option channel '1'
option band '2g'
option htmode 'HT20'
option cell_density '0'

config wifi-iface 'default_radio1'
option device 'radio1'
option network 'lan'
option mode 'ap'
option ssid 'OpenWrt'
option encryption 'none'

config wifi-iface 'wifinet2'
option device 'radio1'
option mode 'ap'
option ssid 'private4'
option encryption 'none'
option network 'Private'

config wifi-iface 'wifinet3'
option device 'radio1'
option mode 'ap'
option ssid 'guest4'
option encryption 'none'
option network 'Guest'

config wifi-iface 'wifinet4'
option device 'radio1'
option mode 'ap'
option ssid 'iot4'
option encryption 'none'
option network 'Iot'

What is used for the upstream connection? It looks like the lan interface, is that right?

If so... add masquerading to the lan firewall zone:

config zone
option name 'lan'
option input 'ACCEPT'
option output 'ACCEPT'
option forward 'ACCEPT'
list network 'lan'
option masq '1'

and edit the other networks to forward to the lan zone instead of the wan

Restart after making those changes and try again. There may be other issues, too... but these are the immediately obvious ones.

1 Like

Thank's a lot. Everything works perfectly as I want.

The main key was "add masquerading to the lan" because inital setting was with this lan.but doesn't works.

I update my firewall rules

config zone
option name 'lan'
option input 'ACCEPT'
option output 'ACCEPT'
option forward 'ACCEPT'
list network 'lan'
option masq '1'

config zone
option name 'private'
option input 'ACCEPT'
option output 'ACCEPT'
option forward 'REJECT'
option log '1'
list network 'Private'

config zone
option name 'guest'
option input 'REJECT'
option output 'ACCEPT'
option forward 'REJECT'
option log '1'
list network 'Guest'

config zone
option name 'iot'
option input 'REJECT'
option output 'ACCEPT'
option forward 'REJECT'
option log '1'
list network 'Iot'

Great! Glad it is working!

If your problem is solved, please consider marking this topic as [Solved]. See How to mark a topic as [Solved] for a short how-to.
Thanks! :slight_smile:

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.