Networking Technologies by Johnny Bandin
Networking Knowledge
Networking Knowledge
  • Cisco Networking Fundamentals
  • VLANs Knowledge
    • Creating and Assigning VLANs
    • Creating Trunks
    • Creating SVIs
  • etherchannel overview
    • Etherchannel Layer 2 LACP Configuration
    • Etherchannel Layer 3 LACP Configuration
  • DHCP Overview
    • DHCP Configuration
  • Layer 2 Security
    • Blackhole VLAN Configuration
    • Port Security
    • BPDUGuard and Root Guard
    • DHCP Snooping Configuration
    • Dynamic ARP Inspection
  • Key Chains
  • ACLs
    • Standard ACLs
    • Extended and Named ACLs
  • EIGRP
    • EIGRP Named Mode
    • EIGRP Authentication, Passive-Interface, Summarization
    • EIGRP Stub Routing, Leak-Maps
Powered by GitBook
On this page
  • Configuration
  • Verification
  1. Layer 2 Security

Port Security

PreviousBlackhole VLAN ConfigurationNextBPDUGuard and Root Guard

Last updated 2 years ago

Port Security is a Layer 2 Security protocol that protects the Switch from CAM/MAC address flooding. Port Security will be enabled per-interface on L2 switches. Port-security by default will shutdown a port and place it into "err-disabled" mode. Port-security can only be enabled on "access" ports. By default port-security will only 1 MAC address per interface.

Configuration

For this How To we will first configure the trunks, VLANs and access ports. If you do not know how to configure trunks, VLANs and access ports refer to our other How To's.

SW1(config)#interface range eth0/1, eth0/3 # This command brings us into the range-sub-interface mode.

SW1(config-if-range)#switchport port-security # This command will enable "port-security" on the interface

SW1(config-if-range)#switchport port-security maximum 2 # This command will set the amount of MAC addresses allowed on the interface

SW1(config-if-range)#switchport port-security mac-address sticky # This command will apply the connected SRC MAC address to the running-configuration of the interface.

The full configuration is shown below

Verification

SW1#show run interface ethernet0/3 # This command will show you the running configuration of the interface

SW1#show port-security # This command will show you the port-security table. This table shows you which ports are configured for port-security.

SW1#show port-security | include err # This command will just show you the err-disabled ports in the port security table.

How to clear port-security

SW1#clear port-security all # This command will clear any port-security violations.

SW1(config-if)#shut SW1(config-if)#no shut # These two commands reset the interface. This is how you clear the "err-disabled" state on an interface.

Layer 2 Security Network Diagram
Port Security Configuration
show port-security command and output
Page cover image