Pi-hole with static lease doesn't appear in the IPv4 Active Leases list

I'm using OpenWRT 19.07.2.
I've assigned my Raspberry Pi running Pi-Hole a static IPv4 address in my router. I can access the Raspberry Pi via its IP address without issue, but I noticed that in the Active Leases list on the OpenWRT Overview page, neither this Raspberry Pi nor its static IP address are listed.

I'm trying to figure out why that is. My Xbox has a static IPv6 address and it shows up in the list, so I'm not sure why the Raspberry Pi doesn't.

When assigning a static IP in the router's DHCP settings, is there anything else I am supposed to do, like on the client device itself, perhaps?

be aware that client renewals are not instantanious on router/dhcp server setting change... allow time or re-initialise the client state to ensure concurrency / application of server changes...

otherwise, tcpdump the dhcp exchange and post here...

The Raspberry Pi has been working for about a year now (and still is). Pi-Hole is working properly. I can access the Pi via its static IP over Putty or through the browser. So everything seems to be correct. It's just that it doesn't appear in the Active Leases list so when I can't remember what its IP is I'm not able to use this list to find it and have to try to figure it out through other means.

Please copy the output of the following commands and post it here using the "Preformatted text </> " button:
grafik
Remember to redact passwords, MAC addresses and any public IP addresses you may have

ubus call system board; \
uci export network; uci export dhcp; arp; \
ls -l  /etc/resolv.* /tmp/resolv.*; head -n -0 /etc/resolv.* /tmp/resolv.* /tmp/dhcp.leases /tmp/hosts/*


ubus call system board;

{
        "kernel": "4.14.171",
        "hostname": "OpenWrt",
        "system": "ARMv7 Processor rev 1 (v7l)",
        "model": "Linksys WRT32X",
        "board_name": "linksys,venom",
        "release": {
                "distribution": "OpenWrt",
                "version": "19.07.2",
                "revision": "r10947-65030d81f3",
                "target": "mvebu/cortexa9",
                "description": "OpenWrt 19.07.2 r10947-65030d81f3"
        }
}

uci export network;

package 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 '$$$$$$' (not sure if this is public or not)

config interface 'lan'
        option type 'bridge'
        option ifname 'eth0.1'
        option proto 'static'
        option ip6assign '60'
        list ipaddr '192.168.1.1/24'
        list dns '192.168.1.195' (IP address of Pi-Hole)

config interface 'wan'
        option ifname 'eth1.10'
        option proto 'pppoe'
        option ipv6 'auto'
        option username '$$$$$$'
        option password '$$$$$$'
        option peerdns '0'

config interface 'wan6'
        option proto 'dhcpv6'
        option ifname 'eth1.10'
        option reqprefix 'auto'
        option reqaddress 'try'
        option peerdns '0'

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

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

config switch_vlan
        option device 'switch0'
        option vlan '2'
        option ports '6t 4t'
        option vid '10'

uci export dhcp;

package 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 authoritative '1'
        option readethers '1'
        option leasefile '/tmp/dhcp.leases'
        option resolvfile '/tmp/resolv.conf.auto'
        option localservice '1'

config dhcp 'lan'
        option interface 'lan'
        option start '100'
        option limit '150'
        option leasetime '12h'
        option dhcpv6 'server'
        option ra 'server'
        option ra_management '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 host
        option mac '$$$$$$'
        option dns '1'
        option name 'raspberrypi'
        option ip '192.168.1.195'
        option leasetime 'infinite'
        option duid '$$$$$$'
        option hostid '$$$$$$'

config dhcp 'LAN2'
        option start '100'
        option leasetime '12h'
        option limit '150'
        option interface 'LAN2'
        list dhcp_option '6,192.168.2.1'

config host
        option name 'XboxOne'
        option dns '1'
        option ip '192.168.1.171'
        option leasetime 'infinite'
        option mac '$$$$$$'

arp;

IP address       HW type     Flags       HW address     Mask     Device
10.-    	     0x1         0x2         -     			*        br-lan
10.-    	     0x1         0x2         -     			*        br-lan
192.168.1.161    0x1         0x0         -     			*        br-lan
192.168.1.219    0x1         0x0         -     			*        br-lan
192.168.1.129    0x1         0x2         -     			*        br-lan
192.168.1.152    0x1         0x2         -     			*        br-lan
192.168.1.237    0x1         0x2         -     			*        br-lan
192.168.1.171    0x1         0x0         -     			*        br-lan (Xbox)
10.-    	     0x1         0x2         -     			*        br-lan
192.168.1.223    0x1         0x2         -     			*        br-lan
192.168.1.196    0x1         0x2         -     			*        br-lan
192.168.1.225    0x1         0x2         -     			*        br-lan
192.168.1.205    0x1         0x2         -     			*        br-lan
192.168.1.166    0x1         0x0         -     			*        br-lan
192.168.1.153    0x1         0x0         -     			*        br-lan
192.168.1.226    0x1         0x2         -     			*        br-lan
192.168.1.105    0x1         0x0         -     			*        br-lan
169.-  		     0x1         0x2         -     			*        br-lan
10.-    	     0x1         0x2         -     			*        br-lan
169.-  		     0x1         0x2         -     			*        br-lan
192.168.1.197    0x1         0x2         -     			*        br-lan
192.168.1.239    0x1         0x0         -     			*        br-lan
192.168.1.208    0x1         0x0         -     			*        br-lan
192.168.1.198    0x1         0x0         -     			*        br-lan
192.168.1.145    0x1         0x0         -     			*        br-lan
192.168.1.195    0x1         0x2         -     			*        br-lan (Pi-Hole)
192.168.1.137    0x1         0x0         -     			*        br-lan
192.168.1.182    0x1         0x2         -     			*        br-lan
192.168.1.173    0x1         0x2         -     			*        br-lan

ls -l /etc/resolv.* /tmp/resolv.*;

lrwxrwxrwx    1 root     root            16 Feb 27 22:05 /etc/resolv.conf -> /tmp/resolv.conf
-rw-r--r--    1 root     root            32 Aug 20 10:47 /tmp/resolv.conf
-rw-r--r--    1 root     root            57 Aug 20 04:03 /tmp/resolv.conf.auto
-rw-r--r--    1 root     root            48 Aug 20 04:03 /tmp/resolv.conf.ppp

head -n -0 /etc/resolv.* /tmp/resolv.* /tmp/dhcp.leases /tmp/hosts/*

==> /etc/resolv.conf <==
search lan
nameserver 127.0.0.1

==> /tmp/resolv.conf <==
search lan
nameserver 127.0.0.1

==> /tmp/resolv.conf.auto <==
# Interface lan
nameserver 192.168.1.195
# Interface wan

==> /tmp/resolv.conf.ppp <==
nameserver $$$$$$
nameserver $$$$$$

==> /tmp/dhcp.leases <== (Neither Xbox or Pi-Hole are in this list, hence what I'm trying to figure out))
1597940568 hwaddress  192.168.1.173 tv hwaddress 
1597946164 hwaddress  192.168.1.237 retropie hwaddress 
1597949904 hwaddress  192.168.1.152 printer hwaddress 
1597954360 hwaddress  192.168.1.226 Chromecast *
1597951564 hwaddress  192.168.1.197 android1 hwaddress 
1597959917 hwaddress  192.168.1.105 * hwaddress 
1597953636 hwaddress  192.168.1.225 android2 hwaddress 
1597956272 hwaddress  192.168.1.196 pc3 hwaddress 
1597945743 hwaddress  192.168.1.205 * *
1597949632 hwaddress  192.168.1.182 pc1 hwaddress 
1597959762 hwaddress  192.168.1.129 pc2 hwaddress 
1597950679 hwaddress  192.168.1.239 * hwaddress 

==> /tmp/hosts/dhcp.cfg01411c <==
# auto-generated config file from /etc/config/dhcp
192.168.1.195 raspberrypi.lan
192.168.1.171 XboxOne.lan
192.168.1.196 pc3.lan
192.168.1.1 OpenWrt
fd6c:b3d1:a461::1 OpenWrt

==> /tmp/hosts/odhcpd <==
ipv6        XboxOne
ipv6     XboxOne
# br-lan DUID XboxOne -1 171 128 ipv6 ipv6
ipv6        pc3
ipv6     pc3
# br-lan DUID 1597956276 407 128 ipv6 ipv6
ipv6        pc1
ipv6     pc1
# br-lan DUID bd43d7e pc1 1597949629 4e2 128 ipv6 ipv6
ipv6        retropie
ipv6     retropie
# br-lan DUID ebcabec9 retropie 1597954380 5f1 ipv6 ipv6
ipv6       raspberrypi
ipv6    raspberrypi
# br-lan DUID eb94476e raspberrypi -1 2a02 128 ipv68 ipv6

Use some defined value here. If you want something long use 30d

1 Like

I will try that. Though 'infinite' is supposed to be a valid option per this commit

If the device is internally configured with a static IP it never makes a DHCP request, so it won't be in the list. A better way is to leave the device as DHCP client but make a reserved address on the router. This way you administer all IP addresses from one place.

Also as others noted the lease list is in RAM, it is cleared when the router reboots and won't be filled out until the client has made a renewal request. Short lease times are an advantage here.

3 Likes

I see.
Yeah, the Pi has its IP set internally. That makes sense why it doesn't appear in the router list. I will change that. Thanks!

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