DHCP not assigning IPV4 address

For some reason I am not getting any IPV4 assignment. When client connect only get IPV6 assignment. I can manually configure my client ipv4 to get on. I tried restarting dnsmasq. I don't know what else to try.
This problem started happening randomly yesterday.
Using OpenWrt 19.07.7 r11306-c4a6851c72

Can you provide more info on this?

For example, is the issue on the LAN or WAN (it seems like you're talking about the LAN, but please verify)? Did you make any changes to your network? Do you have VLANs and multiple DHCP servers running, or are you using a single flat LAN? Does the problem occur on both wired and wireless interfaces, or just one of them? Is everything self contained on this router, or do you have any additional APs and/or managed switches?

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:

cat /etc/config/network
cat /etc/config/wireless
cat /etc/config/dhcp
cat /etc/config/firewall
1 Like

Absolutely, This is with my lan segment. I have two vlans and I believe the wired and wireless are bridged. My dns is on a pi-hole. (192.168.1.53) Here are the additional information output by cat.

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 'fd98:07c4:11eb::/48'

config interface 'lan'
        option type 'bridge'
        option ifname 'eth1.1'
        option proto 'static'
        option ipaddr '192.168.1.1'
        option netmask '255.255.255.0'
        option ip6assign '60'

config device 'lan_eth1_1_dev'
        option name 'eth1.1'
        option macaddr 

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

config device 'wan_eth0_2_dev'
        option name 'eth0.2'
        option macaddr 

config interface 'wan6'
        option ifname '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 '1 2 3 4 6t'

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

wireless


config wifi-device 'radio0'
        option type 'mac80211'
        option channel '36'
        option hwmode '11a'
        option path 'soc/1b500000.pci/pci0000:00/0000:00:00.0/0000:01:00.0'
        option htmode 'VHT80'
        option disabled '0'

config wifi-iface 'default_radio0'
        option device 'radio0'
        option network 'lan'
        option mode 'ap'
        option ssid 'OpenWrt'
        option key 'freeballoon109'
        option encryption 'psk'
        option disabled '1'

config wifi-device 'radio1'
        option type 'mac80211'
        option hwmode '11g'
        option path 'soc/1b700000.pci/pci0001:00/0001:00:00.0/0001:01:00.0'
        option htmode 'HT20'
        option channel '11'
        option disabled '0'

config wifi-iface 'default_radio1'
        option device 'radio1'
        option network 'lan'
        option mode 'ap'
        option ssid 'OpenWrt24'
        option key 'blahblahblah'
        option encryption 'psk'

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 localservice '1'
        option confdir '/tmp/dnsmasq.d'
        option noresolv '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'
        list dhcp_option '192.168.1.53'
        list dns 'fd98:7c4:11eb::53'

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 'E4:5F:01:09:D0:44'
        option name 'blackberry'
        option dns '1'
        option ip '192.168.1.53'
        option duid '0001000127d42406e45f0109d045'
        option hostid '53'

firewall

config defaults
        option syn_flood '1'
        option input 'ACCEPT'
        option output 'ACCEPT'
        option forward 'REJECT'

config zone
        option name 'lan'
        list network 'lan'
        option input 'ACCEPT'
        option output 'ACCEPT'
        option forward 'ACCEPT'

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

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'
        option target 'ACCEPT'

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 redirect
        option src 'wan'
        option name 'Torrent'
        option target 'DNAT'
        option dest 'lan'
        option dest_port '20696'
        option dest_ip '192.168.1.158'
        option src_dport '20696'

config redirect
        option dest_port '55623'
        option src 'wan'
        option name 'Flud'
        option src_dport '55623'
        option target 'DNAT'
        option dest_ip '192.168.1.146'
        option dest 'lan'

Maybe try temporarily disconnecting the pi hole device and restart OpenWRT for a quick test. Just to verify that pi hole does not run a second DHCP server unnoticed in the same subnet.

Renew the client's DHCP lease while monitoring the output:

netstat -l -n -p | grep -e :67; tcpdump -evni any udp port 67

vgaetera, here is what i got off of tcpdump when i tried to connect a laptop.

for netstat, nothing is running on port 67.
grep returns nothing.
Is that the problem?

Pico, I tried that, it didn't work. Also checked Pihole not running DHCP on that.

Have you tried restarting the dnsmasq service?

If that doesn't work, check to see if you can find any errors in the system log.

You might try (temporarily) removing these two lines if dnsmasq fails to start.

I'm pretty sure that the first line is incorrect -- it should be
list dhcp_option '6,192.168.1.53'

3 Likes

Peter, yes I was missing the 6, to specify dns server. dnsmasq restarted and assigned ipv4 addresses to my devices.

Must had accidently deleted yesterday when I had issue with dnscrypt on my Pi.

Thanks everyone for all your help.

Glad it is working. Feel free to mark the most useful response as the solution.

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