Trying to debug problems with consumer-grade routers is notoriously difficult due to a lack of decent debugging information. It's quite hard to know what's going on without at least a few good error messages.
Given that the router (
192.168.1.1) will be sending its log messages on UDP port 514, I started by opening that port in my firewall:
iptables -A INPUT -s 192.168.1.1 -p udp --dport 514 -j ACCEPT
Then I enabled the UDP module for rsyslog and redirected messages to a separate log file (so that it doesn't fill up
/var/log/syslog) by putting the following (a modified version of these instructions) in
$ModLoad imudp $UDPServerRun 514 :fromhost-ip, isequal, "192.168.1.1" /var/log/gargoyle-router.log & ~
The name of the file is important because this configuration snipet needs to be loaded before the directive which writes to
/var/log/syslog for the discard statement (the "& ~" line) to work correctly.
Finally, I followed the instructions on the Gargoyle wiki to get the router to forward its log messages to my server (
After logging into the router via ssh, I ran the following commands:
uci set system.@system.log_ip=192.168.1.2 uci set system.@system.conloglevel=7 uci commit
before rebooting the router.
Now whenever I have to troubleshoot network problems, I can keep a terminal open on my server and get some visibility on what the router is doing:
tail -f /var/log/gargoyle-router.log