Problem with DHCP when more than one SSIDs in guest network

Hi,

I have a strange problem with WiFi connection when I have three SSIDs. One is for the private network and two for the guest network.
I configured my Dumb Access Points based on instruction:


My main router has IP 192.168.2.1 and I have three Dumb access points which have IPs: 192.168.2.2-4
On each access point I have two SSID (one for the private network and one for guest network)
I configured guest wifi using the below guide:

On each AP I have separate subnet (192.168.102.1, 192.168.103.1, 192.168.104.1) for guests with separate DHCP.
Until now everything works as expected.

On one of the AP I want to add additional SSID in the guest network.
When I have both SSIDs in guest network enabled there is a problem that only one SSID works normally and when trying to connect to another SSID, my device receives IP starting from169.254 (DHCP not working correctly?).

It looks that everything works correctly when I created a third network interface with separate subnet (192.168.202.1) and DHCP.

Can I have more than one SSID within one network interface?

My configs:

#network
config interface 'loopback'
        option ifname 'lo'
        option proto 'static'
        option ipaddr '127.0.0.1'
        option netmask '255.0.0.0'

config globals 'globals'
        option ula_prefix 'fd53:7c73:aaa0::/48'

config interface 'lan'
        option type 'bridge'
        option ifname 'eth0.1'
        option proto 'static'
        option ipaddr '192.168.2.4'
        option netmask '255.255.255.0'
        option ip6assign '60'
        option gateway '192.168.2.1'
        list dns '192.168.2.1'

config device 'lan_eth0_1_dev'
        option name 'eth0.1'
        option macaddr 'a0:63:91:7d:26:2e'

config interface 'wan'
        option ifname 'eth0.2'
        option proto 'dhcp'

config device 'wan_eth0_2_dev'
        option name 'eth0.2'
        option macaddr 'a0:63:91:7d:26:2f'

config interface 'wan6'
        option ifname 'eth0.2'
        option proto 'dhcpv6'

config switch
        option name 'switch0'
        option reset '1'
        option enable_vlan '1'
        option ar8xxx_mib_type '0'
        option ar8xxx_mib_poll_interval '500'

config switch_vlan
        option device 'switch0'
        option vlan '1'
        option ports '0t 4 3 2 1'
        option vid '1'

config switch_vlan
        option device 'switch0'
        option vlan '2'
        option ports '0t 5'
        option vid '2'

config interface 'guest'
        option proto 'static'
        option ipaddr '192.168.104.1'
        option netmask '255.255.255.0'
# wireless
config wifi-device 'radio0'
        option type 'mac80211'
        option hwmode '11g'
        option path 'platform/ar934x_wmac'
        option htmode 'HT20'
        option country 'US'
        option channel '11'

config wifi-iface 'default_radio0'
        option device 'radio0'
        option network 'lan'
        option mode 'ap'
        option key '19051985'
        option ssid 'HiddenNetwork'
        option hidden '1'
        option ft_over_ds '0'
        option dtim_period '3'
        option ft_psk_generate_local '1'
        option mobility_domain '5F11'
        option ieee80211r '1'
        option encryption 'psk2'

config wifi-device 'radio1'
        option type 'mac80211'
        option hwmode '11a'
        option path 'pci0000:00/0000:00:00.0'
        option htmode 'HT20'
        option country 'US'
        option channel '56'

config wifi-iface 'default_radio1'
        option device 'radio1'
        option network 'lan'
        option mode 'ap'
        option key '************'
        option ssid 'PrivateNetwork'
        option hidden '1'
        option ft_over_ds '0'
        option dtim_period '3'
        option ft_psk_generate_local '1'
        option mobility_domain '5F11'
        option ieee80211r '1'
        option encryption 'psk2'

config wifi-iface 'wifinet3'
        option device 'radio0'
        option mode 'ap'
        option network 'guest'
        option encryption 'psk2'
        option ssid 'guest'
        option key '************'
        option disabled '1'

config wifi-iface 'wifinet4'
        option network 'guest'
        option ssid 'iot'
        option encryption 'psk2'
        option device 'radio0'
        option mode 'ap'
        option key '************'
        option disabled '1'
# 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 authoritative '1'
        option readethers '1'
        option leasefile '/tmp/dhcp.leases'
        option resolvfile '/tmp/resolv.conf.auto'
        option nonwildcard '1'
        option localservice '1'

config dhcp 'lan'
        option interface 'lan'
        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 'guest'
        option interface 'guest'
        option start '100'
        option limit '150'
        option leasetime '1h'
# firewall
config defaults
        option input 'ACCEPT'
        option output 'ACCEPT'
        option forward 'REJECT'
        option synflood_protect '1'

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

config zone
        option name 'wan'
        option input 'REJECT'
        option output 'ACCEPT'
        option forward 'REJECT'
        option masq '1'
        option mtu_fix '1'
        option network 'wan wan6'

config forwarding
        option src 'lan'
        option dest 'wan'

config rule
        option name 'Allow-DHCP-Renew'
        option src 'wan'
        option proto 'udp'
        option dest_port '68'
        option target 'ACCEPT'
        option family 'ipv4'

config rule
        option name 'Allow-Ping'
        option src 'wan'
        option proto 'icmp'
        option icmp_type 'echo-request'
        option family 'ipv4'
        option target 'ACCEPT'

config rule
        option name 'Allow-IGMP'
        option src 'wan'
        option proto 'igmp'
        option family 'ipv4'

config rule
        option name 'Allow-DHCPv6'
        option src 'wan'
        option proto 'udp'
        option src_ip 'fc00::/6'
        option dest_ip 'fc00::/6'
        option dest_port '546'
        option family 'ipv6'
        option target 'ACCEPT'

config rule
        option name 'Allow-MLD'
        option src 'wan'
        option proto 'icmp'
        option src_ip 'fe80::/10'
        list icmp_type '130/0'
        list icmp_type '131/0'
        list icmp_type '132/0'
        list icmp_type '143/0'
        option family 'ipv6'
        option target 'ACCEPT'

config rule
        option name 'Allow-ICMPv6-Input'
        option src 'wan'
        option proto 'icmp'
        list icmp_type 'echo-request'
        list icmp_type 'echo-reply'
        list icmp_type 'destination-unreachable'
        list icmp_type 'packet-too-big'
        list icmp_type 'time-exceeded'
        list icmp_type 'bad-header'
        list icmp_type 'unknown-header-type'
        list icmp_type 'router-solicitation'
        list icmp_type 'neighbour-solicitation'
        list icmp_type 'router-advertisement'
        list icmp_type 'neighbour-advertisement'
        option limit '1000/sec'
        option family 'ipv6'
        option target 'ACCEPT'

config rule
        option name 'Allow-ICMPv6-Forward'
        option src 'wan'
        option dest '*'
        option proto 'icmp'
        list icmp_type 'echo-request'
        list icmp_type 'echo-reply'
        list icmp_type 'destination-unreachable'
        list icmp_type 'packet-too-big'
        list icmp_type 'time-exceeded'
        list icmp_type 'bad-header'
        list icmp_type 'unknown-header-type'
        option limit '1000/sec'
        option family 'ipv6'
        option target 'ACCEPT'

config rule
        option name 'Allow-IPSec-ESP'
        option src 'wan'
        option dest 'lan'
        option proto 'esp'
        option target 'ACCEPT'

config rule
        option name 'Allow-ISAKMP'
        option src 'wan'
        option dest 'lan'
        option dest_port '500'
        option proto 'udp'
        option target 'ACCEPT'

config include
        option path '/etc/firewall.user'

config zone
        option network 'guest'
        option name 'guest'
        option output 'ACCEPT'
        option input 'REJECT'
        option forward 'REJECT'

config forwarding
        option dest 'lan'
        option src 'guest'

config rule
        option target 'ACCEPT'
        list proto 'udp'
        option name 'Guest DHCP'
        option src 'guest'
        option dest_port '67-68'

config rule
        option dest_port '53'
        option src 'guest'
        option name 'Guest DNS'
        option target 'ACCEPT'

config rule
        option src 'guest'
        option name 'Block Guest Access To Private Network'
        option dest 'lan'
        list dest_ip '192.168.2.1/24'
        option target 'DROP'
        list proto 'all'

Thanks in advance for an advise,
Pawel.

1 Like

They are both disabled.

Currently yes, when one is enabled it is working but it is not working when I enable both.

The proper way to have multiple SSIDs on a dumb AP is trunking separate VLANs on the LAN wire that connects the AP with the main router; this way, the AP is dumb on all SSIDs, and does not need to do DHCP/DNS/NAT for any SSID.

Is there any reason why my configuration cannot work?
The only difference (I think) compared to the guide I mentioned above is that I need one more SSID.

Configure guest interface as bridge:
https://openwrt.org/docs/guide-user/network/wifi/guestwifi/guest-wlan#network

Enforce guest DHCP settings:
https://openwrt.org/docs/guide-user/network/wifi/guestwifi/extras#resolving_race_conditions

3 Likes

As @vgaetera said the main problem is that your guest networks were not bridges, so they can only host one AP. Add option type bridge to the guest network definitions.

This is a good general practice so you can have wired and wifi guests, export the guest network to another AP which is a bridge, or have equivalent services on both bands of dual band hardware. There isn't a problem having a bridge with only one device, so go ahead and make it a bridge from the start.

There isn't a lot of reason for multiple SSIDs on the same band connected to the same network.

3 Likes

Thank you @vgaetera and @mk24.
I checked "Bridge interfaces" option and it is now working :smiley:

1 Like

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