bsnmp with vlan, no speed values are set

Harti Brandt hartmut.brandt at dlr.de
Tue Apr 4 15:54:47 UTC 2006


On Fri, 31 Mar 2006, Thomas wrote:

T>Hi
T>
T>I use bsnmpd-1.11_3 with FreeBSD 5.4-RELEASE on my router. It works very
T>well. The only problem are my vlans on my em interfaces.
T>
T>As you see below it doesn't set any speed values for vlans. Afaik this
T>means I can't use 64bit counter (ifHCInOctets). Is there a way set it
T>the speed value? 

I think this was fixed in -current in rev. 1.93 so that the vlan 
reports the speed of the underlying interface. You might try to use that 
fix.

Alternativly you can patch bsnmp to set the speed to some arbitrary high 
value if it is 0. This would be in snmp_mibII/mibII.c mib_fetch_ifmib().
Add something like:

	if (ifp->mib.ifmd_data.ifi_baudrate == 0)
		ifp->mib.ifmd_data.ifi_baudrate = 1000000000;

just after the HIGHSPEED and VERYHIGHSPEED flags have been cleared.

(CC: to Andrey)

harti

T>
T>snmpwalk -v 1 -c public localhost If
T>IF-MIB::ifIndex.1 = INTEGER: 1
T>IF-MIB::ifIndex.2 = INTEGER: 2
T>IF-MIB::ifIndex.3 = INTEGER: 3
T>IF-MIB::ifIndex.4 = INTEGER: 4
T>IF-MIB::ifIndex.5 = INTEGER: 5
T>IF-MIB::ifIndex.6 = INTEGER: 6
T>IF-MIB::ifIndex.7 = INTEGER: 7
T>IF-MIB::ifIndex.8 = INTEGER: 8
T>IF-MIB::ifDescr.1 = STRING: em0
T>IF-MIB::ifDescr.2 = STRING: em1
T>IF-MIB::ifDescr.3 = STRING: lo0
T>IF-MIB::ifDescr.4 = STRING: lo1
T>IF-MIB::ifDescr.5 = STRING: lo2
T>IF-MIB::ifDescr.6 = STRING: vlan8
T>IF-MIB::ifDescr.7 = STRING: vlan507
T>IF-MIB::ifDescr.8 = STRING: vlan200
T>IF-MIB::ifType.1 = INTEGER: ethernetCsmacd(6)
T>IF-MIB::ifType.2 = INTEGER: ethernetCsmacd(6)
T>IF-MIB::ifType.3 = INTEGER: softwareLoopback(24)
T>IF-MIB::ifType.4 = INTEGER: softwareLoopback(24)
T>IF-MIB::ifType.5 = INTEGER: softwareLoopback(24)
T>IF-MIB::ifType.6 = INTEGER: l2vlan(135)
T>IF-MIB::ifType.7 = INTEGER: l2vlan(135)
T>IF-MIB::ifType.8 = INTEGER: l2vlan(135)
T>IF-MIB::ifMtu.1 = INTEGER: 1546
T>IF-MIB::ifMtu.2 = INTEGER: 1546
T>IF-MIB::ifMtu.3 = INTEGER: 16384
T>IF-MIB::ifMtu.4 = INTEGER: 16384
T>IF-MIB::ifMtu.5 = INTEGER: 16384
T>IF-MIB::ifMtu.6 = INTEGER: 1546
T>IF-MIB::ifMtu.7 = INTEGER: 1546
T>IF-MIB::ifMtu.8 = INTEGER: 1546
T>IF-MIB::ifSpeed.1 = Gauge32: 1000000000
T>IF-MIB::ifSpeed.2 = Gauge32: 1000000000
T>IF-MIB::ifSpeed.3 = Gauge32: 0
T>IF-MIB::ifSpeed.4 = Gauge32: 0
T>IF-MIB::ifSpeed.5 = Gauge32: 0
T>IF-MIB::ifSpeed.6 = Gauge32: 0
T>IF-MIB::ifSpeed.7 = Gauge32: 0
T>IF-MIB::ifSpeed.8 = Gauge32: 0
T>
T>
T>snmpwalk -v 1 -c public localhost IfX
T>IF-MIB::ifName.1 = STRING: em0
T>IF-MIB::ifName.2 = STRING: em1
T>IF-MIB::ifName.3 = STRING: lo0
T>IF-MIB::ifName.4 = STRING: lo1
T>IF-MIB::ifName.5 = STRING: lo2
T>IF-MIB::ifName.6 = STRING: vlan8
T>IF-MIB::ifName.7 = STRING: vlan507
T>IF-MIB::ifName.8 = STRING: vlan200
T>IF-MIB::ifInMulticastPkts.1 = Counter32: 27763749
T>IF-MIB::ifInMulticastPkts.2 = Counter32: 39112192
T>IF-MIB::ifInMulticastPkts.3 = Counter32: 0
T>IF-MIB::ifInMulticastPkts.4 = Counter32: 0
T>IF-MIB::ifInMulticastPkts.5 = Counter32: 0
T>IF-MIB::ifInMulticastPkts.6 = Counter32: 66425
T>IF-MIB::ifInMulticastPkts.7 = Counter32: 597199434
T>IF-MIB::ifInMulticastPkts.8 = Counter32: 2886152
T>IF-MIB::ifOutBroadcastPkts.8 = Counter32: 0
T>IF-MIB::ifHCInOctets.1 = Counter64: 1905469523
T>IF-MIB::ifHCInOctets.2 = Counter64: 4004579218
T>IF-MIB::ifHCInUcastPkts.1 = Counter64: 3374758879
T>IF-MIB::ifHCInUcastPkts.2 = Counter64: 2260898668
T>IF-MIB::ifHCInMulticastPkts.1 = Counter64: 27763749
T>IF-MIB::ifHCInMulticastPkts.2 = Counter64: 39112192
T>IF-MIB::ifHCInBroadcastPkts.1 = Counter64: 0
T>IF-MIB::ifHCInBroadcastPkts.2 = Counter64: 0
T>IF-MIB::ifHCOutOctets.1 = Counter64: 1859205456
T>IF-MIB::ifHCOutOctets.2 = Counter64: 2149535104
T>IF-MIB::ifHCOutUcastPkts.1 = Counter64: 1060004524
T>IF-MIB::ifHCOutUcastPkts.2 = Counter64: 1136546470
T>IF-MIB::ifHCOutMulticastPkts.1 = Counter64: 1580694
T>IF-MIB::ifHCOutMulticastPkts.2 = Counter64: 4601834
T>IF-MIB::ifHCOutBroadcastPkts.1 = Counter64: 0
T>IF-MIB::ifHCOutBroadcastPkts.2 = Counter64: 0
T>IF-MIB::ifLinkUpDownTrapEnable.1 = INTEGER: enabled(1)
T>IF-MIB::ifLinkUpDownTrapEnable.2 = INTEGER: enabled(1)
T>IF-MIB::ifLinkUpDownTrapEnable.3 = INTEGER: disabled(2)
T>IF-MIB::ifLinkUpDownTrapEnable.4 = INTEGER: disabled(2)
T>IF-MIB::ifLinkUpDownTrapEnable.5 = INTEGER: disabled(2)
T>IF-MIB::ifLinkUpDownTrapEnable.6 = INTEGER: disabled(2)
T>IF-MIB::ifLinkUpDownTrapEnable.7 = INTEGER: disabled(2)
T>IF-MIB::ifLinkUpDownTrapEnable.8 = INTEGER: disabled(2)
T>IF-MIB::ifHighSpeed.1 = Gauge32: 1000
T>IF-MIB::ifHighSpeed.2 = Gauge32: 1000
T>IF-MIB::ifHighSpeed.3 = Gauge32: 0
T>IF-MIB::ifHighSpeed.4 = Gauge32: 0
T>IF-MIB::ifHighSpeed.5 = Gauge32: 0
T>IF-MIB::ifHighSpeed.6 = Gauge32: 0
T>IF-MIB::ifHighSpeed.7 = Gauge32: 0
T>IF-MIB::ifHighSpeed.8 = Gauge32: 0
T>
T>em0: flags=18843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST,POLLING> mtu
T>1546
T>        options=4b<RXCSUM,TXCSUM,VLAN_MTU,POLLING>
T>        inet xxxxxxxxx netmask 0xffffffe0 broadcast xxxxxxxxx
T>        ether 00:30:48:2c:6e:9a
T>        media: Ethernet autoselect (1000baseTX <full-duplex>)
T>        status: active
T>em1: flags=18843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST,POLLING> mtu
T>1546
T>        options=4b<RXCSUM,TXCSUM,VLAN_MTU,POLLING>
T>        inet xxxxxxxx netmask 0xffffffe0 broadcast xxxxxxxx
T>        ether 00:30:48:2c:6e:9b
T>        media: Ethernet autoselect (1000baseTX <full-duplex>)
T>        status: active
T>vlan8: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1546
T>        inet xxxxxx netmask 0xfffffff0 broadcast xxxxxxxxxx
T>        ether 00:30:48:2c:6e:9a
T>        media: Ethernet autoselect (1000baseTX <full-duplex>)
T>        status: active
T>        vlan: 8 parent interface: em0
T>vlan507: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1546
T>        inet xxxxxxx netmask 0xfffffff0 broadcast xxxxxxxxx
T>        ether 00:30:48:2c:6e:9b
T>        media: Ethernet autoselect (1000baseTX <full-duplex>)
T>        status: active
T>        vlan: 507 parent interface: em1
T>vlan200: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1546
T>        inet xxxxxxxx netmask 0xfffffff8 broadcast 82.220.0.223
T>        inet6 fe80::230:48ff:fe2c:6e9a%vlan200 prefixlen 64 scopeid 0x8
T>        ether 00:30:48:2c:6e:9b
T>        media: Ethernet autoselect (1000baseTX <full-duplex>)
T>        status: active
T>        vlan: 200 parent interface: em1
T>
T>
T>Regards,
T>Thomas
T>
T>
T>_______________________________________________
T>freebsd-net at freebsd.org mailing list
T>http://lists.freebsd.org/mailman/listinfo/freebsd-net
T>To unsubscribe, send any mail to "freebsd-net-unsubscribe at freebsd.org"
T>
T>
T>


More information about the freebsd-net mailing list