18.06.01 daily dns failure

Asus RT-N13 B1. Running OpenWrt 18.06.1.

Problem happens daily. After some usage, dnsmasq stops resolving sites. Luci fails with a message

# Bad Gateway

The process did not produce any response

Fortunately I can ssh to debug. Openvpn is also running fine. After rebooting, the router is OK for some time but fails again. I have started rebooting on cron every night now. But sometimes failure also happens early in the day.

I have setup another linux box as DNS server for now for the home network and it seems to work fine. As per my other post, stupid ISP is renewing lease every 600 seconds. Is this filling up the tmp space?

#free
             total       used       free     shared    buffers     cached
Mem:         60652      49168      11484      30324       1180      32976
-/+ buffers/cache:      15012      45640
Swap:            0          0          0


# service dnsmasq restart
sh: write error: No space left on device
sh: write error: No space left on device
sh: write error: No space left on device
sh: write error: No space left on device
sh: write error: No space left on device
sh: write error: No space left on device
sh: write error: No space left on device
sh: write error: No space left on device
sh: write error: No space left on device
sh: write error: No space left on device
sh: write error: No space left on device
sh: write error: No space left on device
sh: write error: No space left on device
sh: write error: No space left on device
sh: write error: No space left on device

#df -h
Filesystem                Size      Used Available Use% Mounted on
/dev/root                 2.3M      2.3M         0 100% /rom
tmpfs                    29.6M     29.6M         0 100% /tmp
/dev/mtdblock6            4.2M      2.6M      1.6M  62% /overlay
overlayfs:/overlay        4.2M      2.6M      1.6M  62% /
tmpfs                   512.0K         0    512.0K   0% /dev

Definitely looks like something is filling up the /tmp space. By default the logs are in a ring buffer and don't grow in size (stuff just "Falls off the end"). So it would be good to look at what's taking all that /tmp space:

du -sm /tmp/* | sort -n

will show you the largest contributors to the space usage.

1 Like

@ dlakelan

Thanks. I think I found the culprit. I do have openvpn server running on this router.

 du -sm /tmp/* | sort -n
0	/tmp/TZ
0	/tmp/dhcp.leases
0	/tmp/dnsmasq.d
0	/tmp/etc
0	/tmp/hosts
0	/tmp/lib
0	/tmp/lock
0	/tmp/log
0	/tmp/overlay
0	/tmp/resolv.conf
0	/tmp/resolv.conf.auto
0	/tmp/run
0	/tmp/shm
0	/tmp/spool
0	/tmp/state
0	/tmp/sysinfo
0	/tmp/tmp
30	/tmp/openvpn.log

I had verb set to 11 in openvpn config and mute for 5.
New values are verb 3 mute 20. as per this wiki and other sites on the web. Hopefully this will solve it.

I suspect that accidental openvpn client disconnect caused it..... I started a remote openvpn client session but never logged out, then my client power cycled and disconnected. My guess is that the openvpn server should have disconnected but kept chugging along. Is there a way to flush the openvpn log automatically?

The device does have USB port. Can I connect a larger capacity usb stick and move the tmp over there? (How?) or how reliable is extroot? from here. I was planning to install adblock and some additional encrypted DNS packages anyway.

Remove option log from your OpenVPN config.

1 Like