DD-WRT:Simple Network Management Protocol

The Simple Network Management Protocol (SNMP) is a protocol for monitoring of network-attached devices for any conditions that warrant administrative attention.

= Wireless Rate Via SNMP =

Here is the Broadcom forum thread that gives some additional information regarding SNMP Traffic Graphs.

This particular setup is for creating new SNMP values that monitor the Rate setting of the wireless and the RSSI values of specific clients/WDS. I borrowed some of this code and modified it to work with v23. Someone said this came from the Sveasoft forums. Assumes use of DD-WRT v23.

Tools: Getif (SNMP MIB browser)

1) Turn on SNMP in DD-WRT (Administration->Services)

2) Turn on JFFS and clean it (Administration->Management)

3) Log in via SSH and create the following scripts:

/jffs/snmpd/wlrate:

/usr/sbin/wl rate |/usr/bin/cut -b 9-10
 * 1) !/bin/sh

/jffs/snmpd/wlrssi1:

/usr/sbin/wl rssi  | /usr/bin/cut -b 10-11''
 * 1) !/bin/sh

You can repeat wlrssi1 multiple times for each client or WDS you want to monitor. Just increment the number.

Make the scripts executable: chmod a+rx /jffs/snmpd/wl*

Next, type the following into the command-line:

nvram set snmpd_conf="syslocation  syscontact  sysname  rocommunity  rwcommunity  exec Rate /jffs/snmpd/wlrate exec RSSI-CLIENT1 /jffs/snmpd/wlrssi1 " nvram commit reboot

Again, repeat the "RSSI-CLIENT1" line if you have more than 1 client to monitor (incrementing the number, of course).

Test the settings with Getif. You will need to look for .1.3.6.1.4.1.2021.8.1 in the "MBrowser" screen.

Steps:

In "Parameters", type in the IP of the router and the read and write community passwords. Press "Start" and you should see the bottom status say something like "Sysinfo variables OK". Next, go to the "MBrowser" tab and put ".1.3.6.1.4.1.2021.8.1" in the second entry box (it probably says ".1"). Press "Start" and you should see a list of values pop into the lower output screen. You will see your configuration variables, then a list of numbers in the values side. The first 3 numbers will be "0", then your values will show up. First is your "Rate", then each of your RSSI values that you entered above.

= Known OID´s via SNMP =

This should get important available OIDS for SNMP requst against DD-WRT V23 SP1

Additional OIDs were added in version v23 SP3 and v24 Many of these were obtained using the unix command snmpwalk, utilized: snmpwalk -v 1 -c public 192.168.1.1

= Bandwidth Monitoring via SNMP = You can also use SNMP for bandwith monitoring by using programs like Cacti, MRTG or PRTG Traffic Graphers.

The router's SNMP traffic layout:

=Remote Collection of SNMP data via WAN PORT= from DICONS on the forum go to the administration/diagnostics tab, paste in this command and do a "save firewall", then reboot

/usr/sbin/iptables -I INPUT 1 -p udp --dport 161 -j logaccept

it would sure be nice to have this automatically be applied if SNMP was on and remote admin was enabled, but I suppose it's easy anough to do thru the command....

- For enhanced security use the following command:

/usr/sbin/iptables -I INPUT 1 -p udp --dport 161 -s 1.2.3.4 -j logaccept


 * Make sure to replace 1.2.3.4 with the IP address of the device that will be performing the SNMP request TO your router across the Internet. This only allows the IP address specified using the -s command to access the SNMP protocol on your router.

=DSL-Modem details by SNMP on WAN-Port=
 * German manual for WRT54G v2.2 and Speedstream 5100 DSL-Modem

This describes how to get SNMP Informations from a modem device. see a list of device at the bottom.

Modifying firewall script
Firewall script: Administration\Diagnostics ip addr add 10.0.0.2/24 dev vlan1 brd + iptables -I POSTROUTING -t nat -o vlan1 -d 10.0.0.0/30 -j MASQUERADE arp -s 10.0.0.1  Now you're able to connect to a Web-Interface of Speedstream modems: (Ping is not working immediately, but an hour it works. ...don't know why!? ..maybe firewall or ARP latency.) http://10.0.0.1/ User: admin Pass: password
 * 1) add an IP address to WAN-port
 * 2) doing a NAT-connection from LAN to VLAN1 (WAN-Port)
 * 3) set an ARP entry to connect the Modem by IP (works for me with 10.0.0.1 only)

Getting SNMP informations of Modem from Client in LAN
snmpwalk -c public -v 1  snmpwalk -c public -v 1 -Ofn 10.0.0.1
 * 1) Get all OID of Modem

Interesting SNMP values
.1.3.6.1.2.1.1.1.0 = STRING: Efficient Networks 5100-Series (E140) .1.3.6.1.2.1.1.3.0 = Timeticks: (11915509) 1 day, 9:05:55.09 .1.3.6.1.2.1.1.4.0 = STRING: support@efficient.com .1.3.6.1.2.1.1.5.0 = STRING: 004-E140-B0A/003-1082-001/Build 52-6 .1.3.6.1.2.1.2.2.1.2.1 = STRING: loopback (pseudo ethernet) .1.3.6.1.2.1.2.2.1.2.2 = STRING: ti .1.3.6.1.2.1.2.2.1.2.3 = STRING: ATM .1.3.6.1.2.1.2.2.1.2.4 = STRING: Bridge .1.3.6.1.2.1.2.2.1.5.1 = Gauge32: 10000000 .1.3.6.1.2.1.2.2.1.5.2 = Gauge32: 0 .1.3.6.1.2.1.2.2.1.5.3 = Gauge32: 6656000 .1.3.6.1.2.1.2.2.1.5.4 = Gauge32: 10000000 .1.3.6.1.2.1.10.94.1.1.4.1.3.2 = Gauge32: 6656000 .1.3.6.1.2.1.10.94.1.1.5.1.3.2 = Gauge32: 640000
 * 1) Manufacturer Data, Uptime, etc.
 * 1) Interface Name
 * 1) Interface Speed
 * 1) DSL Modem Sync. Speed, Downstream/Upstream

Modem Devices:
Speedstream 5100/5200 (series) Teledat 300 LAN (a bit tricky to find out the MAC address)

=See also=
 * Multi Router Traffic Grapher
 * Using Munin for monitoring DD-Wrt devices

=External Links=
 * odmon.com - Cacti online
 * Cacti
 * Paessler PRTG
 * Paessler IPCheck