Add New Page: You are not allowed to add pages Select section/namespace. New page title.


Useful Commands

route -n

  • This command shows the IP routing table. The -n flag shows the numerical addresses instead of attempting to determine the symbolic host names.


  • This command shows the “kernel ring buffer” which shows data being send and received from external devices, such as wireless devices. Add the -c option if you want to delete the contents of the buffer after you display it. Useful if you want to keep up with the new information available in the buffer without scrolling through old messages.


  • This command displays global system messages logged recently. This can contain similar messages to those contained in dmesg, but also contains additional messages sent to it by various daemons running on a node. Add the -f option if you want to see the output from this continuously.

iptables -nvL

  • This command is used to inspect the tables of IPv4 packet filter rules on a router. The -n flag specifies that the ip addresses and ports be specified in numeric format. The -v flag specifies that the output be as verbose as possible. The -L flag specifies that iptables lists all rules that are in place.

iptables -t nat -nvL

  • The addition of the “-t nat” to iptables specifies that iptables displays the NAT table rules which are responsible for re-writing the source or destination address of IP packets as they pass through the router or firewall.

iptables -L input -v

  • This command will print out the information about the zone to which each interface is assigned.

ip route list table all

  • This command shows all the routing table entries.

ip rule show

  • This command shows all the rules in the routing policy database.

iw list

  • This command will list all the capabilities of the wireless devices.

uci show

  • This command will list all the device configurations. It is a powerful command and can be further refined by adding a configuration type after show. e.g. uci show firewall

uci show -p /var/state firewall

  • by specifying -p /var/state {uci config name} we directly poll the configuration in order to get its current state as well as other initialization settings. This works for firewall, luci_splash, network, and wireless.

iw dev {device} station dump

  • device = wlan0 & wlan1 (need to configure this automatically in the script.)

ps -w

  • This command will list the current processes that are running on the node.


  • This command will show how long a node has bee online since its last reboot as well as display the current system load.

wget http://localhost:2006 -O {filename}

  • This command will create a file (replace {filename} with desired file name) that displays olsrd's (the routing protocol daemon's) known data about the network. This is gathered from the txtinfo plugin.

nc 2006 <enter>

  • This command will gather the same information as the command above (txtinfo), but it might be easier if you are on the command line.

nc 9090 <enter>

  • This command will gather similar information as the command above. The difference is that this output will be in JSON format. This information (jsoninfo) is potentially better organized than the information gathered above.

ip route ls table 223

  • the OLSRd standard default route is maintained in table 223

ip route ls table 224

  • the OLSRd smart gateway default route in table 224

top -n 1

  • This is a good way to see the output from top exactly one time. This is useful if you are scripting a debugging script.

we should use iwinfo instead of iw, iwlist, or iwconfig where possible, as iwinfo is included in commotion and is openwrt's attempt to have a cross-driver framework way of reporting wireless info. To do this we will scrape the uci interface for all devices and then run a iwinfo on each device.

development_resources/router/debugging_resources.txt · Last modified: 2013/12/26 05:04 (external edit)
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 3.0 Unported