ocochard / BSDRP

BSD Router Project
https://bsdrp.net
Other
177 stars 38 forks source link

bsnmpd not showing out octets for vlan interfaces #8

Closed ugtelset closed 6 years ago

ugtelset commented 8 years ago

After upgrade BSDRP from 1.56 to 1.59 version bsnmpd not showing out 64-bits octets for vlan interfaces.

[root@router]~# cat /etc/version 
1.59

[root@router]~# bsnmpd -h
Begemot simple SNMP daemon. Copyright (c) 2001-2002 Fraunhofer Institute for
Open Communication Systems (FhG Fokus). All rights reserved.
Copyright (c) 2010 The FreeBSD Foundation. All rights reserved.

[root@router]~# ifconfig -a
igb0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
options=bb<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,JUMBO_MTU,VLAN_HWCSUM>
    ether 00:1b:21:61:8b:f4
    nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
    media: Ethernet autoselect (1000baseT <full-duplex>)
    status: active
em0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
    options=9b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM>
    ether 00:1b:21:61:8b:f4
    nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
    media: Ethernet autoselect (1000baseT <full-duplex>)
    status: active
lagg0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
    options=9b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM>
    ether 00:1b:21:61:8b:f4
    nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
    media: Ethernet autoselect
    status: active
    laggproto lacp lagghash l3,l4
    laggport: igb0 flags=1c<ACTIVE,COLLECTING,DISTRIBUTING>
    laggport: em0 flags=1c<ACTIVE,COLLECTING,DISTRIBUTING>
lagg0.1004: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
    options=103<RXCSUM,TXCSUM,TSO4>
    ether 00:1b:21:61:8b:f4
    inet x.x.x.x netmask 0xfffffffc broadcast x.x.x.x
    nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
    media: Ethernet autoselect
    status: active
    vlan: 1004 parent interface: lagg0

[root@router]~# bsnmpget -s xxxx@localhost ifName.7
ifName[7] = lagg0
[root@router]~# bsnmpget -s xxxx@localhost ifHCInOctets.7
ifHCInOctets[7] = 5544554463582
[root@router]~# bsnmpget -s xxxx@localhost ifName.12
ifName[12] = lagg0.1004
[root@router]~# bsnmpget -s xxxx@localhost ifHCInOctets.12
ifHCInOctets[12] = No Such Instance

[root@router]~# cat /etc/snmpd.config
location := "......."
contact := "...."
system := 1 # FreeBSD
traphost := localhost
trapport := 162
read := "xxxx"
trap := "..............."
NoAuthProtocol      := 1.3.6.1.6.3.10.1.1.1
HMACMD5AuthProtocol := 1.3.6.1.6.3.10.1.1.2
HMACSHAAuthProtocol := 1.3.6.1.6.3.10.1.1.3
NoPrivProtocol      := 1.3.6.1.6.3.10.1.2.1
DESPrivProtocol     := 1.3.6.1.6.3.10.1.2.2
AesCfb128Protocol   := 1.3.6.1.6.3.10.1.2.4
securityModelAny    := 0
securityModelSNMPv1 := 1
securityModelSNMPv2c    := 2
securityModelUSM    := 3
MPmodelSNMPv1       := 0
MPmodelSNMPv2c      := 1
MPmodelSNMPv3       := 3
noAuthNoPriv := 1
authNoPriv := 2
authPriv := 3
%snmpd
begemotSnmpdDebugDumpPdus   = 2
begemotSnmpdDebugSyslogPri  = 7
begemotSnmpdCommunityString.0.1 = $(read)
begemotSnmpdCommunityDisable    = 1
begemotSnmpdPortStatus.10.20.0.1.161 = 1
begemotSnmpdPortStatus.127.0.0.1.161 = 1
begemotSnmpdLocalPortStatus."/var/run/snmpd.sock" = 1
begemotSnmpdLocalPortType."/var/run/snmpd.sock" = 4
begemotTrapSinkStatus.[$(traphost)].$(trapport) = 4
begemotTrapSinkVersion.[$(traphost)].$(trapport) = 2
begemotTrapSinkComm.[$(traphost)].$(trapport) = $(trap)
sysContact  = $(contact)
sysLocation = $(location)
sysObjectId     = 1.3.6.1.4.1.12325.1.1.2.1.$(system)
snmpEnableAuthenTraps = 2
begemotSnmpdModulePath."mibII"  = "/usr/lib/snmp_mibII.so"
begemotSnmpdModulePath."ucd" = "/usr/local/lib/snmp_ucd.so"
ocochard commented 8 years ago

Do you think it's related to this FreeBSD bugs?: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=193953

ugtelset commented 8 years ago

I think It's the same bug. But i see that there are no solutions to this problem since 2014-09-26.

ocochard commented 6 years ago

I've tried to reproduce this error on 1.90 and didn't reproduce it: Do you thinks it's resolved ?

VM lab setup:

sysrc cloned_interfaces=lagg0
sysrc ifconfig_vtnet0="up"
sysrc ifconfig_vtnet1="up"
sysrc ifconfig_lagg0="laggproto loadbalance laggport vtnet0 laggport vtnet1"
sysrc vlans_lagg0="1004"
sysrc ifconfig_lagg0_1004="inet 10.0.0.1/24"
sysrc bsnmpd_enable=yes
service netif restart
service bsnmpd start

tests:

[root@router]~# show version
BSD Router Project version: 1.90
   Console: serial
Based on: FreeBSD 11.2-BETA3 amd64
[root@router]~# echo Increasing stats counters
Increasing stats counters
[root@router]~# ping -c 2 10.0.0.2
PING 10.0.0.2 (10.0.0.2): 56 data bytes

--- 10.0.0.2 ping statistics ---
2 packets transmitted, 0 packets received, 100.0% packet loss
[root@router]~# ifconfig lagg0.1004
lagg0.1004: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=80000<LINKSTATE>
        ether 58:9c:fc:01:00:01
        inet6 fe80::5a9c:fcff:fe01:1%lagg0.1004 prefixlen 64 scopeid 0x6
        inet 10.0.0.1 netmask 0xffffff00 broadcast 10.0.0.255
        nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
        media: Ethernet autoselect
        status: active
        vlan: 1004 vlanpcp: 0 parent interface: lagg0
        groups: vlan

[root@router]~# bsnmpget -s public@localhost ifName.5
ifName[5] = lagg0.1004
[root@router]~# bsnmpget -s public@localhost ifHCInOctets.5
ifHCInOctets[5] = 0
[root@router]~# bsnmpget -s public@localhost ifHCOutOctets.5
ifHCOutOctets[5] = 612
mikhiv commented 6 years ago

Hi Oliver! Well, It's a good news! But we aren't using BSDRP now. The last version of used BSDRP was 1.7.