OpenWrt SNAPSHOT (r25589-f84ed09d2c) DHCP Server

I am using the following version: Powered by LuCI Master (git-24.077.26240-f2a4910) / OpenWrt SNAPSHOT (r25589-f84ed09d2c) / Lua compatibility mode active

OpenWRT Router is connected to Another Router
OpenWRT Wan Port IP Address is: 192.168.31.170
Another Router IP Address is: 192.168.31.1

Assuming that OpenWRT Router is "B" Router
Assuming that the other Router is "A" Router

B <-----> A <-------> Internet ISP

Here the current state of the OpenWRT router (B):

root@OpenWrt:~# cat /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 'fdcb:5991:3e63::/48'

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

config interface 'lan'
        option device 'br-lan'
        option proto 'static'
        option ipaddr '192.168.4.1'
        option netmask '255.255.255.0'

config device
        option name 'wan'
        option macaddr 'cc:d8:43:11:e6:16'

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

config interface 'wan6'
        option device 'wan'
        option proto 'dhcpv6'

root@OpenWrt:~#

root@OpenWrt:~# ifconfig
br-lan    Link encap:Ethernet  HWaddr CC:D8:43:77:98:58
          inet addr:192.168.4.1  Bcast:192.168.4.255  Mask:255.255.255.0
          inet6 addr: fe80::ced8:43ff:fe77:9858/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1364 errors:0 dropped:1 overruns:0 frame:0
          TX packets:1323 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:118116 (115.3 KiB)  TX bytes:113633 (110.9 KiB)

eth0      Link encap:Ethernet  HWaddr CC:D8:43:77:98:58
          inet6 addr: fe80::ced8:43ff:fe77:9858/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1504  Metric:1
          RX packets:3105 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2578 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:580659 (567.0 KiB)  TX bytes:1058044 (1.0 MiB)
          Interrupt:75

lan2      Link encap:Ethernet  HWaddr CC:D8:43:77:98:58
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

lan3      Link encap:Ethernet  HWaddr CC:D8:43:77:98:58
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

lan4      Link encap:Ethernet  HWaddr CC:D8:43:77:98:58
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:296 errors:0 dropped:0 overruns:0 frame:0
          TX packets:296 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:23917 (23.3 KiB)  TX bytes:23917 (23.3 KiB)

phy0-ap0  Link encap:Ethernet  HWaddr CC:D8:43:77:98:5A
          inet6 addr: fe80::ced8:43ff:fe77:985a/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:49 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:5054 (4.9 KiB)

phy1-ap0  Link encap:Ethernet  HWaddr CC:D8:43:77:98:5B
          inet6 addr: fe80::ced8:43ff:fe77:985b/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1365 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1369 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:137449 (134.2 KiB)  TX bytes:118205 (115.4 KiB)

tun1      Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
          inet addr:10.10.1.18  P-t-P:10.10.1.17  Mask:255.255.255.255
          inet6 addr: fe80::ccf3:b9b:a637:10f8/64 Scope:Link
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1500  Metric:1
          RX packets:485 errors:0 dropped:0 overruns:0 frame:0
          TX packets:539 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:500
          RX bytes:48868 (47.7 KiB)  TX bytes:42725 (41.7 KiB)

wan       Link encap:Ethernet  HWaddr CC:D8:43:11:E6:16
          inet addr:192.168.31.170  Bcast:192.168.31.255  Mask:255.255.255.0
          inet6 addr: fe80::ced8:43ff:fe11:e616/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:3105 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2401 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:524769 (512.4 KiB)  TX bytes:1021099 (997.1 KiB)

root@OpenWrt:~#

root@OpenWrt:~# cat /etc/config/dhcp

config dnsmasq
        option domainneeded '1'
        option localise_queries '1'
        option rebind_protection '1'
        option rebind_localhost '1'
        option local '/lan/'
        option domain 'lan'
        option expandhosts '1'
        option cachesize '1000'
        option authoritative '1'
        option readethers '1'
        option leasefile '/tmp/dhcp.leases'
        option resolvfile '/tmp/resolv.conf.d/resolv.conf.auto'
        option localservice '1'
        option ednspacket_max '1232'
        option sequential_ip '1'

config dhcp 'lan'
        option interface 'lan'
        option start '100'
        option limit '150'
        option leasetime '5m'
        option dhcpv4 'server'
        option dhcpv6 'hybrid'
        option ra 'hybrid'
        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'

root@OpenWrt:~#

root@OpenWrt:~# cat /etc/config/wireless

config wifi-device 'radio0'
        option type 'mac80211'
        option path 'platform/soc/18000000.wifi'
        option channel 'auto'
        option band '2g'
        option htmode 'HE20'
        option cell_density '0'

config wifi-iface 'default_radio0'
        option device 'radio0'
        option network 'lan'
        option mode 'ap'
        option ssid 'Fiber 2.4Ghz USA'
        option encryption 'sae-mixed'
        option key 'wifi-password'

config wifi-device 'radio1'
        option type 'mac80211'
        option path 'platform/soc/18000000.wifi+1'
        option channel 'auto'
        option band '5g'
        option htmode 'HE80'
        option cell_density '0'

config wifi-iface 'default_radio1'
        option device 'radio1'
        option mode 'ap'
        option ssid 'Fiber 5Ghz USA'
        option encryption 'sae-mixed'
        option key 'wifi-password'
        option network 'lan'

root@OpenWrt:~#

the issue is: once a client is connected to WiFi router B (OpenWRT Router)
the IP address which assigned is not from the pre defined range.

    option start '100'
    option limit '150'

How are Router A and Router B connected to each other (lan-lan, or lan-wan)?

Do the two routers share the same SSID and password, or are they unique?

Router A and Router B connected in the following way:

B (WAN Port) <-------------> (LAN Port) A (WAN Port) <-------------> ISP

SSID on B is not the Same like SSID of A

What IP address is issued?

EDIT: I think I know what your issues is...
you're expecting a range from 100-150. In actuality, the limit is the size of the DHCP pool. So the range is actually 100-249.

thank you.
I recommend to bold this field in the UI for future release. it is not clear.

It's documented here:
https://openwrt.org/docs/guide-user/base-system/dhcp#dhcp_pools

limit ... Specifies the size of the address pool (e.g. with start=100, limit=150, maximum address will be .249)

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