Hi all you will have to forgive my naivety as I’m new to openwrt and I’m not an expert in networking.
I’ve had a solid setup for months but of late I’ve had two occasions where devices have dropped off my network and then can’t seem to get a new dhcp ip address, or at least that’s the only symptom that shows. A restart of the router and all is fine again.
I’m running OpenWrt 19.07.3 r11063-85e04e9f46 and my network consists of openwrt on a hub one router providing dhcp and dns, I have an Cisco sg500x which has a number of unify devices hanging off it providing my WiFi network. My internet access is provided by an lte router which connects to my openwrt router.
I’ve checked logs on my openwrt nothing obvious in the ui. Can anyone suggest a way to diagnose?
Please run the following commands (copy-paste the whole block) and paste the output here, using the "Preformatted text </> " button:
Remember to redact passwords, MAC addresses and any public IP addresses you may have
ubus call system board; \
uci export network; uci export wireless; \
uci export dhcp; uci export firewall; \
head -n -0 /etc/firewall.user; \
ip -4 addr ; ip -4 ro li tab all ; ip -4 ru; \
ls -l /etc/resolv.* /tmp/resolv.* /tmp/resolv.*/* ; head -n -0 /etc/resolv.* /tmp/resolv.* /tmp/resolv.*/*
Also you can run logread -e dnsmasq ; pgrep -fa dnsmasq; netstat -lnp | grep dnsmasq when the problem occurs.
All the devices have issues renewing their IP or only some of them?
Do you need this second IP on the lan interface?
If yes, then create an alias interface, rather than adding it under lan. Make sure there is only one interface serving DHCP.
So i had the issue again and have run the logread, here is the contents;
asq
Sun Dec 13 22:37:51 2020 user.notice dnsmasq: DNS rebinding protection is active, will discard upstream RFC1918 responses!
Sun Dec 13 22:37:51 2020 user.notice dnsmasq: Allowing 127.0.0.0/8 responses
Sun Dec 13 22:37:52 2020 daemon.info dnsmasq[1119]: started, version 2.80 cachesize 150
Sun Dec 13 22:37:52 2020 daemon.info dnsmasq[1119]: DNS service limited to local subnets
Sun Dec 13 22:37:52 2020 daemon.info dnsmasq[1119]: compile time options: IPv6 GNU-getopt no-DBus no-i18n no-IDN DHCP no-DHCPv6 no-Lua TFTP no-conntrack no-ipset no-auth no-DNSSEC no-ID loop-detect inotify dumpfile
Sun Dec 13 22:37:52 2020 daemon.info dnsmasq[1119]: using local addresses only for domain test
Sun Dec 13 22:37:52 2020 daemon.info dnsmasq[1119]: using local addresses only for domain onion
Sun Dec 13 22:37:52 2020 daemon.info dnsmasq[1119]: using local addresses only for domain localhost
Sun Dec 13 22:37:52 2020 daemon.info dnsmasq[1119]: using local addresses only for domain local
Sun Dec 13 22:37:52 2020 daemon.info dnsmasq[1119]: using local addresses only for domain invalid
Sun Dec 13 22:37:52 2020 daemon.info dnsmasq[1119]: using local addresses only for domain bind
Sun Dec 13 22:37:52 2020 daemon.info dnsmasq[1119]: using local addresses only for domain lan
Sun Dec 13 22:37:52 2020 daemon.warn dnsmasq[1119]: no servers found in /tmp/resolv.conf.auto, will retry
Sun Dec 13 22:37:52 2020 daemon.info dnsmasq[1119]: read /etc/hosts - 10 addresses
Sun Dec 13 22:37:52 2020 daemon.info dnsmasq[1119]: read /tmp/hosts/dhcp.cfg01411c - 8 addresses
Sun Dec 13 22:38:01 2020 daemon.info dnsmasq[1119]: exiting on receipt of SIGTERM
Sun Dec 13 22:38:02 2020 user.notice dnsmasq: DNS rebinding protection is active, will discard upstream RFC1918 responses!
Sun Dec 13 22:38:03 2020 user.notice dnsmasq: Allowing 127.0.0.0/8 responses
Sun Dec 13 22:38:06 2020 daemon.info dnsmasq[1945]: started, version 2.80 cachesize 150
Sun Dec 13 22:38:06 2020 daemon.info dnsmasq[1945]: DNS service limited to local subnets
Sun Dec 13 22:38:06 2020 daemon.info dnsmasq[1945]: compile time options: IPv6 GNU-getopt no-DBus no-i18n no-IDN DHCP no-DHCPv6 no-Lua TFTP no-conntrack no-ipset no-auth no-DNSSEC no-ID loop-detect inotify dumpfile
Sun Dec 13 22:38:06 2020 daemon.info dnsmasq[1945]: using local addresses only for domain test
Sun Dec 13 22:38:06 2020 daemon.info dnsmasq[1945]: using local addresses only for domain onion
Sun Dec 13 22:38:06 2020 daemon.info dnsmasq[1945]: using local addresses only for domain localhost
Sun Dec 13 22:38:06 2020 daemon.info dnsmasq[1945]: using local addresses only for domain local
Sun Dec 13 22:38:06 2020 daemon.info dnsmasq[1945]: using local addresses only for domain invalid
Sun Dec 13 22:38:06 2020 daemon.info dnsmasq[1945]: using local addresses only for domain bind
Sun Dec 13 22:38:06 2020 daemon.info dnsmasq[1945]: using local addresses only for domain lan
Sun Dec 13 22:38:06 2020 daemon.warn dnsmasq[1945]: no servers found in /tmp/resolv.conf.auto, will retry
Sun Dec 13 22:38:06 2020 daemon.info dnsmasq[1945]: read /etc/hosts - 10 addresses
Sun Dec 13 22:38:06 2020 daemon.info dnsmasq[1945]: read /tmp/hosts/dhcp.cfg01411c - 8 addresses
Sun Dec 13 22:38:09 2020 daemon.info dnsmasq[1945]: read /etc/hosts - 10 addresses
Sun Dec 13 22:38:09 2020 daemon.info dnsmasq[1945]: read /tmp/hosts/odhcpd - 1 addresses
Sun Dec 13 22:38:09 2020 daemon.info dnsmasq[1945]: read /tmp/hosts/dhcp.cfg01411c - 8 addresses
Sun Dec 13 22:38:09 2020 daemon.warn dnsmasq[1945]: Ignoring query from non-local network
Sun Dec 13 22:38:09 2020 daemon.info dnsmasq[1945]: reading /tmp/resolv.conf.auto
Sun Dec 13 22:38:09 2020 daemon.info dnsmasq[1945]: using local addresses only for domain test
Sun Dec 13 22:38:09 2020 daemon.info dnsmasq[1945]: using local addresses only for domain onion
Sun Dec 13 22:38:09 2020 daemon.info dnsmasq[1945]: using local addresses only for domain localhost
Sun Dec 13 22:38:09 2020 daemon.info dnsmasq[1945]: using local addresses only for domain local
Sun Dec 13 22:38:09 2020 daemon.info dnsmasq[1945]: using local addresses only for domain invalid
Sun Dec 13 22:38:09 2020 daemon.info dnsmasq[1945]: using local addresses only for domain bind
Sun Dec 13 22:38:09 2020 daemon.info dnsmasq[1945]: using local addresses only for domain lan
Sun Dec 13 22:38:09 2020 daemon.info dnsmasq[1945]: using nameserver 192.168.2.1#53
Sun Dec 13 22:38:10 2020 daemon.err dnsmasq[1945]: failed to send packet: Operation not permitted
Sun Dec 13 22:38:10 2020 daemon.info dnsmasq[1945]: read /etc/hosts - 10 addresses
Sun Dec 13 22:38:10 2020 daemon.info dnsmasq[1945]: read /tmp/hosts/odhcpd - 2 addresses
Sun Dec 13 22:38:10 2020 daemon.info dnsmasq[1945]: read /tmp/hosts/dhcp.cfg01411c - 8 addresses
Fri Jan 15 05:52:42 2021 daemon.info dnsmasq[1945]: read /etc/hosts - 10 addresses
Fri Jan 15 05:52:42 2021 daemon.info dnsmasq[1945]: read /tmp/hosts/odhcpd - 3 addresses
Fri Jan 15 05:52:42 2021 daemon.info dnsmasq[1945]: read /tmp/hosts/dhcp.cfg01411c - 8 addresses
1945 /usr/sbin/dnsmasq -C /var/etc/dnsmasq.conf.cfg01411c -k -x /var/run/dnsmasq/dnsmasq.cfg01411c.pid
tcp 0 0 192.168.2.220:53 0.0.0.0:* LISTEN 1945/dnsmasq
tcp 0 0 127.0.0.1:53 0.0.0.0:* LISTEN 1945/dnsmasq
tcp 0 0 192.168.1.1:53 0.0.0.0:* LISTEN 1945/dnsmasq
tcp 0 0 192.168.0.1:53 0.0.0.0:* LISTEN 1945/dnsmasq
tcp 0 0 fd53:9cf9:7d01::1:53 :::* LISTEN 1945/dnsmasq
tcp 0 0 fe80::f66b:efff:fe38:6b7a:53 :::* LISTEN 1945/dnsmasq
tcp 0 0 fe80::7834:ceff:fee7:abe6:53 :::* LISTEN 1945/dnsmasq
tcp 0 0 fe80::7834:ceff:fee7:abe6:53 :::* LISTEN 1945/dnsmasq
tcp 0 0 ::1:53 :::* LISTEN 1945/dnsmasq
udp 0 0 192.168.2.220:53 0.0.0.0:* 1945/dnsmasq
udp 0 0 127.0.0.1:53 0.0.0.0:* 1945/dnsmasq
udp 0 0 192.168.1.1:53 0.0.0.0:* 1945/dnsmasq
udp 0 0 192.168.0.1:53 0.0.0.0:* 1945/dnsmasq
udp 0 0 fd53:9cf9:7d01::1:53 :::* 1945/dnsmasq
udp 0 0 fe80::f66b:efff:fe38:6b7a:53 :::* 1945/dnsmasq
udp 0 0 fe80::7834:ceff:fee7:abe6:53 :::* 1945/dnsmasq
udp 0 0 fe80::7834:ceff:fee7:abe6:53 :::* 1945/dnsmasq
udp 0 0 ::1:53 :::* 1945/dnsmasq
So i don't think i need the secondary IP unless its related to my backup gateway (I have two gateways to the internet that i have weighted (lte, copper). Forgive me i'm not an expert in networking. This is what it looks like through lucia, at present only me lte interface is up.
It is not needed for that. To manage multiple gateways you should use mwan3 or vpn-pbr. So better remove the secondary IP.
Also from the netstat output it shows that the dnsmasq is not serving dhcp.
Maybe the device was rebooted? That could explain the date gap. Check with uptime
First remove the secondary IP, then restart the dnsmasq, verify it is service dhcp, and monitor.
uci del_list network.lan.ipaddr='192.168.1.1/24'
uci commit network
ifup lan
service restart dnsmasq
netstat -lnp | grep dnsmasq