Cisco IOS: switch configuration – limiting bandwidth and enabling SNMP

Here’s a couple more mini-guides to Cisco IOS configuration, this time round for the switches. As always, these are just tips for my own reference and sharing to the general community.

#1 How would you limit the bandwidth on a switch port?

Edit: this configuration doesn’t seem to be that simple, because it’s not working very well on my 3560 now. I’ll put up another post specifically for 3560 QoS soon as I finish reading the Cisco tech note.

Edit #2: It turns out everything works as stated, except for the minor fact that the command slows your interface down.

Go into interface configuration mode, on the port you are making changes on.

switch(config-if)#srr-queue bandwidth ?
limit Configure bandwidth-limit for this interface
shape Configure shaping on transmit queues
share Configure shared bandwidth

These is what the IOS help is showing; you can see that there are more options than merely limiting the bandwidth.

switch(config-if)#srr-queue bandwidth limit ?
<10-90> enter bandwidth limit for interface as percentage

The percentage value range that should be entered, ranging from 10 to 90. The default is 100.

Therefore, a workaround to limit the switch port’s speed to 5mbps would be to do the following instead:

switch(config-if)#speed 10

switch(config-if)#srr-queue bandwidth limit 50

*Remember that this will slow your interface down, as it’s reduced from a 100mbps interface to a 10mbps interface instead.

#2 How would you enable SNMP on a switch (or router)?

Go into configuration mode.

switch(config)#snmp-server ?
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
enable Enable SNMP Traps or Informs
engineID Configure a local or remote SNMPv3 engineID
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
queue-length Message queue length for each TRAP host
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 SNMPv2 MIB view

As you can see, SNMP has a bucketful of options so we would delve too deep here; the keyword we’re interested in is community.

switch(config)#snmp-server community ?
WORD SNMP community string

We’re supposed to enter the community string here, the basic workings of SNMP will not be reiterated here.

switch(config)#snmp-server community TESTread ?
<1-99> Std IP accesslist allowing access with this community string
<1300-1999> Expanded IP accesslist allowing access with this community string
WORD Access-list name
ro Read-only access with this community string
rw Read-write access with this community string
view Restrict this community to a named MIB view

You can see that there are ways to limit access to your community string here, as well as read/write privileges.

For the quick fix answer, here’s an easy default configuration.

switch(config)#snmp-server community TESTread ro

SNMP community string TESTread, and read-only (ro) privileges.

Additional tidbits in configuration optional SNMP information on the device:

switch(config)# snmp-server contact Kein Engineer 1234-1234-1234
switch(config)# snmp-server location Melbourne
switch(config)# snmp-server chassis-id Cisco3500-SW

Any other interesting need-to-know commands you’d like to share?

One thought on “Cisco IOS: switch configuration – limiting bandwidth and enabling SNMP

Have your say!