0% found this document useful (0 votes)
396 views8 pages

Simple Network Management Protocol-DD-WRT

The document discusses using SNMP (Simple Network Management Protocol) to monitor network devices and retrieve performance and configuration data. It provides examples of OIDs (Object Identifiers) that can be used to get information like interface status, CPU usage, memory usage, and wireless client signal strength from DD-WRT (a home router firmware). Instructions are given on configuring DD-WRT to expose custom data via SNMP for wireless rate and client RSSI values. The document also discusses using SNMP to retrieve information from an attached DSL modem, like the manufacturer and uptime.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
396 views8 pages

Simple Network Management Protocol-DD-WRT

The document discusses using SNMP (Simple Network Management Protocol) to monitor network devices and retrieve performance and configuration data. It provides examples of OIDs (Object Identifiers) that can be used to get information like interface status, CPU usage, memory usage, and wireless client signal strength from DD-WRT (a home router firmware). Instructions are given on configuring DD-WRT to expose custom data via SNMP for wireless rate and client RSSI values. The document also discusses using SNMP to retrieve information from an attached DSL modem, like the manufacturer and uptime.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 8

Simple Network Management Protocol

(Redirected from SNMP)

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:
#!/bin/sh /usr/sbin/wl rate |/usr/bin/cut -b 9-10

/jffs/snmpd/wlrssi1:
#!/bin/sh /usr/sbin/wl rssi <mac_address_of_client_or_wds> | /usr/bin/cut -b 10-11

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 <your_location> syscontact <your_email> sysname <your_system_name> rocommunity <your_password> rwcommunity <your_other_password> 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 OIDs via SNMP This should get important available OIDS for SNMP requst against DD-WRT V23 SP1
OID [dottedt & text format] MEANING RANGE of VALUES CONTENT (example)

1.3.6.1.2.1.1.1.0

router description uptime (in hundredths of a second) location entry of this node System Uptime

string

"Linux WRT54G 2.4.20 #2 Thu Sep 9" "0:9:58:43.95"

1.3.6.1.2.1.1.3.0

timeticks

1.3.6.1.2.1.1.6.0 1.3.6.1.2.1.25.1.1.0

string string

"Sundhausen" "212 hours 35 minutes 19 seconds" "0x07 0xb2 0x01 0x09 0x14 0x23 0x0f 0x00 0x2b 0x00 0x00" "1536" "root=/dev/mtdblock 2 rootfstype=squashfs, jffs2 noinitrd console=ttyS0, 115200 "14072" "12428" "505" "snmpd" "0.0"

1.3.6.1.2.1.25.1.2.0

System Date

hex string

1.3.6.1.2.1.25.1.3.0

System Initial Load Device

integer

1.3.6.1.2.1.25.1.4.0

System Initial Load Parameters

string

1.3.6.1.2.1.25.2.3.1.5.101 1.3.6.1.2.1.25.2.3.1.6.101 1.3.6.1.2.1.25.4.2.1.1.* 1.3.6.1.2.1.25.4.2.1.2.* * equates to pid in 1.3.6.1.2.1.25.4.2.1.1.* 1.3.6.1.2.1.25.4.2.1.3.* * equates to pid in 1.3.6.1.2.1.25.4.2.1.1.* 1.3.6.1.2.1.25.4.2.1.4.* * equates to pid in 1.3.6.1.2.1.25.4.2.1.1.* 1.3.6.1.2.1.25.4.2.1.5.* * equates to pid in 1.3.6.1.2.1.25.4.2.1.1.* 1.3.6.1.2.1.25.4.2.1.6.* * equates to pid in 1.3.6.1.2.1.25.4.2.1.1.* 1.3.6.1.2.1.25.4.2.1.7.* * equates to pid in 1.3.6.1.2.1.25.4.2.1.1.*

total available memory used memory SWRunIndex process ID SWRunName process name CPU utilization of process SWRunPath processes as listed by unix pscommand SWRunParameters configuration of running processes SWRunType SWRunStatus 1 == running, 2 == runnable SWRunPerfCPU RSS entry in the unix topcommand's results

kByte/sec kByte/sec pid string % usage

string

"/usr/sbin/snmpd" "-c /var/snmp/snmpd.co nf" "4"

string

integer

integer

"1"

1.3.6.1.2.1.25.5.1.1.1.* * equates to pid in 1.3.6.1.2.1.25.4.2.1.1.*

integer

"1512"

1.3.6.1.2.1.25.5.1.1.2.* * equates to pid in 1.3.6.1.2.1.25.4.2.1.1.* 1.3.6.1.4.1.2021.10.1.3.1 iso.org.dod.internet.private.enterprises.2021 .10.1.3.1 1.3.6.1.4.1.2021.10.1.3.2 iso.org.dod.internet.private.enterprises.2021 .10.1.3.2 1.3.6.1.4.1.2021.10.1.3.3 iso.org.dod.internet.private.enterprises.2021 .10.1.3.3 1.3.6.1.4.1.2021.10.1.5.1 iso.org.dod.internet.private.enterprises.2021 .10.1.5.1 1.3.6.1.4.1.2021.10.1.5.2 iso.org.dod.internet.private.enterprises.2021 .10.1.5.2 1.3.6.1.4.1.2021.10.1.5.3 iso.org.dod.internet.private.enterprises.2021 .10.1.5.3

SWRunPerfMem CPU-load-1 (1-min average) CPU-load-5 (5-min average) CPU-load-15 (15min average) CPU-load-1 (1-min average) CPU-load-5 (5-min average) CPU-load-15 (15min average) number of network interfaces iso.org.dod.internet. mgmt.mib2.interfaces.ifNumb er.0

integer fixed-point number [0.00 .. 1.00] fixed-point number [0.00 .. 1.00] fixed-point number [0.00 .. 1.00] integer [0...100] integer [0...100] integer [0...100]

"728 KBytes"

"0.08"

"0.04"

"0.08"

"8"

"4"

"2"

1.3.6.1.2.1.2.1.0

integer

"11"

1.3.6.1.2.1.2.2.1.2.* iso.org.dod.internet.mgmt.mib2.interfaces.ifTable.ifEntry.ifDescr.*

names of all networkinterfaces

string (replace the .* with a numer from 1 to max interfaces) octets (replace the .* with specific interface from 1 to max interfaces) bits per second (replace the .* with specific interface from 1 to max interfaces) octet-string (replace the .* with specific interface from 1 to max interfaces)

"eth1" "imq0" "lo"

1.3.6.1.2.1.2.2.1.4.* iso.org.dod.internet.mgmt.mib2.interfaces.ifTable.ifEntry.ifMtu

size of the largest datagram which can be sent/received on the interface

"1500" "1454"

1.3.6.1.2.1.2.2.1.5.* iso.org.dod.internet.mgmt.mib2.interfaces.ifTable.ifEntry.ifSpeed.*

interface's current bandwidth

"10000000"

1.3.6.1.2.1.2.2.1.6.* iso.org.dod.internet.mgmt.mib2.interfaces.ifTable.ifEntry.ifPhysAddress.*

interface's physical MAC address

"000625D7D203"

1.3.6.1.2.1.2.2.1.10.* iso.org.dod.internet.mgmt.mib2.interfaces.ifTable.ifEntry.ifInOctets.*

total number of octets received on the interface, including framing characters.

integer (replace the .* with specific interface from 1 to max interfaces) integer (replace the .* with specific interface from 1 to max interfaces) integer (replace the .* with specific interface from 1 to max interfaces) integer

"3869059965"

1.3.6.1.2.1.2.2.1.16.* iso.org.dod.internet.mgmt.mib2.interfaces.ifTable.ifEntry.ifOutOctets.*

total number of octets transmitted out of the interface, including framing characters.

"3195287514"

1.3.6.1.2.1.2.2.1.20.* iso.org.dod.internet.mgmt.mib2.interfaces.ifTable.ifEntry.ifOutErrors.*

number of outbound packets that could not be transmitted because of errors

"95332"

1.3.6.1.2.1.6.6.0 iso.org.dod.internet.mgmt.mib2.tcp.tcpPassiveOpens.0 1.3.6.1.4.1.2021.100.4.0

number of passive TCP connections current syteme date & time (set in the firmware)

"2234"

time string

"Wed Jul 12 01:07:03 2006"

Additional OIDs were added in version v23 SP3 and v24


OID [dottedt & text format] MEANING index of wireless client (if there are many clients each will have index 1-x) Associated MAC SNR of this wireless client RANGE of VALUES integer text integer CONTENT (example) 1 00:ff:as:dd:44:55 30

.1.3.6.1.4.1.2021.255.3.54.1.3.32.1.1.1 .1.3.6.1.4.1.2021.255.3.54.1.3.32.1.4.1 .1.3.6.1.4.1.2021.255.3.54.1.3.32.1.26.1

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:

_________ (___br0___) / | \ \_ \____ / | \ \__ \_____ / | \ \ \ +----------|----|----|----|--+ +---|----+ | [0] [1] [2] [3] [4] | | [wlan] | |vlan1 ----- vlan0 ------ | | | | WAN LAN | | WLAN | | | | | |Internet 1 2 3 4 | | WLAN | <-- label +----------------------------+ +--------+ ethernet switch wireless eth0 (cpu port 5) eth1

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
# add an IP address to WAN-port # doing a NAT-connection from LAN to VLAN1 (WAN-Port) # set an ARP entry to connect the Modem by IP (works for me with 10.0.0.1 only)

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 <MAC:address:of:DSL:modem>

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

Getting SNMP informations of Modem from Client in LAN

#Get all OID of Modem snmpwalk -c public -v 1 <IP-Adress Modem> snmpwalk -c public -v 1 -Ofn 10.0.0.1

Interesting SNMP values

#Manufacturer Data, Uptime, etc. .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: [email protected] .1.3.6.1.2.1.1.5.0 = STRING: 004-E140-B0A/003-1082-001/Build 52-6

#Interface Name .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

#Interface Speed

.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

#DSL Modem Sync. Speed, Downstream/Upstream .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

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

You might also like