Check Information Restriction

This scenario shows how to configure a view to restrict information for incoming requests in SNMPv3. In addition, the SNMP ‘walk’ and ‘table’ commands are checked.

../../../../_images/common1.svg

Test SNMPv3

Description

A restricted view is configured for a user in DUT0 and the ‘walk’ and ‘table’ commands are used to check incoming requests in SNMPv3.

Scenario

Step 1: Set the following configuration in DUT0:

set interfaces ethernet eth0 address 10.0.0.1/24
set service snmp user USER2TEST

Step 2: Set the following configuration in DUT1:

set interfaces ethernet eth0 address 10.0.0.2/24

Note

Initially, local and DUT1 requests are allowed, since there are no restrictions by default.

Step 3: Run command service snmp walk local-agent v3 USER2TEST oid ifTable at DUT0 and check if output matches the following regular expressions:

::ifDescr\.1 = STRING: "?lo"?
Show output
IF-MIB::ifIndex.1 = INTEGER: 1
IF-MIB::ifIndex.2 = INTEGER: 2
IF-MIB::ifIndex.3 = INTEGER: 3
IF-MIB::ifIndex.4 = INTEGER: 4
IF-MIB::ifIndex.26 = INTEGER: 26
IF-MIB::ifIndex.27 = INTEGER: 27
IF-MIB::ifIndex.28 = INTEGER: 28
IF-MIB::ifDescr.1 = STRING: lo
IF-MIB::ifDescr.2 = STRING: Red Hat, Inc Device 0001
IF-MIB::ifDescr.3 = STRING: Red Hat, Inc Device 0001
IF-MIB::ifDescr.4 = STRING: ip_vti0
IF-MIB::ifDescr.26 = STRING: gre0
IF-MIB::ifDescr.27 = STRING: gretap0
IF-MIB::ifDescr.28 = STRING: erspan0
IF-MIB::ifType.1 = INTEGER: softwareLoopback(24)
IF-MIB::ifType.2 = INTEGER: ethernetCsmacd(6)
IF-MIB::ifType.3 = INTEGER: ethernetCsmacd(6)
IF-MIB::ifType.4 = INTEGER: tunnel(131)
IF-MIB::ifType.26 = INTEGER: tunnel(131)
IF-MIB::ifType.27 = INTEGER: ethernetCsmacd(6)
IF-MIB::ifType.28 = INTEGER: ethernetCsmacd(6)
IF-MIB::ifMtu.1 = INTEGER: 65536
IF-MIB::ifMtu.2 = INTEGER: 1500
IF-MIB::ifMtu.3 = INTEGER: 1500
IF-MIB::ifMtu.4 = INTEGER: 1480
IF-MIB::ifMtu.26 = INTEGER: 1476
IF-MIB::ifMtu.27 = INTEGER: 1462
IF-MIB::ifMtu.28 = INTEGER: 1450
IF-MIB::ifSpeed.1 = Gauge32: 10000000
IF-MIB::ifSpeed.2 = Gauge32: 0
IF-MIB::ifSpeed.3 = Gauge32: 0
IF-MIB::ifSpeed.4 = Gauge32: 0
IF-MIB::ifSpeed.26 = Gauge32: 0
IF-MIB::ifSpeed.27 = Gauge32: 0
IF-MIB::ifSpeed.28 = Gauge32: 0
IF-MIB::ifPhysAddress.1 = STRING:
IF-MIB::ifPhysAddress.2 = STRING: de:ad:be:ef:6c:10
IF-MIB::ifPhysAddress.3 = STRING: de:ad:be:ef:6c:11
IF-MIB::ifPhysAddress.4 = STRING:
IF-MIB::ifPhysAddress.26 = STRING:
IF-MIB::ifPhysAddress.27 = STRING:
IF-MIB::ifPhysAddress.28 = STRING:
IF-MIB::ifAdminStatus.1 = INTEGER: up(1)
IF-MIB::ifAdminStatus.2 = INTEGER: up(1)
IF-MIB::ifAdminStatus.3 = INTEGER: down(2)
IF-MIB::ifAdminStatus.4 = INTEGER: down(2)
IF-MIB::ifAdminStatus.26 = INTEGER: down(2)
IF-MIB::ifAdminStatus.27 = INTEGER: down(2)
IF-MIB::ifAdminStatus.28 = INTEGER: down(2)
IF-MIB::ifOperStatus.1 = INTEGER: up(1)
IF-MIB::ifOperStatus.2 = INTEGER: up(1)
IF-MIB::ifOperStatus.3 = INTEGER: down(2)
IF-MIB::ifOperStatus.4 = INTEGER: down(2)
IF-MIB::ifOperStatus.26 = INTEGER: down(2)
IF-MIB::ifOperStatus.27 = INTEGER: down(2)
IF-MIB::ifOperStatus.28 = INTEGER: down(2)
IF-MIB::ifLastChange.1 = Timeticks: (0) 0:00:00.00
IF-MIB::ifLastChange.2 = Timeticks: (0) 0:00:00.00
IF-MIB::ifLastChange.3 = Timeticks: (0) 0:00:00.00
IF-MIB::ifLastChange.4 = Timeticks: (0) 0:00:00.00
IF-MIB::ifLastChange.26 = Timeticks: (0) 0:00:00.00
IF-MIB::ifLastChange.27 = Timeticks: (0) 0:00:00.00
IF-MIB::ifLastChange.28 = Timeticks: (0) 0:00:00.00
IF-MIB::ifInOctets.1 = Counter32: 7163
IF-MIB::ifInOctets.2 = Counter32: 582306555
IF-MIB::ifInOctets.3 = Counter32: 25510
IF-MIB::ifInOctets.4 = Counter32: 0
IF-MIB::ifInOctets.26 = Counter32: 0
IF-MIB::ifInOctets.27 = Counter32: 0
IF-MIB::ifInOctets.28 = Counter32: 0
IF-MIB::ifInUcastPkts.1 = Counter32: 0
IF-MIB::ifInUcastPkts.2 = Counter32: 0
IF-MIB::ifInUcastPkts.3 = Counter32: 0
IF-MIB::ifInUcastPkts.4 = Counter32: 0
IF-MIB::ifInUcastPkts.26 = Counter32: 0
IF-MIB::ifInUcastPkts.27 = Counter32: 0
IF-MIB::ifInUcastPkts.28 = Counter32: 0
IF-MIB::ifInNUcastPkts.1 = Counter32: 0
IF-MIB::ifInNUcastPkts.2 = Counter32: 0
IF-MIB::ifInNUcastPkts.3 = Counter32: 0
IF-MIB::ifInNUcastPkts.4 = Counter32: 0
IF-MIB::ifInNUcastPkts.26 = Counter32: 0
IF-MIB::ifInNUcastPkts.27 = Counter32: 0
IF-MIB::ifInNUcastPkts.28 = Counter32: 0
IF-MIB::ifInDiscards.1 = Counter32: 0
IF-MIB::ifInDiscards.2 = Counter32: 0
IF-MIB::ifInDiscards.3 = Counter32: 0
IF-MIB::ifInDiscards.4 = Counter32: 0
IF-MIB::ifInDiscards.26 = Counter32: 0
IF-MIB::ifInDiscards.27 = Counter32: 0
IF-MIB::ifInDiscards.28 = Counter32: 0
IF-MIB::ifInErrors.1 = Counter32: 0
IF-MIB::ifInErrors.2 = Counter32: 0
IF-MIB::ifInErrors.3 = Counter32: 0
IF-MIB::ifInErrors.4 = Counter32: 0
IF-MIB::ifInErrors.26 = Counter32: 0
IF-MIB::ifInErrors.27 = Counter32: 0
IF-MIB::ifInErrors.28 = Counter32: 0
IF-MIB::ifInUnknownProtos.1 = Counter32: 0
IF-MIB::ifInUnknownProtos.2 = Counter32: 0
IF-MIB::ifInUnknownProtos.3 = Counter32: 0
IF-MIB::ifInUnknownProtos.4 = Counter32: 0
IF-MIB::ifInUnknownProtos.26 = Counter32: 0
IF-MIB::ifInUnknownProtos.27 = Counter32: 0
IF-MIB::ifInUnknownProtos.28 = Counter32: 0
IF-MIB::ifOutOctets.1 = Counter32: 7163
IF-MIB::ifOutOctets.2 = Counter32: 499739
IF-MIB::ifOutOctets.3 = Counter32: 38960
IF-MIB::ifOutOctets.4 = Counter32: 0
IF-MIB::ifOutOctets.26 = Counter32: 0
IF-MIB::ifOutOctets.27 = Counter32: 0
IF-MIB::ifOutOctets.28 = Counter32: 0
IF-MIB::ifOutUcastPkts.1 = Counter32: 58
IF-MIB::ifOutUcastPkts.2 = Counter32: 6094
IF-MIB::ifOutUcastPkts.3 = Counter32: 377
IF-MIB::ifOutUcastPkts.4 = Counter32: 0
IF-MIB::ifOutUcastPkts.26 = Counter32: 0
IF-MIB::ifOutUcastPkts.27 = Counter32: 0
IF-MIB::ifOutUcastPkts.28 = Counter32: 0
IF-MIB::ifOutNUcastPkts.1 = Counter32: 0
IF-MIB::ifOutNUcastPkts.2 = Counter32: 0
IF-MIB::ifOutNUcastPkts.3 = Counter32: 0
IF-MIB::ifOutNUcastPkts.4 = Counter32: 0
IF-MIB::ifOutNUcastPkts.26 = Counter32: 0
IF-MIB::ifOutNUcastPkts.27 = Counter32: 0
IF-MIB::ifOutNUcastPkts.28 = Counter32: 0
IF-MIB::ifOutDiscards.1 = Counter32: 0
IF-MIB::ifOutDiscards.2 = Counter32: 0
IF-MIB::ifOutDiscards.3 = Counter32: 0
IF-MIB::ifOutDiscards.4 = Counter32: 0
IF-MIB::ifOutDiscards.26 = Counter32: 0
IF-MIB::ifOutDiscards.27 = Counter32: 0
IF-MIB::ifOutDiscards.28 = Counter32: 0
IF-MIB::ifOutErrors.1 = Counter32: 0
IF-MIB::ifOutErrors.2 = Counter32: 0
IF-MIB::ifOutErrors.3 = Counter32: 0
IF-MIB::ifOutErrors.4 = Counter32: 0
IF-MIB::ifOutErrors.26 = Counter32: 0
IF-MIB::ifOutErrors.27 = Counter32: 0
IF-MIB::ifOutErrors.28 = Counter32: 0
IF-MIB::ifOutQLen.1 = Gauge32: 0
IF-MIB::ifOutQLen.2 = Gauge32: 0
IF-MIB::ifOutQLen.3 = Gauge32: 0
IF-MIB::ifOutQLen.4 = Gauge32: 0
IF-MIB::ifOutQLen.26 = Gauge32: 0
IF-MIB::ifOutQLen.27 = Gauge32: 0
IF-MIB::ifOutQLen.28 = Gauge32: 0
IF-MIB::ifSpecific.1 = OID: SNMPv2-SMI::zeroDotZero
IF-MIB::ifSpecific.2 = OID: SNMPv2-SMI::zeroDotZero
IF-MIB::ifSpecific.3 = OID: SNMPv2-SMI::zeroDotZero
IF-MIB::ifSpecific.4 = OID: SNMPv2-SMI::zeroDotZero
IF-MIB::ifSpecific.26 = OID: SNMPv2-SMI::zeroDotZero
IF-MIB::ifSpecific.27 = OID: SNMPv2-SMI::zeroDotZero
IF-MIB::ifSpecific.28 = OID: SNMPv2-SMI::zeroDotZero

Step 4: Run command service snmp walk remote-agent 10.0.0.1 v3 USER2TEST oid ifTable at DUT1 and check if output matches the following regular expressions:

::ifDescr\.1 = STRING: "?lo"?
Show output
IF-MIB::ifIndex.1 = INTEGER: 1
IF-MIB::ifIndex.2 = INTEGER: 2
IF-MIB::ifIndex.3 = INTEGER: 3
IF-MIB::ifIndex.4 = INTEGER: 4
IF-MIB::ifIndex.26 = INTEGER: 26
IF-MIB::ifIndex.27 = INTEGER: 27
IF-MIB::ifIndex.28 = INTEGER: 28
IF-MIB::ifDescr.1 = STRING: lo
IF-MIB::ifDescr.2 = STRING: Red Hat, Inc Device 0001
IF-MIB::ifDescr.3 = STRING: Red Hat, Inc Device 0001
IF-MIB::ifDescr.4 = STRING: ip_vti0
IF-MIB::ifDescr.26 = STRING: gre0
IF-MIB::ifDescr.27 = STRING: gretap0
IF-MIB::ifDescr.28 = STRING: erspan0
IF-MIB::ifType.1 = INTEGER: softwareLoopback(24)
IF-MIB::ifType.2 = INTEGER: ethernetCsmacd(6)
IF-MIB::ifType.3 = INTEGER: ethernetCsmacd(6)
IF-MIB::ifType.4 = INTEGER: tunnel(131)
IF-MIB::ifType.26 = INTEGER: tunnel(131)
IF-MIB::ifType.27 = INTEGER: ethernetCsmacd(6)
IF-MIB::ifType.28 = INTEGER: ethernetCsmacd(6)
IF-MIB::ifMtu.1 = INTEGER: 65536
IF-MIB::ifMtu.2 = INTEGER: 1500
IF-MIB::ifMtu.3 = INTEGER: 1500
IF-MIB::ifMtu.4 = INTEGER: 1480
IF-MIB::ifMtu.26 = INTEGER: 1476
IF-MIB::ifMtu.27 = INTEGER: 1462
IF-MIB::ifMtu.28 = INTEGER: 1450
IF-MIB::ifSpeed.1 = Gauge32: 10000000
IF-MIB::ifSpeed.2 = Gauge32: 0
IF-MIB::ifSpeed.3 = Gauge32: 0
IF-MIB::ifSpeed.4 = Gauge32: 0
IF-MIB::ifSpeed.26 = Gauge32: 0
IF-MIB::ifSpeed.27 = Gauge32: 0
IF-MIB::ifSpeed.28 = Gauge32: 0
IF-MIB::ifPhysAddress.1 = STRING:
IF-MIB::ifPhysAddress.2 = STRING: de:ad:be:ef:6c:10
IF-MIB::ifPhysAddress.3 = STRING: de:ad:be:ef:6c:11
IF-MIB::ifPhysAddress.4 = STRING:
IF-MIB::ifPhysAddress.26 = STRING:
IF-MIB::ifPhysAddress.27 = STRING:
IF-MIB::ifPhysAddress.28 = STRING:
IF-MIB::ifAdminStatus.1 = INTEGER: up(1)
IF-MIB::ifAdminStatus.2 = INTEGER: up(1)
IF-MIB::ifAdminStatus.3 = INTEGER: down(2)
IF-MIB::ifAdminStatus.4 = INTEGER: down(2)
IF-MIB::ifAdminStatus.26 = INTEGER: down(2)
IF-MIB::ifAdminStatus.27 = INTEGER: down(2)
IF-MIB::ifAdminStatus.28 = INTEGER: down(2)
IF-MIB::ifOperStatus.1 = INTEGER: up(1)
IF-MIB::ifOperStatus.2 = INTEGER: up(1)
IF-MIB::ifOperStatus.3 = INTEGER: down(2)
IF-MIB::ifOperStatus.4 = INTEGER: down(2)
IF-MIB::ifOperStatus.26 = INTEGER: down(2)
IF-MIB::ifOperStatus.27 = INTEGER: down(2)
IF-MIB::ifOperStatus.28 = INTEGER: down(2)
IF-MIB::ifLastChange.1 = Timeticks: (0) 0:00:00.00
IF-MIB::ifLastChange.2 = Timeticks: (0) 0:00:00.00
IF-MIB::ifLastChange.3 = Timeticks: (0) 0:00:00.00
IF-MIB::ifLastChange.4 = Timeticks: (0) 0:00:00.00
IF-MIB::ifLastChange.26 = Timeticks: (0) 0:00:00.00
IF-MIB::ifLastChange.27 = Timeticks: (0) 0:00:00.00
IF-MIB::ifLastChange.28 = Timeticks: (0) 0:00:00.00
IF-MIB::ifInOctets.1 = Counter32: 7163
IF-MIB::ifInOctets.2 = Counter32: 582306555
IF-MIB::ifInOctets.3 = Counter32: 25510
IF-MIB::ifInOctets.4 = Counter32: 0
IF-MIB::ifInOctets.26 = Counter32: 0
IF-MIB::ifInOctets.27 = Counter32: 0
IF-MIB::ifInOctets.28 = Counter32: 0
IF-MIB::ifInUcastPkts.1 = Counter32: 0
IF-MIB::ifInUcastPkts.2 = Counter32: 0
IF-MIB::ifInUcastPkts.3 = Counter32: 0
IF-MIB::ifInUcastPkts.4 = Counter32: 0
IF-MIB::ifInUcastPkts.26 = Counter32: 0
IF-MIB::ifInUcastPkts.27 = Counter32: 0
IF-MIB::ifInUcastPkts.28 = Counter32: 0
IF-MIB::ifInNUcastPkts.1 = Counter32: 0
IF-MIB::ifInNUcastPkts.2 = Counter32: 0
IF-MIB::ifInNUcastPkts.3 = Counter32: 0
IF-MIB::ifInNUcastPkts.4 = Counter32: 0
IF-MIB::ifInNUcastPkts.26 = Counter32: 0
IF-MIB::ifInNUcastPkts.27 = Counter32: 0
IF-MIB::ifInNUcastPkts.28 = Counter32: 0
IF-MIB::ifInDiscards.1 = Counter32: 0
IF-MIB::ifInDiscards.2 = Counter32: 0
IF-MIB::ifInDiscards.3 = Counter32: 0
IF-MIB::ifInDiscards.4 = Counter32: 0
IF-MIB::ifInDiscards.26 = Counter32: 0
IF-MIB::ifInDiscards.27 = Counter32: 0
IF-MIB::ifInDiscards.28 = Counter32: 0
IF-MIB::ifInErrors.1 = Counter32: 0
IF-MIB::ifInErrors.2 = Counter32: 0
IF-MIB::ifInErrors.3 = Counter32: 0
IF-MIB::ifInErrors.4 = Counter32: 0
IF-MIB::ifInErrors.26 = Counter32: 0
IF-MIB::ifInErrors.27 = Counter32: 0
IF-MIB::ifInErrors.28 = Counter32: 0
IF-MIB::ifInUnknownProtos.1 = Counter32: 0
IF-MIB::ifInUnknownProtos.2 = Counter32: 0
IF-MIB::ifInUnknownProtos.3 = Counter32: 0
IF-MIB::ifInUnknownProtos.4 = Counter32: 0
IF-MIB::ifInUnknownProtos.26 = Counter32: 0
IF-MIB::ifInUnknownProtos.27 = Counter32: 0
IF-MIB::ifInUnknownProtos.28 = Counter32: 0
IF-MIB::ifOutOctets.1 = Counter32: 7163
IF-MIB::ifOutOctets.2 = Counter32: 499739
IF-MIB::ifOutOctets.3 = Counter32: 38960
IF-MIB::ifOutOctets.4 = Counter32: 0
IF-MIB::ifOutOctets.26 = Counter32: 0
IF-MIB::ifOutOctets.27 = Counter32: 0
IF-MIB::ifOutOctets.28 = Counter32: 0
IF-MIB::ifOutUcastPkts.1 = Counter32: 58
IF-MIB::ifOutUcastPkts.2 = Counter32: 6094
IF-MIB::ifOutUcastPkts.3 = Counter32: 377
IF-MIB::ifOutUcastPkts.4 = Counter32: 0
IF-MIB::ifOutUcastPkts.26 = Counter32: 0
IF-MIB::ifOutUcastPkts.27 = Counter32: 0
IF-MIB::ifOutUcastPkts.28 = Counter32: 0
IF-MIB::ifOutNUcastPkts.1 = Counter32: 0
IF-MIB::ifOutNUcastPkts.2 = Counter32: 0
IF-MIB::ifOutNUcastPkts.3 = Counter32: 0
IF-MIB::ifOutNUcastPkts.4 = Counter32: 0
IF-MIB::ifOutNUcastPkts.26 = Counter32: 0
IF-MIB::ifOutNUcastPkts.27 = Counter32: 0
IF-MIB::ifOutNUcastPkts.28 = Counter32: 0
IF-MIB::ifOutDiscards.1 = Counter32: 0
IF-MIB::ifOutDiscards.2 = Counter32: 0
IF-MIB::ifOutDiscards.3 = Counter32: 0
IF-MIB::ifOutDiscards.4 = Counter32: 0
IF-MIB::ifOutDiscards.26 = Counter32: 0
IF-MIB::ifOutDiscards.27 = Counter32: 0
IF-MIB::ifOutDiscards.28 = Counter32: 0
IF-MIB::ifOutErrors.1 = Counter32: 0
IF-MIB::ifOutErrors.2 = Counter32: 0
IF-MIB::ifOutErrors.3 = Counter32: 0
IF-MIB::ifOutErrors.4 = Counter32: 0
IF-MIB::ifOutErrors.26 = Counter32: 0
IF-MIB::ifOutErrors.27 = Counter32: 0
IF-MIB::ifOutErrors.28 = Counter32: 0
IF-MIB::ifOutQLen.1 = Gauge32: 0
IF-MIB::ifOutQLen.2 = Gauge32: 0
IF-MIB::ifOutQLen.3 = Gauge32: 0
IF-MIB::ifOutQLen.4 = Gauge32: 0
IF-MIB::ifOutQLen.26 = Gauge32: 0
IF-MIB::ifOutQLen.27 = Gauge32: 0
IF-MIB::ifOutQLen.28 = Gauge32: 0
IF-MIB::ifSpecific.1 = OID: SNMPv2-SMI::zeroDotZero
IF-MIB::ifSpecific.2 = OID: SNMPv2-SMI::zeroDotZero
IF-MIB::ifSpecific.3 = OID: SNMPv2-SMI::zeroDotZero
IF-MIB::ifSpecific.4 = OID: SNMPv2-SMI::zeroDotZero
IF-MIB::ifSpecific.26 = OID: SNMPv2-SMI::zeroDotZero
IF-MIB::ifSpecific.27 = OID: SNMPv2-SMI::zeroDotZero
IF-MIB::ifSpecific.28 = OID: SNMPv2-SMI::zeroDotZero

Step 5: Run command service snmp table local-agent v3 USER2TEST oid ifTable at DUT0 and check if output matches the following regular expressions:

SNMP table:.*::ifTable
Show output
SNMP table: IF-MIB::ifTable

 ifIndex                  ifDescr           ifType ifMtu  ifSpeed     ifPhysAddress ifAdminStatus
       1                       lo softwareLoopback 65536 10000000                              up
       2 Red Hat, Inc Device 0001   ethernetCsmacd  1500        0 de:ad:be:ef:6c:10            up
       3 Red Hat, Inc Device 0001   ethernetCsmacd  1500        0 de:ad:be:ef:6c:11          down
       4                  ip_vti0           tunnel  1480        0                            down
      26                     gre0           tunnel  1476        0                            down
      27                  gretap0   ethernetCsmacd  1462        0                            down
      28                  erspan0   ethernetCsmacd  1450        0                            down

SNMP table IF-MIB::ifTable, part 2

 ifOperStatus ifLastChange ifInOctets ifInUcastPkts ifInNUcastPkts ifInDiscards ifInErrors
           up 0:0:00:00.00       7163             0              0            0          0
           up 0:0:00:00.00  582306555             0              0            0          0
         down 0:0:00:00.00      25510             0              0            0          0
         down 0:0:00:00.00          0             0              0            0          0
         down 0:0:00:00.00          0             0              0            0          0
         down 0:0:00:00.00          0             0              0            0          0
         down 0:0:00:00.00          0             0              0            0          0

SNMP table IF-MIB::ifTable, part 3

 ifInUnknownProtos ifOutOctets ifOutUcastPkts ifOutNUcastPkts ifOutDiscards ifOutErrors ifOutQLen
                 0        7163             58               0             0           0         0
                 0      499739           6094               0             0           0         0
                 0       38960            377               0             0           0         0
                 0           0              0               0             0           0         0
                 0           0              0               0             0           0         0
                 0           0              0               0             0           0         0
                 0           0              0               0             0           0         0

SNMP table IF-MIB::ifTable, part 4

              ifSpecific
 SNMPv2-SMI::zeroDotZero
 SNMPv2-SMI::zeroDotZero
 SNMPv2-SMI::zeroDotZero
 SNMPv2-SMI::zeroDotZero
 SNMPv2-SMI::zeroDotZero
 SNMPv2-SMI::zeroDotZero
 SNMPv2-SMI::zeroDotZero

Step 6: Run command service snmp table remote-agent 10.0.0.1 v3 USER2TEST oid ifTable at DUT1 and check if output matches the following regular expressions:

SNMP table:.*::ifTable
Show output
SNMP table: IF-MIB::ifTable

 ifIndex                  ifDescr           ifType ifMtu  ifSpeed     ifPhysAddress ifAdminStatus
       1                       lo softwareLoopback 65536 10000000                              up
       2 Red Hat, Inc Device 0001   ethernetCsmacd  1500        0 de:ad:be:ef:6c:10            up
       3 Red Hat, Inc Device 0001   ethernetCsmacd  1500        0 de:ad:be:ef:6c:11          down
       4                  ip_vti0           tunnel  1480        0                            down
      26                     gre0           tunnel  1476        0                            down
      27                  gretap0   ethernetCsmacd  1462        0                            down
      28                  erspan0   ethernetCsmacd  1450        0                            down

SNMP table IF-MIB::ifTable, part 2

 ifOperStatus ifLastChange ifInOctets ifInUcastPkts ifInNUcastPkts ifInDiscards ifInErrors
           up 0:0:00:00.00       7163             0              0            0          0
           up 0:0:00:00.00  582306555             0              0            0          0
         down 0:0:00:00.00      25510             0              0            0          0
         down 0:0:00:00.00          0             0              0            0          0
         down 0:0:00:00.00          0             0              0            0          0
         down 0:0:00:00.00          0             0              0            0          0
         down 0:0:00:00.00          0             0              0            0          0

SNMP table IF-MIB::ifTable, part 3

 ifInUnknownProtos ifOutOctets ifOutUcastPkts ifOutNUcastPkts ifOutDiscards ifOutErrors ifOutQLen
                 0        7163             58               0             0           0         0
                 0      499739           6094               0             0           0         0
                 0       38960            377               0             0           0         0
                 0           0              0               0             0           0         0
                 0           0              0               0             0           0         0
                 0           0              0               0             0           0         0
                 0           0              0               0             0           0         0

SNMP table IF-MIB::ifTable, part 4

              ifSpecific
 SNMPv2-SMI::zeroDotZero
 SNMPv2-SMI::zeroDotZero
 SNMPv2-SMI::zeroDotZero
 SNMPv2-SMI::zeroDotZero
 SNMPv2-SMI::zeroDotZero
 SNMPv2-SMI::zeroDotZero
 SNMPv2-SMI::zeroDotZero

Note

After adding a view that excludes the ‘1.3.6.1.2.1.2‘ oid, retrieving information about interfaces shouldn’t be allowed.

Step 7: Set the following configuration in DUT0:

set service snmp user USER2TEST view NOIFCS
set service snmp view NOIFCS oid 1.3.6.1.2.1.2 type excluded

Step 8: Run command service snmp walk local-agent v3 USER2TEST oid ifTable at DUT0 and check if output does not match the following regular expressions:

::ifDescr\.1 = STRING: "?lo"?
Show output
IF-MIB::ifTable = No more variables left in this MIB View (It is past the end of the MIB tree)

Step 9: Run command service snmp walk remote-agent 10.0.0.1 v3 USER2TEST oid ifTable at DUT1 and check if output does not match the following regular expressions:

::ifDescr\.1 = STRING: "?lo"?
Show output
IF-MIB::ifTable = No more variables left in this MIB View (It is past the end of the MIB tree)

Step 10: Run command service snmp table local-agent v3 USER2TEST oid ifTable at DUT0 and check if output does not match the following regular expressions:

SNMP table:.*::ifTable
Show output
IF-MIB::ifTable: No entries

Step 11: Run command service snmp table remote-agent 10.0.0.1 v3 USER2TEST oid ifTable at DUT1 and check if output does not match the following regular expressions:

SNMP table:.*::ifTable
Show output
IF-MIB::ifTable: No entries