SNMP configuration examples

Last Updated : Jan 04, 2017 |

The following example enables link up/down traps on an Ethernet interface:

Gxxx-001(super)# interface fastethernet 10/3
Gxxx-001(super-if:FastEthernet 10/3)# snmp trap link-status
Done!

The following example displays SNMP information:

Gxxx-001(super)# show snmp
Authentication trap disabled
Community-Access     Community-String
----------------     ----------------
read-only            *****
read-write           *****
SNMPv3 Notification Status
----------------------------
Traps: Enabled
Informs: Enabled         Retries: 3   Timeout: 3 seconds
SNMP-Rec-Address Model  Level   Notification   Trap/Inform   User name
---------------- -----  ------   ------------   -----------  ----------
149.49.70.137     v1     noauth   all               trap       ReadCommN
 UDP port: 162 DM

The following example disables Link Up and Link Down traps on an Ethernet interface:

Gxxx-001(super-if:FastEthernet 10/3)# no snmp trap link-status
Enter authentication password   : ********
Confirm authentication password : ********
Enter privacy password   : *********
Confirm privacy password : *********
Done!

The following example creates a read-only user:

Gxxx-001# snmp-server user joseph ReadOnlyG v3 auth md5 priv des56 ktamatan
Enter authentication password   : ********
Confirm authentication password : ********
Enter privacy password   : *********
Confirm privacy password : *********
Done!

The following example creates a read-write user:

Gxxx-001# snmp-server user johnny ReadWriteG v3 auth md5 priv des56 ktamatan
Enter authentication password   : ********
Confirm authentication password : ********
Enter privacy password   : *********
Confirm privacy password : *********
Done!

The following example creates an admin user:

Gxxx-001# snmp-server user johnny v3AdminG v3 auth md5 priv des56 ktamatan
Enter authentication password   : ********
Confirm authentication password : ********
Enter privacy password   : *********
Confirm privacy password : *********
Done!

The following example sets the SNMPv1 read-only community:

Gxxx-001(super)# set snmp community read-only read
SNMP read-only community string set.

The following example sets the SNMPv1 read-write community:

Gxxx-001(super)# set snmp community read-write write
SNMP read-write community string set.

The following example enables link up/down trap on a LAN port on the G250:

G250-001(super)# set port trap 10/3 enable
Port 10/3 up/down trap enabled

The following example enables Link Up and Link Down traps on a LAN port on the Branch Gateway:

Gxxx-001(super)# set port trap 10/5 enable
Port 10/5 up/down trap enabled

The following example disables link up/down trap on a LAN port on the G250:

G250-001(super)# set port trap 10/4 disable
Port 10/4 up/down trap disabled

The following example disables Link Up and Link Down traps on a LAN port on the Branch Gateway:

Gxxx-001(super)# set port trap 10/5 disable
Port 10/5 up/down trap disabled