[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now


which is best PORT config for CISCO switches

Posted on 2015-02-13
Medium Priority
Last Modified: 2016-06-13
Hi Experts,

I have a simple question for you.
can you show me the best recommend settings for a cisco switch port ?
I use 2960X and 3650X

There are so many parameters around.
Maybe you can show me the different settings with a short info.
Question by:Eprs_Admin
  • 4
  • 2
  • 2

Author Comment

ID: 40607568
What about this setup for my ports ?

 switchport mode access
 switchport port-security
 switchport port-security aging time 2
 switchport port-security violation restrict
 switchport port-security aging type inactivity
 macro description cisco-desktop
 spanning-tree portfast
 spanning-tree bpduguard enable

Open in new window

LVL 50

Expert Comment

by:Don Johnston
ID: 40607815
That's like asking "What Cisco switch do I need?"  There's just too many variables to be able to answer the question.

I see in your post you're showing port security.  Does that mean the devices in your network never move to other ports?  If so, then port security may be a good thing to have.

Can you provide some information on the environment?  Are there phones connected to the switch? Is QOS required?  What's the security environment?
LVL 18

Accepted Solution

Akinsd earned 1000 total points
ID: 40607965
I agree with Don. There's just too many variables depending on the options you want. Depending on IOS version, you can have more or less options as shown below

  arp                          Set arp type (arpa, probe, snap) or timeout
  bandwidth              Set bandwidth informational parameter
  cdp                           Global CDP configuration subcommands
  channel-group        Etherchannel/port bundling configuration
  channel-protocol   Select the channel protocol (LACP, PAgP)
  delay                        Specify interface throughput delay
  description             Interface specific description
  duplex                     Configure duplex operation.
  exit                          Exit from interface configuration mode
  hold-queue            Set hold queue depth
  ip                             Interface Internet Protocol config commands
  mdix                       Set Media Dependent Interface with Crossover
  mls                          mls interface commands
  no                            Negate a command or set its defaults
  power                     Power configuration
  service-policy        Configure QoS Service Policy
  shutdown              Shutdown the selected interface
  spanning-tree       Spanning Tree Subsystem
  speed                     Configure speed operation.
  storm-control       storm configuration
  switchport             Set switching mode characteristics
  tx-ring-limit     Configure PA level transmit ring limit

Be mindful also that the commands shown above have multiple sub commands

With that said, there are a few basic things you can set
- For ports that will always connect to a computer or device, you want to hard code them as access ports (switchport mode access)
- Your access port will need vlan and native vlan (if trunk) changed or left at default value - vlan 1
(switchport access vlan 10)
(switchport trunk native vlan 99)
- Access ports that are no in use should be shut down
- Descriptions are good for quick identification (description WEB-SERVER-1)

Those are just the fundamentals
The port-security option is good to prevent unauthorized device connections
- In your example, it may be good to add a couple of port=security parameters
eg switchport port-security mac-address xx-xx-xx (especially for servers) this allows only that device to connect on that port
You could use other options like "sticky" to automatically memorize the Mac-address of current devices connected.
You could also use the "maximum" options to allow multiple devices to connect if your devices move from location to location as Don had asked.
QoS is also a good one - allows prioritizing or reserving bandwidth or capping bandwidth etc. Note however that the service-port command shown for QoS under the switch is a final step in a MQC configuration (Access-list, Class-map, Policy-map then Service policy). The service policy assigns an already created policy to a switch port
In short, it is solely based on what you want your design to be
I hope this helps
NEW Veeam Backup for Microsoft Office 365 1.5

With Office 365, it’s your data and your responsibility to protect it. NEW Veeam Backup for Microsoft Office 365 eliminates the risk of losing access to your Office 365 data.


Author Comment

ID: 40619065
on my access switches just desktops and printers connected, no phones.
LVL 50

Assisted Solution

by:Don Johnston
Don Johnston earned 1000 total points
ID: 40619144
Then I would have:

switchport mode access
switchport access VLAN xx
spanning-tree portfast
spanning-tree bpduguard enable

Open in new window

I'm not a fan of bpdufilter but you could use that.  I just don't see the benefit for it today.

As for port security, if you need it, go ahead.  But it can become a management pain.
LVL 18

Assisted Solution

Akinsd earned 1000 total points
ID: 40620833
You may want to configure autorecovery with port-security to lessen the management pain.
You can set the time as desired
Switch#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Switch(config)#errdisable ?
  detect        Error disable detection
  flap-setting  Error disable flap detection setting
  recovery      Error disable recovery

Switch(config)#errdisable recovery ?
  cause     Enable error disable recovery for application
  interval  Error disable recovery timer value

Select the cause you want autorecovery to happen for
Switch(config)#errdisable recovery cause ?
  all                                         Enable timer to recover from all error causes
  arp-inspection                   Enable timer to recover from arp inspection error disable state
  bpduguard                         Enable timer to recover from BPDU Guard error
  channel-misconfig            Enable timer to recover from channel misconfig error
  dhcp-rate-limit                  Enable timer to recover from dhcp-rate-limit error
  dtp-flap                              Enable timer to recover from dtp-flap error
  gbic-invalid                        Enable timer to recover from invalid GBIC error
  inline-power                      Enable timer to recover from inline-power error
  link-flap                              Enable timer to recover from link-flap error
  loopback                            Enable timer to recover from loopback error
  mac-limit                            Enable timer to recover from mac limit disable state
  pagp-flap                            Enable timer to recover from pagp-flap error
  port-mode-failure             Enable timer to recover from port mode change failure
  psecure-violation             Enable timer to recover from psecure violation error
  security-violation             Enable timer to recover from 802.1x violation error
  sfp-config-mismatch        Enable timer to recover from SFP config mismatch error
  small-frame                       Enable timer to recover from small frame error
  storm-control                   Enable timer to recover from storm-control error
  udld                                   Enable timer to recover from udld error
  vmps                                 Enable timer to recover from vmps shutdown error

Then Select the desired interval
Switch(config)#errdisable recovery interval ?
  <30-86400>  timer-interval(sec)

Author Comment

ID: 40620873
this is a nice feature with the recovery after an error :-)

Author Closing Comment

ID: 41650335
Thanks a lot.

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article is a collection of issues that people face from time to time and possible solutions to those issues. I hope you enjoy reading it.
How to fix a SonicWall Gateway Anti-Virus firewall blocking automatic updates to apps like Windows, Adobe, Symantec, etc.
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question