Wednesday, June 11, 2014

Bay MIB Magic

There are no less than 3 ways to configure a Bay router:

Via Site Manager
With BCC

and from the TI command-line using manual MIB-sets - Yeeehaaa!

Bay MIB Magic
©2003 Mike McArthur

What follows is a tutorial on the really geeky way to configure a Bay/Wellfleet router.

Some historical background is in order, though...

Long, long, ago -- when the earth was still cooling -- some smart people designed a router that was 100% snmp-driven.  The entire configuration of the device was nothing but a large and excruciatingly detailed SNMP MIB in a binary file.  The Wellfleet router was born.

The router contained some initialization scripts to allow a technician to connect to the console port, put an IP address on an interface, and set an SNMP community string.  The TI (Technician Interface) also had some commands to allow that same technician to view interface status information.  There was also a "menu" command for browsing by the less-clueful. Any *real* configuration or management required an SNMP GUI interface called Site Manager.  (actually the TI is quite capable, is a subset of Tcl/Tk, and can be used with the techniques below to do some cool things)

One problem with Site Manager was that the router MIB would change subtly with each new version, and would require a corresponding new version of Site Manager.  On a network with hundreds of routers, not necessarily running the same version, this could be a nightmare.

The other problem with Site Manager was that it was a GUI.  It was efficient for some tasks, and painfully cumbersome for others.  Also the geeks at ANS+Core systems (one of the first large commercial ISP's) were hard-core anti-GUI bigots who insisted on being able to do things from the command line.

Years later, Bay Networks (who had bought Wellfleet) would come out with the "Bay Command Console" or BCC.  This was an attempt to make their routers command-line configurable in a manner similar to Cisco devices. (Cisco was beating them in the "router wars" at this time, due to their orthogonal command-line and agressive marketing)

In short, there are no less than 3 ways to configure a Bay router:

Via Site Manager
With BCC

and from the TI command-line using manual MIB-sets - Yeeehaaa!


As an example, let's delete a static route on a Bay .


First use the list command to find the proper MIB variable for static routes.  What you are looking for is something that starts with "wf" and has the words "Static Route" in it somewhere:

[ ClunkyBayRouter]$list
wfCSMACDEntry = 1.3.6.1.4.1.18.3.4.1.1
wfCSMACDAutoNegEntry = 1.3.6.1.4.1.18.3.4.16.1.1
wfFddiEntry = 1.3.6.1.4.1.18.3.4.4.1
wfFddiSmtEntry = 1.3.6.1.4.1.18.3.4.15.1.2.1
wfFddiSmtExtEntry = 1.3.6.1.4.1.18.3.4.15.1.3.1
wfFddiSmtActionEntry = 1.3.6.1.4.1.18.3.4.15.1.4.1
[SNIP]
wfIpBase = 1.3.6.1.4.1.18.3.5.3.2.1.1
wfIpBaseRtEntry = 1.3.6.1.4.1.18.3.5.3.2.1.2.1
wfIpBaseHostEntry = 1.3.6.1.4.1.18.3.5.3.2.1.3.1
wfIpInterfaceEntry = 1.3.6.1.4.1.18.3.5.3.2.1.4.1
wfIpStaticRouteEntry = 1.3.6.1.4.1.18.3.5.3.2.1.5.1
wfIpAdjacentHostEntry = 1.3.6.1.4.1.18.3.5.3.2.1.6.1
wfIpTrafficFilterEntry = 1.3.6.1.4.1.18.3.5.3.2.1.7.1
wfIpForwardEntry = 1.3.6.1.4.1.18.3.5.3.2.1.16.1
wfRdiscIntfEntry = 1.3.6.1.4.1.18.3.5.3.2.1.17.1
wfIpNetToMediaEntry = 1.3.6.1.4.1.18.3.5.3.2.1.18.1
wfIpAccCtrlFilterEntry = 1.3.6.1.4.1.18.3.5.3.2.1.19.1
wfIpAccCtrlNetworkEntry = 1.3.6.1.4.1.18.3.5.3.2.1.20.1
wfIpAccCtrlUserHostEntry = 1.3.6.1.4.1.18.3.5.3.2.1.21.1
wfIpAddrEntry = 1.3.6.1.4.1.18.3.5.3.2.1.22.1
wfIpInternalHostEntry = 1.3.6.1.4.1.18.3.5.3.2.1.23.1
wfIpIntfCfgEntry = 1.3.6.1.4.1.18.3.5.3.2.1.24.1
wfIpIntfStatsEntry = 1.3.6.1.4.1.18.3.5.3.2.1.25.1
wfIpIntfStatsIcmpEntry = 1.3.6.1.4.1.18.3.5.3.2.1.26.1


There it is!  I've highlighted it in red for you....

Instead of using your eyeballs, you can always use a script.

Ok, now we need to see how many static routes ("instances") are configured on the box.



[ ClunkyBayRouter]$list instances wfIpStaticRouteEntry
inst_ids  = 0.0.0.0.0.0.0.0.1
            172.16.10.0.255.255.255.0.1
            192.168.1.0.255.255.252.0.1
            192.168.2.0.255.255.255.0.1
            192.168.3.0.255.255.225.0.1
            192.168.4.0.255.255.255.255.10
            192.168.5.0.255.255.255.224.1


And we need to see what a typical Static Route entry consists of.

[ ClunkyBayRouter]$list wfIpStaticRouteEntry
wfIpSrCreate = 1
wfIpSrEnable = 2
wfIpSrIpAddress = 3
wfIpSrIpNetMask = 4
wfIpSrCost = 5
wfIpSrNextHopAddr = 6
wfIpSrNextHopMask = 7
wfIpSrPreference = 8
wfIpSrIpAddressRt = 9
wfIpSrValid = 10
wfIpSrUnnumCct = 11



Ok, the static route to 172.16.10.0/24 is the one I want to delete.  Now I should find out all about that particular "instance" by using the SNMP get command.

The format is "get [mibvariablename].*.[instance identifier]".  If I only wanted a particular element, it would be
"get [mibvariablename].[elementname/number].[instance identifier]".


[ ClunkyBayRouter]$get wfIpStaticRouteEntry.*.172.16.10.0.255.255.255.0.1
wfIpStaticRouteEntry.wfIpSrCreate.172.16.10.0.255.255.255.0.1 = 1
wfIpStaticRouteEntry.wfIpSrEnable.172.16.10.0.255.255.255.0.1 = 1
wfIpStaticRouteEntry.wfIpSrIpAddress.172.16.10.0.255.255.255.0.1 = 166.35.219.0
wfIpStaticRouteEntry.wfIpSrIpNetMask.172.16.10.0.255.255.255.0.1 = 255.255.255.0
wfIpStaticRouteEntry.wfIpSrCost.172.16.10.0.255.255.255.0.1 = 1
wfIpStaticRouteEntry.wfIpSrNextHopAddr.172.16.10.0.255.255.255.0.1 = 10.1.143.2
wfIpStaticRouteEntry.wfIpSrNextHopMask.172.16.10.0.255.255.255.0.1 = 255.255.255.252
wfIpStaticRouteEntry.wfIpSrPreference.172.16.10.0.255.255.255.0.1 = 16
wfIpStaticRouteEntry.wfIpSrIpAddressRt.172.16.10.0.255.255.255.0.1 = 1
wfIpStaticRouteEntry.wfIpSrValid.172.16.10.0.255.255.255.0.1 = 1
wfIpStaticRouteEntry.wfIpSrUnnumCct.172.16.10.0.255.255.255.0.1 = 0


The first two elements "wfIpSrCreate" and "wfIpSrEnable" are very important.

If I want to disable a static route without removing it from the config completely, I would set the corresponding "wfIpSrEnable" to zero and then use the "commit" command.

Note that MIB changes do not become effective until the "commit" command is issued.



[ ClunkyBayRouter]$set wfIpStaticRouteEntry.wfIpSrEnable.172.16.10.0.255.255.255.0.1 0

[ ClunkyBayRouter]$show ip routes 172.16.10.0
  Destination        Mask       Proto   Age      Cost     NextHop Addr /  AS
--------------- --------------- ----- -------- --------  ---------------------
172.16.10.0    255.255.255.0   LOCAL 296235   1         10.1.143.2
1 route(s) found


[ ClunkyBayRouter]$commit

[ ClunkyBayRouter]$show ip routes 172.16.10.0
No routes found


This has solved my immediate problem, but what if I want to remove that static route for good? (I do) That is what the wfIpSrCreate is for.  Set it to "2" to delete the object :



[ ClunkyBayRouter]$set wfIpStaticRouteEntry.wfIpSrCreate.172.16.10.0.255.255.255.0.1 2

Here is the Static route entry in all its glory, right before I blow it away:

[ ClunkyBayRouter]$get wfIpStaticRouteEntry.*.172.16.10.0.255.255.255.0.1
wfIpStaticRouteEntry.wfIpSrCreate.172.16.10.0.255.255.255.0.1 = 2
wfIpStaticRouteEntry.wfIpSrEnable.172.16.10.0.255.255.255.0.1 = 0
wfIpStaticRouteEntry.wfIpSrIpAddress.172.16.10.0.255.255.255.0.1 = 166.35.219.0
wfIpStaticRouteEntry.wfIpSrIpNetMask.172.16.10.0.255.255.255.0.1 = 255.255.255.0
wfIpStaticRouteEntry.wfIpSrCost.172.16.10.0.255.255.255.0.1 = 1
wfIpStaticRouteEntry.wfIpSrNextHopAddr.172.16.10.0.255.255.255.0.1 = 10.1.143.2
wfIpStaticRouteEntry.wfIpSrNextHopMask.172.16.10.0.255.255.255.0.1 = 255.255.255.252
wfIpStaticRouteEntry.wfIpSrPreference.172.16.10.0.255.255.255.0.1 = 16
wfIpStaticRouteEntry.wfIpSrIpAddressRt.172.16.10.0.255.255.255.0.1 = 1
wfIpStaticRouteEntry.wfIpSrValid.172.16.10.0.255.255.255.0.1 = 2
wfIpStaticRouteEntry.wfIpSrUnnumCct.172.16.10.0.255.255.255.0.1 = 0

[ ClunkyBayRouter]$commit

[ ClunkyBayRouter]$get wfIpStaticRouteEntry.*.172.16.10.0.255.255.255.0.1
get: The following number of objects do not exist or are not accessible: 11

All gone....

[ ClunkyBayRouter]$list instances wfIpStaticRouteEntry
inst_ids  = 0.0.0.0.0.0.0.0.1
            192.168.1.0.255.255.252.0.1
            192.168.2.0.255.255.255.0.1
            192.168.3.0.255.255.225.0.1
            192.168.4.0.255.255.255.255.10
            192.168.5.0.255.255.255.224.1



No comments:

Post a Comment