blob: b573b6a76a95083ab8849950439f45226983c9c6 [file] [log] [blame]
paul718e3742002-12-13 20:15:29 +00001@node SNMP Support, Zebra Protocol, Kernel Interface, Top
2@comment node-name, next, previous, up
3@chapter SNMP Support
4
pauld191eba2004-07-31 15:15:39 +00005SNMP (Simple Network Managing Protocol) is a widely implemented feature for
6collecting network information from router and/or host. Quagga itself does not
7support SNMP agent (server daemon) functionality but is able to connect to a
8SNMP agent using the SMUX protocol (RFC1227) and make the routing protocol MIBs
9available through it.
paul718e3742002-12-13 20:15:29 +000010
11@menu
pauld191eba2004-07-31 15:15:39 +000012* Getting and installing an SNMP agent::
13* SMUX configuration::
14* MIB and command reference::
paul718e3742002-12-13 20:15:29 +000015@end menu
16
pauld191eba2004-07-31 15:15:39 +000017
18
19@node Getting and installing an SNMP agent, SMUX configuration, SNMP Support, SNMP Support
paul718e3742002-12-13 20:15:29 +000020@comment node-name, next, previous, up
pauld191eba2004-07-31 15:15:39 +000021@section Getting and installing an SNMP agent
paul718e3742002-12-13 20:15:29 +000022
pauld191eba2004-07-31 15:15:39 +000023There are several SNMP agent which support SMUX. We recommend to use the latest
24version of @code{net-snmp} which was formerly known as @code{ucd-snmp}.
25It is free and open software and available at @url{http://www.net-snmp.org/}
26and as binary package for most Linux distributions.
27@code{net-snmp} has to be compiled with @code{--with-mib-modules=smux} to
28be able to accept connections from Quagga.
paul718e3742002-12-13 20:15:29 +000029
paul718e3742002-12-13 20:15:29 +000030
paul718e3742002-12-13 20:15:29 +000031
pauld191eba2004-07-31 15:15:39 +000032@node SMUX configuration, MIB and command reference, Getting and installing an SNMP agent, SNMP Support
paul718e3742002-12-13 20:15:29 +000033@comment node-name, next, previous, up
34@section SMUX configuration
35
pauld191eba2004-07-31 15:15:39 +000036To enable SMUX protocol support, Quagga must have been build with the
37@code{--enable-snmp} option.
paul718e3742002-12-13 20:15:29 +000038
pauld191eba2004-07-31 15:15:39 +000039A separate connection has then to be established between between the SNMP agent
40(snmpd) and each of the Quagga daemons. This connections each use different OID
41numbers and passwords. Be aware that this OID number is not the one that is
42used in queries by clients, it is solely used for the intercommunication of the
43daemons.
44
45In the following example the ospfd daemon will be connected to the snmpd daemon
46using the password "quagga_ospfd". For testing it is recommending to take
47exactly the below snmpd.conf as wrong access restrictions can be hard to debug.
48
49@example
50/etc/snmp/snmpd.conf:
51 #
52 # example access restrictions setup
53 #
54 com2sec readonly default public
55 group MyROGroup v1 readonly
56 view all included .1 80
57 access MyROGroup "" any noauth exact all none none
58 #
59 # the following line is relevant for Quagga
60 #
61 smuxpeer .1.3.6.1.4.1.3317.1.2.5 quagga_ospfd
62
63/etc/quagga/ospf:
64 ! ... the rest of ospfd.conf has been omitted for clarity ...
65 !
66 smux peer .1.3.6.1.4.1.3317.1.2.5 quagga_ospfd
67 !
68@end example
69
70After restarting snmpd and quagga, a successful connection can be verified in
71the syslog and by querying the SNMP daemon:
72
73@example
74snmpd[12300]: [smux_accept] accepted fd 12 from 127.0.0.1:36255
75snmpd[12300]: accepted smux peer: \
76 oid GNOME-PRODUCT-ZEBRA-MIB::ospfd, quagga-0.96.5
77
78# snmpwalk -c public -v1 localhost .1.3.6.1.2.1.14.1.1
79OSPF-MIB::ospfRouterId.0 = IpAddress: 192.168.42.109
80@end example
81
82Be warned that the current version (5.1.1) of the Net-SNMP daemon writes a line
83for every SNMP connect to the syslog which can lead to enormous log file sizes.
84If that is a problem you should consider to patch snmpd and comment out the
85troublesome @code{snmp_log()} line in the function
86@code{netsnmp_agent_check_packet()} in @code{agent/snmp_agent.c}.
87
88
89
90@node MIB and command reference, ,SMUX configuration, SNMP Support
91@comment node-name, next, previous, up
92@section MIB and command reference
93
94The following OID numbers are used for the interprocess communication of snmpd and
95the Quagga daemons. Sadly, SNMP has not been implemented in all daemons yet.
96@example
97 (OIDs below .iso.org.dod.internet.private.enterprises)
hasso54aa6b22004-10-12 06:05:34 +000098zebra .1.3.6.1.4.1.3317.1.2.1 .gnome.gnomeProducts.zebra.zserv
99bgpd .1.3.6.1.4.1.3317.1.2.2 .gnome.gnomeProducts.zebra.bgpd
100ripd .1.3.6.1.4.1.3317.1.2.3 .gnome.gnomeProducts.zebra.ripd
101ospfd .1.3.6.1.4.1.3317.1.2.5 .gnome.gnomeProducts.zebra.ospfd
102ospf6d .1.3.6.1.4.1.3317.1.2.6 .gnome.gnomeProducts.zebra.ospf6d
pauld191eba2004-07-31 15:15:39 +0000103@end example
104
105The following OID numbers are used for querying the SNMP daemon by a client:
106@example
hasso54aa6b22004-10-12 06:05:34 +0000107zebra .1.3.6.1.2.1.4.24 .iso.org.dot.internet.mgmt.mib-2.ip.ipForward
108ospfd .1.3.6.1.2.1.14 .iso.org.dot.internet.mgmt.mib-2.ospf
109bgpd .1.3.6.1.2.1.15 .iso.org.dot.internet.mgmt.mib-2.bgp
110ripd .1.3.6.1.2.1.23 .iso.org.dot.internet.mgmt.mib-2.rip2
111ospf6d .1.3.6.1.3.102 .iso.org.dod.internet.experimental.ospfv3
pauld191eba2004-07-31 15:15:39 +0000112@end example
113
114The following syntax is understood by the Quagga daemons for configuring SNMP:
paul718e3742002-12-13 20:15:29 +0000115@deffn {Command} {smux peer @var{oid}} {}
116@deffnx {Command} {no smux peer @var{oid}} {}
117@end deffn
118
119@deffn {Command} {smux peer @var{oid} @var{password}} {}
120@deffnx {Command} {no smux peer @var{oid} @var{password}} {}
121@end deffn