which is best PORT config for CISCO switches

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.
Eprs_AdminSystem ArchitectAsked:
Who is Participating?
AkinsdNetwork AdministratorCommented:
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
Eprs_AdminSystem ArchitectAuthor Commented:
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

Don JohnstonInstructorCommented:
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?
Improve Your Query Performance Tuning

In this FREE six-day email course, you'll learn from Janis Griffin, Database Performance Evangelist. She'll teach 12 steps that you can use to optimize your queries as much as possible and see measurable results in your work. Get started today!

Eprs_AdminSystem ArchitectAuthor Commented:
on my access switches just desktops and printers connected, no phones.
Don JohnstonInstructorCommented:
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.
AkinsdNetwork AdministratorCommented:
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)
Eprs_AdminSystem ArchitectAuthor Commented:
this is a nice feature with the recovery after an error :-)
Eprs_AdminSystem ArchitectAuthor Commented:
Thanks a lot.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.