[SOLVED] DHCP lease on WAN interface

Could someone please explain what this means?

root@firewall:/etc/config# service dnsmasq restart
udhcpc: started, v1.31.1
udhcpc: sending discover
udhcpc: no lease, failing
udhcpc: started, v1.31.1
udhcpc: sending discover
udhcpc: no lease, failing
udhcpc: started, v1.31.1
udhcpc: sending discover
udhcpc: sending select for 192.168.1.6
udhcpc: lease of 192.168.1.6 obtained, lease time 4294967295
udhcpc: started, v1.31.1
udhcpc: sending discover
udhcpc: no lease, failing
udhcpc: started, v1.31.1
udhcpc: sending discover
udhcpc: no lease, failing

The modem connected to the WAN interface has a weird DHCP server that assigns private IPs from 192.168.1.0/24 when the cable ISP public IP cannot be assigned (for whatever reason). So, when the DHCP request from any host connected directly to the cable modem fails, the cable modem assigns an ip from 192.168.1.0/24. Then, you can HTTP to 192.168.1.1 and look at the limited web GUI of the cable modem to see what's going on.

So, why is OpenWRT requesting a specific IP from 192.168.1.0/24? Like in this:

udhcpc: sending select for 192.168.1.6
udhcpc: lease of 192.168.1.6 obtained, lease time 4294967295 

And also, if I HTTP to 192.168.1.1, I land on the LUCI login page. I know for a fact that 192.168.1.1 is the IP of the cable modem, and with a previous router I was actually able to get to the modem via HTTP to 192.168.1.1

Thank you.

1 Like

Post the output:

uci show network; uci show dhcp; \
ip address show; ip route show; ip rule show

The WAN interface receives the public IP from the ISP:

uci show network | grep wan
network.wan=interface
network.wan.ifname='eth0.10'
network.wan.proto='dhcp'
dhcp.wan=dhcp
dhcp.wan.interface='wan'
dhcp.wan.ignore='1'
ip address show eth0.10
20: eth0.10@eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc cake state UP group default qlen 1000
    link/ether dc:a6:32:51:57:1a brd ff:ff:ff:ff:ff:ff
    inet 24.yy.xxx.42/21 brd 24.yy.xxx.255 scope global eth0.10
       valid_lft forever preferred_lft forever
    inet6 fe80::xxxx:xxxx:xxxx:571a/64 scope link 
       valid_lft forever preferred_lft forever
ip route show default
default via 24.yy.xxx.1 dev eth0.10 proto static src 24.yy.xxx.42
ip rule show
0:	from all lookup local
32766:	from all lookup main
32767:	from all lookup default

I think I should rephrase my question.

How do I look up the DHCP lease received on the WAN interface? It appears to me that I get two DHCP leases: one from the ISP and the other one from the cable modem. I always wondered about this secondary lease from the cable modem (as I was always able to HTTP to the cable modem's IP), but this is the first time I'm trying to figure out how it works and why the restart of the dnsmasq service resulted in the messages:

udhcpc: no lease, failing
udhcpc: started, v1.31.1
udhcpc: sending discover
udhcpc: sending select for 192.168.1.6
udhcpc: lease of 192.168.1.6 obtained, lease time 4294967295

By the way the lease time from the cable modem is almost 140 years long.

Thanks.

1 Like

OK, so I was wrong about 192.168.1.0/24. This network actually exists in my OpenWRT, and I also have a DHCP server configured in this VLAN on a Cisco L3 switch (remnants from my old setup which should have been removed but somehow got overlooked). The cable modem gives out IPs on 192.168.100.0/24 when the connected device cannot get the DHCP lease from the ISP. This is not what happened this time.

The DHCP lease received on 192.168.1.0/24 with the IP of 192.168.1.6 (listed in my initial post) was received by OpenWRT from a Cisco L3 switch. This is weird, because the OpenWRT interface on this VLAN is set to be a DHCP server (not a client) and this OpenWRT interface has a static IP assigned to it.

ip addres show br-UniFi_CFG
13: br-UniFi_CFG: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether dc:a6:32:51:57:1a brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.1/24 brd 192.168.1.255 scope global br-UniFi_CFG
       valid_lft forever preferred_lft forever
    inet6 fe80::dea6:32ff:fe51:571a/64 scope link 
       valid_lft forever preferred_lft forever

So, my actual question now is, How do I look up the DHCP lease received on an interface in OpenWRT? I want to see the length of the lease and other information received from the ISP's DHCP server. LUCI only shows the IP address received in the DHCP lease and how long the OpenWRT interface has had it.

Thank you.

1 Like

https://openwrt.org/docs/guide-user/network/protocol.dhcp#troubleshooting

1 Like

Thank you, @vgaetera !

1 Like

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