Problem with DHCP

Hello,
I'm trying to use openwrt on an ArcherC6
as many of you, my goal is to implement 3 zones
lan, guests and iot
I watched this

Tryed to respect every steps but cannot make it work properly.

To start with something, when I connect to the guest wifi I get an IP from the LAN, not from the guests zone.

When then I connect to the IOT, I get an ip from guests zone, not the one for IOT

I have a internet box that provide dhcp for the lan on wich the archer is connected (on one of the lan port)

here is my config
/etc/config/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 'fdbe:319a:5640::/48'

config device
        option name 'br-lan'
        option type 'bridge'
        list ports 'eth0.1'

config interface 'lan'
        option device 'br-lan'
        option proto 'static'
        option netmask '255.255.255.0'
        option ip6assign '60'
        option gateway '192.168.0.254'
        option ipaddr '192.168.0.140'

config interface 'wan'
        option device 'eth0.2'
        option proto 'static'
        option ipaddr '192.168.0.141'
        option netmask '255.255.255.0'

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

config switch
        option name 'switch0'
        option reset '1'
        option enable_vlan '1'

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

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

config interface 'INVITES'
        option device 'br-lan'
        option proto 'static'
        option ipaddr '10.20.30.40'
        option netmask '255.255.255.0'
        option defaultroute '0'
        list dns '1.1.1.1'

config interface 'IOTLAN'
        option proto 'static'
        option ipaddr '172.16.0.1'
        option netmask '255.255.255.0'
        option device 'br-lan'
        option defaultroute '0'

config device
        option name 'wlan1-1

/etc/config/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.d/resolv.conf.auto'
        option nonwildcard '1'
        option localservice '1'
        option ednspacket_max '1232'

config dhcp 'lan'
        option interface 'lan'
        option start '100'
        option limit '150'
        option leasetime '12h'
        option dhcpv4 'server'
        option dhcpv6 'server'
        option ra 'server'
        list ra_flags 'managed-config'
        list ra_flags 'other-config'

config dhcp 'wan'
        option interface 'wan'
        option ignore '1'
        option start '100'
        option limit '150'
        option leasetime '12h'

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

config dhcp 'IOTLAN'
        option interface 'IOTLAN'
        option start '100'
        option limit '150'
        option leasetime '12h'

config dhcp 'INVITES'
        option interface 'INVITES'
        option start '100'
        option limit '150'
        option leasetime '12h'
        option force '1'
        option master '1'

Can someone help ?

for starters, you probably shouldn't follow a video for a 4 y.o release...

try https://openwrt.org/docs/guide-user/network/wifi/guestwifi/start

1 Like

I see many issues in the configuration that has been posted... it will likely take more effort to fix them than it will to simply reset to defaults and start fresh -- please reset then post your configs so we can see the baseline. We'll add just a single network and then you can repeat the recpie for the other(s).

Also, I notice that your wan and lan subnets are the same. This will break routing. They must be different and non-overlapping. It also appears that you have another router upstream. Can you remove that router and use this one as your only router?

For your config posts...
Please use the "Preformatted text </>" button for logs, scripts, configs and general console output.
grafik
Please edit your post accordingly. Thank you! :slight_smile:

Thank you for trying to help.
I did change the lan address and I cannot use this on as the only router

When changing the lan address I can only access lucy with ipv6 address, the ipv4 doesn't work after changing that

other problems remain the same, when connecting to wifi INVITES I get an IP address like 192.168.0.34 wich is given by another DHCP, not the on defined for INVITES which should be 10.20.30.40

cat 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 'fdbe:319a:5640::/48'

config device
        option name 'br-lan'
        option type 'bridge'
        list ports 'eth0.1'

config interface 'lan'
        option device 'br-lan'
        option proto 'static'
        option netmask '255.255.255.0'
        option ip6assign '60'
        option ipaddr '192.168.10.254'

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

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

config switch
        option name 'switch0'
        option reset '1'
        option enable_vlan '1'

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

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

config interface 'INVITES'
        option device 'br-lan'
        option proto 'static'
        option ipaddr '10.20.30.40'
        option netmask '255.255.255.0'
        option defaultroute '0'
        list dns '1.1.1.1'

config interface 'IOTLAN'
        option proto 'static'
        option ipaddr '172.16.0.1'
        option netmask '255.255.255.0'
        option device 'br-lan'
        option defaultroute '0'

config device
        option name 'wlan1-1'

cat 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.d/resolv.conf.auto'
        option nonwildcard '1'
        option localservice '1'
        option ednspacket_max '1232'

config dhcp 'lan'
        option interface 'lan'
        option start '100'
        option limit '150'
        option leasetime '12h'
        option dhcpv4 'server'
        option dhcpv6 'server'
        option ra 'server'
        list ra_flags 'managed-config'
        list ra_flags 'other-config'

config dhcp 'wan'
        option interface 'wan'
        option ignore '1'
        option start '100'
        option limit '150'
        option leasetime '12h'

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

config dhcp 'IOTLAN'
        option interface 'IOTLAN'
        option start '100'
        option limit '150'
        option leasetime '12h'
        option force '1'

config dhcp 'INVITES'
        option interface 'INVITES'
        option start '100'
        option limit '150'
        option leasetime '12h'
        option force '1'
        option master '1'

Your problem is likely the fact that you've tied all your networks to the same device (br-lan):

That will cause them all to be bridged together and things will certainly not work properly.

Are the INVITES and IOTLAN networks wifi only, or do they need to be wired, too? Will those networks operate on just a single radio or on two (i.e. 2.4G and 5G)?