SNMP-Simple Network Management Protocol is used to provide management capability for TCP/IP based networks. There are three versions (v1, v2, v3) & only version 3 added the security capability to this protocol. If you are using this SNMP to manage & configure your network devices, it is better to use SNMPv3 which provide authentication & encryption capability to this protocol. You can read RFC3411- An Architecture for Describing SNMP Management Frameworks if your are interested in more details about this protocol.
There are 3 level of security you can provide to any SNMPv3 messages.
noAuthNoPriv – without authentication and without privacy,
authNoPriv – with authentication but without privacy,
authPriv – with authentication and with privacy.
In this post we will see how to configure SNMPv3 on a Cisco IOS device (5760,3850, Autonomous AP) & a Cisco WLC (5508) in order to manage via Prime Infrastructure as Network Management System(NMS).
In any IOS devices it is very simple two step process
1. Configure a SNMP group
2. Configure a SNMP user
Let’s configure this on a 3850 switch. First we will create a snmp group (called SNMP-GRP) with “authPriv” secuirity level. If you want you can associate an ACL to restrict which NMS host can be part of this group. But in this example I have used without that to make it simpler.
3850-3(config)#snmp-server ?
accounting SNMP Accounting parameters
cache Enable SNMP cache
chassis-id String to uniquely identify this chassis
community Enable SNMP; set community string and access privs
contact Text for mib object sysContact
context Create/Delete a context apart from default
drop Silently drop SNMP packets
enable Enable SNMP Traps
engineID Configure a local or remote SNMPv3 engineID
file-transfer File transfer related commands
group Define a User Security Model group
host Specify hosts to receive SNMP notifications
ifindex Enable ifindex persistence
inform Configure SNMP Informs options
ip IP ToS configuration for SNMP traffic
location Text for mib object sysLocation
manager Modify SNMP manager parameters
packetsize Largest SNMP packet size
password-policy SNMP v3 users password policy
queue-length Message queue length for each TRAP host
source-interface Assign an source interface
spi Configs for SNMP communication using SPI
sysobjectid sysObjectID
system-shutdown Enable use of the SNMP reload command
tftp-server-list Limit TFTP servers used via SNMP
trap SNMP trap options
trap-source Assign an interface for the source address of all traps
trap-timeout Set timeout for TRAP message retransmissions
user Define a user who can access the SNMP engine
view Define an SNMPv3 MIB view
3850-3(config)#snmp-server group ?
WORD Name of the group
3850-3(config)#snmp-server group SNMP-GRP ?
v1 group using the v1 security model
v2c group using the v2c security model
v3 group using the User Security Model (SNMPv3)
3850-3(config)#snmp-server group SNMP-GRP v3 ?
auth group using the authNoPriv Security Level
noauth group using the noAuthNoPriv Security Level
priv group using SNMPv3 authPriv security level
3850-3(config)#snmp-server group SNMP-GRP v3 priv ?
access specify an access-list associated with this group
context specify a context to associate these views for the group
match context name match criteria
notify specify a notify view for the group
read specify a read view for the group
write specify a write view for the group
<cr>
3850-3(config)#snmp-server group SNMP-GRP v3 priv
Now let’s define a SNMP user for this group with required Authentication & Encryption parameters. As you can see below 3850 supports 128,192, 256 bit AES encryption & you can choose any. I have chosen 128bit as that’s what Prime Infrastructure is supported. I have used “HMAC-SHA” over “HMAC-MD5” since it is more secure.
3850-3(config)#snmp-server user ? WORD Name of the user 3850-3(config)#snmp-server user prime2 ? WORD Group to which the user belongs 3850-3(config)#snmp-server user prime2 SNMP-GRP ? remote Specify a remote SNMP entity to which the user belongs v1 user using the v1 security model v2c user using the v2c security model v3 user using the v3 security model 3850-3(config)#snmp-server user prime2 SNMP-GRP v3 ? access specify an access-list associated with this group auth authentication parameters for the user encrypted specifying passwords as MD5 or SHA digests <cr> 3850-3(config)#snmp-server user prime2 SNMP-GRP v3 au 3850-3(config)#snmp-server user prime2 SNMP-GRP v3 auth ? md5 Use HMAC MD5 algorithm for authentication sha Use HMAC SHA algorithm for authentication 3850-3(config)#snmp-server user prime2 SNMP-GRP v3 auth sh 3850-3(config)#snmp-server user prime2 SNMP-GRP v3 auth sha ? WORD authentication pasword for user 3850-3(config)#snmp-server user prime2 SNMP-GRP v3 auth sha <AUTH_PASSWORD> ? access specify an access-list associated with this group priv encryption parameters for the user <cr> 3850-3(config)#snmp-server user prime2 SNMP-GRP v3 auth sha <AUTH_PASSWORD> priv ? 3des Use 168 bit 3DES algorithm for encryption aes Use AES algorithm for encryption des Use 56 bit DES algorithm for encryption 3850-3(config)#snmp-server user prime2 SNMP-GRP v3 auth sha <AUTH_PASSWORD> priv aes ? 128 Use 128 bit AES algorithm for encryption 192 Use 192 bit AES algorithm for encryption 256 Use 256 bit AES algorithm for encryption 3850-3(config)#snmp-server user prime2 SNMP-GRP v3 auth sha <AUTH_PASSWORD> priv aes 128 ? WORD privacy pasword for user 3850-3(config)#snmp-server user prime2 SNMP-GRP v3 auth sha <AUTH_PASSWORD> priv aes 128 <PRIVACY_PASSWORD> ? access specify an access-list associated with this group <cr> 3850-3(config)#snmp-server user prime2 SNMP-GRP v3 auth sha <AUTH_PASSWORD> priv aes 128 <PRIVACY_PASSWORD>
Now if you go to Prime Infrastructure (PI), you can add this switch with the configured SNMPv3 details. To fully manage the switch PI need to access the switch via CLI (ssh/telent), so better to configure CLI credential as well for that purpose.
Note, that when you add a 3850/3650 switch to Prime it will automatically treated it as a WLC as well (since those switches has integrated WLC within the switch). So same 3850 appear under Controllers & Switches section.
Let’s configure this on 5760 controller. Since it is IOS device, you have to simply add those two lines.
5760-1(config)#snmp-server group SNMP-GRP v3 priv 5760-1(config)#snmp-server user prime2 SNMP-GRP v3 auth sha <AUTH_PASSWORD> priv aes 128 <PRIVACY_PASSWORD>
You can verify your configuration using “show snmp-server group” & “show snmp-server user” outputs as shown below.
5760-1#show snmp group groupname: SNMP-GRP security model:v3 priv contextname: <no context specified> storage-type: nonvolatile readview : v1default writeview: <no writeview specified> notifyview: <no notifyview specified> row status: active 5760-1#show snmp user User name: prime2 Engine ID: 80000009030044ADD9039D00 storage-type: nonvolatile active Authentication Protocol: SHA Privacy Protocol: AES128 Group-name: SNMP-GRP
Let’s see same configuration on Autonomous Access point (again IOS device). So there is no difference, only those two lines required. But some time depend on the AP hardware & IOS version you running on the AP, all these encryption may not supported. For example 1252 with 15.2 support AES encryption where as 1131 running on 12.4 version only support DES for SNMP encryption.
AAP1(config)#do sh ver | in IOS Cisco IOS Software, C1250 Software (C1250-K9W7-M), Version 15.2(2)JA1, RELEASE SOFTWARE (fc1) AAP1(config)#snmp-server group SNMP-GRP v3 priv AAP1(config)#snmp-server user prime2 SNMP-GRP v3 auth sha <AUTH_PASSWORD> priv aes 128 <PRIVACY_PASSWORD> AAP2#sh ver | in IOS Cisco IOS Software, C1130 Software (C1130-K9W7-M), Version 12.4(21a)JY, RELEASE SOFTWARE (fc1) AAP2(config)#snmp-server group SNMP-GRP v3 priv AAP2(config)#snmp-server user prime2 SNMP-GRP v3 auth sha <AUTH_PASSWORD> priv ? des56 Use 56 bit DES algorithm for encryption AAP2(config)#snmp-server user prime2 SNMP-GRP v3 auth sha <AUTH_PASSWORD> priv des56 <PRIVACY_PASSWORD>
Now let’s see how we can configure SNMPv3 on a 5508 (run on AireOS). Since it is not IOS command syntax is different, but again it is one simple config line. I have not shown the GUI method here, but if you are more comfortable with that you can do it in that way too.
(5508-1) >config snmp v3user create ? <username> Enter user name for a v3 user. (5508-1) >config snmp v3user create prime2 ? ro Read-only mode. rw Read-write mode. (5508-1) >config snmp v3user create prime2 rw ? none Disable authentication protocol for a SNMP v3 user. hmacmd5 Set the SNMP v3 user authentication type to HMACMD5. hmacsha Set the SNMP v3 user authentication type to HMACSHA. (5508-1) >config snmp v3user create prime2 rw hmacsha ? none Disables encryption type for SNMP v3 user. aescfb128 Set the SNMP v3 user encryption type to AES. des Set the SNMP v3 user encryption type to DES. (5508-1) >config snmp v3user create prime2 rw hmacsha aescfb128 ? <authkey> Enter authentication key for authtype hmacmd5/hmacsha for a v3 user. (5508-1) >config snmp v3user create prime2 rw hmacsha aescfb128 <AUTH_PASSWORD> ? <encrypkey> Enter encryption key for for des encryption for a v3 user. (5508-1) >config snmp v3user create prime2 rw hmacsha aescfb128 <AUTH_PASSWORD> <PRIVACY_PASSWORD>
You can verify “show snmpversion” & “show snmpv3user” CLI commands. There is default SNMPv3 user called “default” & you can delete that using “config snmp v3user delete default” if needed. In the below I have deleted that user.
(5508-1) >show snmpversion SNMP v1 Mode.................................... Disable SNMP v2c Mode.................................... Enable SNMP v3 Mode.................................... Enable (5508-1) >show snmpv3user SNMP v3 User Name AccessMode Authentication Encryption -------------------- ----------- -------------- ---------- prime2 Read/Write HMAC-SHA CFB-AES
In this way you can make sure Prime Infrastructure to your managed devices communicate in secure fashion (SNMPv3). Here is a sample PI dashboard showing this managed devices.
Here is a quick reference link from Cisco if you want to configure & verify SNMPv3 on Cisco devices.
Hi. How can i do in order to see my 3850 like a Switch instead a WLC? I need configure seetings in the interfaces and with this mode i can´t.
Thanks in advance
Unless you configure “wireless management interface vlan x” command on your switch, Prime should not detect 3850 as a WLC
HTH
Rasika
! Last configuration change at 11:17:56 UTC Tue Nov 25 2014 by cisco1
!
Hi, i do not use that command, please can you check my configuration? The stack have XE 03.03.01 with ipservices permanent license
version 15.0
no service pad
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
service compress-config
!
hostname Switch_10G
!
boot-start-marker
boot-end-marker
!
!
vrf definition Mgmt-vrf
!
address-family ipv4
exit-address-family
!
address-family ipv6
exit-address-family
!
enable password cisco
!
username admin privilege 15 password 0 Cisco123
aaa new-model
!
!
aaa authentication login default group radius local
aaa authorization exec default group radius local
!
aaa session-id common
switch 1 provision ws-c3850-48t
switch 2 provision ws-c3850-48t
!
ip device tracking
!
diagnostic bootup level minimal
spanning-tree mode pvst
spanning-tree extend system-id
!
redundancy
mode sso
!
!
ip ssh time-out 30
ip ssh authentication-retries 5
ip ssh version 2
!
class-map match-any non-client-nrt-class
match non-client-nrt
!
policy-map port_child_policy
class non-client-nrt-class
bandwidth remaining ratio 10
!
interface GigabitEthernet0/0
vrf forwarding Mgmt-vrf
no ip address
negotiation auto
!
interface Vlan1
no ip address
shutdown
!
interface Vlan3
ip address 172.16.80.124 255.255.255.240
!
ip http server
ip http authentication local
ip http secure-server
!
snmp-server community public RW
snmp-server enable traps snmp authentication linkdown linkup coldstart warmstart
snmp-server enable traps flowmon
snmp-server enable traps transceiver all
snmp-server enable traps call-home message-send-fail server-fail
snmp-server enable traps rf
snmp-server enable traps memory
snmp-server enable traps cpu threshold
snmp-server enable traps wireless bsnMobileStation bsnAccessPoint bsnRogue bsn80211Security bsnAutoRF bsnGeneral client mobility RRM mfp AP rogue
snmp-server enable traps tty
snmp-server enable traps eigrp
snmp-server enable traps ospf state-change
snmp-server enable traps ospf errors
snmp-server enable traps ospf retransmit
snmp-server enable traps ospf lsa
snmp-server enable traps ospf cisco-specific state-change nssa-trans-change
snmp-server enable traps ospf cisco-specific state-change shamlink interface
snmp-server enable traps ospf cisco-specific state-change shamlink neighbor
snmp-server enable traps ospf cisco-specific errors
snmp-server enable traps ospf cisco-specific retransmit
snmp-server enable traps ospf cisco-specific lsa
snmp-server enable traps auth-framework sec-violation
snmp-server enable traps flash insertion removal
snmp-server enable traps power-ethernet police
snmp-server enable traps vtp
snmp-server enable traps vlancreate
snmp-server enable traps vlandelete
snmp-server enable traps license
snmp-server enable traps envmon fan shutdown supply temperature status
snmp-server enable traps stackwise
snmp-server enable traps port-security
snmp-server enable traps fru-ctrl
snmp-server enable traps entity
snmp-server enable traps trustsec-sxp conn-srcaddr-err msg-parse-err conn-config-err binding-err conn-up conn-down binding-expn-fail oper-nodeid-change binding-conflict
snmp-server enable traps trustsec-server radius-server provision-secret
snmp-server enable traps trustsec authz-file-error cache-file-error keystore-file-error keystore-sync-fail random-number-fail src-entropy-fail
snmp-server enable traps trustsec-interface unauthorized sap-fail authc-fail supplicant-fail authz-fail
snmp-server enable traps cef resource-failure peer-state-change peer-fib-state-change inconsistency
snmp-server enable traps config-copy
snmp-server enable traps config
snmp-server enable traps config-ctid
snmp-server enable traps event-manager
snmp-server enable traps hsrp
snmp-server enable traps ipmulticast
snmp-server enable traps pim neighbor-change rp-mapping-change invalid-pim-message
snmp-server enable traps vstack
snmp-server enable traps bridge newroot topologychange
snmp-server enable traps stpx inconsistency root-inconsistency loop-inconsistency
snmp-server enable traps syslog
snmp-server enable traps ipsla
snmp-server enable traps errdisable
snmp-server enable traps mac-notification change move threshold
snmp-server enable traps vlan-membership
snmp-server enable traps bulkstat collection transfer
snmp-server enable traps vrfmib vrf-up vrf-down vnet-trunk-up vnet-trunk-down
snmp-server host 172.16.80.126 version 2c public
!
line con 0
password cisco
stopbits 1
line aux 0
stopbits 1
line vty 0 4
password cisco
logging synchronous
transport input ssh
line vty 5 15
password cisco
!
wsma agent exec
profile httplistener
profile httpslistener
wsma agent config
profile httplistener
profile httpslistener
wsma agent filesys
profile httplistener
profile httpslistener
wsma agent notify
profile httplistener
profile httpslistener
!
wsma profile listener httplistener
transport http
!
wsma profile listener httpslistener
transport https
wireless mobility controller
ap group default-group
end
Get rid of wireless mobility controller line
It gives an SNMP Operation failed error message though Prime 1.4 when i am push SSID thru Prime. however i am able to push other templates /config.
Hi, i did that but i can not see like i Switch =(. Is possible to send you the print paint of mi Prime. I have not more any ideas for this demo. Thanks in advance
Switch_10G#sh run
Building configuration…
Current configuration : 10784 bytes
!
! Last configuration change at 05:58:50 UTC Wed Nov 26 2014
!
version 15.0
no service pad
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
service compress-config
!
hostname Switch_10G
!
boot-start-marker
boot-end-marker
!
!
vrf definition Mgmt-vrf
!
address-family ipv4
exit-address-family
!
address-family ipv6
exit-address-family
!
enable password cisco
!
username admin privilege 15 password 0 Cisco123
aaa new-model
!
!
aaa authentication login default group radius local
aaa authorization exec default group radius local
!
!
!
!
!
!
aaa session-id common
switch 1 provision ws-c3850-48t
switch 2 provision ws-c3850-48t
!
ip device tracking
!
!
!
crypto pki trustpoint TP-self-signed-4136564753
enrollment selfsigned
subject-name cn=IOS-Self-Signed-Certificate-4136564753
revocation-check none
rsakeypair TP-self-signed-4136564753
!
!
!
diagnostic bootup level minimal
spanning-tree mode pvst
spanning-tree extend system-id
!
redundancy
mode sso
!
!
ip ssh time-out 30
ip ssh authentication-retries 5
ip ssh version 2
!
class-map match-any non-client-nrt-class
match non-client-nrt
!
policy-map port_child_policy
class non-client-nrt-class
bandwidth remaining ratio 10
!
!
!
!
!
!
interface GigabitEthernet0/0
vrf forwarding Mgmt-vrf
no ip address
negotiation auto
!
interface GigabitEthernet1/0/1
switchport access vlan 3
switchport mode access
!
interface GigabitEthernet1/0/2
switchport access vlan 3
switchport mode access
!
interface GigabitEthernet1/0/3
switchport access vlan 3
switchport mode access
!
interface GigabitEthernet1/0/4
switchport access vlan 3
switchport mode access
!
interface Vlan1
no ip address
shutdown
!
interface Vlan3
ip address 172.16.80.124 255.255.255.240
!
ip http server
ip http authentication local
ip http secure-server
!
!
!
!
snmp-server community public RW
snmp-server enable traps snmp authentication linkdown linkup coldstart warmstart
snmp-server enable traps flowmon
snmp-server enable traps transceiver all
snmp-server enable traps call-home message-send-fail server-fail
snmp-server enable traps rf
snmp-server enable traps memory
snmp-server enable traps cpu threshold
snmp-server enable traps wireless bsnMobileStation bsnAccessPoint bsnRogue bsn80211Security bsnAutoRF bsnGeneral client mobility RRM mfp AP rogue
snmp-server enable traps tty
snmp-server enable traps eigrp
snmp-server enable traps ospf state-change
snmp-server enable traps ospf errors
snmp-server enable traps ospf retransmit
snmp-server enable traps ospf lsa
snmp-server enable traps ospf cisco-specific state-change nssa-trans-change
snmp-server enable traps ospf cisco-specific state-change shamlink interface
snmp-server enable traps ospf cisco-specific state-change shamlink neighbor
snmp-server enable traps ospf cisco-specific errors
snmp-server enable traps ospf cisco-specific retransmit
snmp-server enable traps ospf cisco-specific lsa
snmp-server enable traps auth-framework sec-violation
snmp-server enable traps flash insertion removal
snmp-server enable traps power-ethernet police
snmp-server enable traps vtp
snmp-server enable traps vlancreate
snmp-server enable traps vlandelete
snmp-server enable traps license
snmp-server enable traps envmon fan shutdown supply temperature status
snmp-server enable traps stackwise
snmp-server enable traps port-security
snmp-server enable traps fru-ctrl
snmp-server enable traps entity
snmp-server enable traps trustsec-sxp conn-srcaddr-err msg-parse-err conn-config-err binding-err conn-up conn-down binding-expn-fail oper-nodeid-change binding-conflict
snmp-server enable traps trustsec-server radius-server provision-secret
snmp-server enable traps trustsec authz-file-error cache-file-error keystore-file-error keystore-sync-fail random-number-fail src-entropy-fail
snmp-server enable traps trustsec-interface unauthorized sap-fail authc-fail supplicant-fail authz-fail
snmp-server enable traps cef resource-failure peer-state-change peer-fib-state-change inconsistency
snmp-server enable traps config-copy
snmp-server enable traps config
snmp-server enable traps config-ctid
snmp-server enable traps event-manager
snmp-server enable traps hsrp
snmp-server enable traps ipmulticast
snmp-server enable traps pim neighbor-change rp-mapping-change invalid-pim-message
snmp-server enable traps vstack
snmp-server enable traps bridge newroot topologychange
snmp-server enable traps stpx inconsistency root-inconsistency loop-inconsistency
snmp-server enable traps syslog
snmp-server enable traps ipsla
snmp-server enable traps errdisable
snmp-server enable traps mac-notification change move threshold
snmp-server enable traps vlan-membership
snmp-server enable traps bulkstat collection transfer
snmp-server enable traps vrfmib vrf-up vrf-down vnet-trunk-up vnet-trunk-down
snmp-server host 10.96.252.246 public
snmp-server host 172.16.80.126 version 2c public
!
radius-server attribute 8 include-in-access-req
radius-server host 172.16.80.118 auth-port 1812 acct-port 8013 key laboratorio
radius-server key laboratorio
!
!
!
!
line con 0
password cisco
stopbits 1
line aux 0
stopbits 1
line vty 0 4
password cisco
logging synchronous
transport input ssh
line vty 5 15
password cisco
!
wsma agent exec
profile httplistener
profile httpslistener
wsma agent config
profile httplistener
profile httpslistener
wsma agent filesys
profile httplistener
profile httpslistener
wsma agent notify
profile httplistener
profile httpslistener
!
wsma profile listener httplistener
transport http
!
wsma profile listener httpslistener
transport https
ap group default-group
end
hi rasika
how can i change snmp trap destination for MSE ver. 8
and why trap required snmp configuration ??
also , while even i tried to configured it in ver 3 there ( community string ) required to configure also ,, it confused me
Hello Rasika
I had been trying to configure this scenario using an AP 1600i in autonomous mode and prime in version 2.1, but I cant do it , I did all the steps in your blog but didn´t work.
Please, help me with this if maybe I missed something, I will appreciate it .
Did you try it with different codes of AP ? If not I would try that first.
Rasika
I have a question regarding Cisco Prime I hope you can answer. If I create and deploy a template (in my task a WLAN Template), I take it this does not save to NVRAM by default? If not, do I need to either run another CLI template with this command or save directly on device?
I am using prime 3.x to manage my lan switches using your SNMPv3 setup and it works …. but i am constantly getting ” %SNMP-3-AUTHFAIL: Authentication failure for SNMP req from host x.x.x.x” ?? Do you know why this would be ?
also when i run the command ” show snmp ” i get a lot of Unknown community names but i am only using v3 ?