howtonetwork.net

Cisco Certification Training

  • Products
  • CCNA
    • CCNA Videos
    • CCNA Lectures
    • CCNA Practice Exams
    • Challenge Labs
      • Challenge Video Solutions
    • Cisco Commands
  • CCNP ROUTE
    • ROUTE Exams
  • CCNP SWITCH
    • SWITCH Exams
  • CCNP TSHOOT
  • Home
  • Join
  • Downloads
  • About Us
  • Whitepapers
  • Feature Articles
  • Helpdesk
  • FAQ
  • Free Training
You are here: Home / switchport port-security mac-address

switchport port-security mac-address

Command

Switchport Port-Security Mac-Address

Use

Sets the mac-address(es) that causes port-security violation.

Syntax

Switch(config-if)#switchport port-security mac-address <h.h.h.h>
Or
Switch(config-if)#switchport port-security mac-address sticky

Use sticky in conjunction with switchport port-security maximum to have the switch learn which mac-addresses to allow. For example,

if you set switchport port-security maximum 5, then the switch will learn and allow the first 5 mac addresses that connect to the interface.
Any new mac addresses beyond 5 will trigger a violation. Also note that, after rebooting, the switch has to relearn those 5 mac addresses.

Example

In this example, the mac-address is set for port-security on int fa0/2.

SW3#conf t
Enter configuration commands, one per line. End with CNTL/Z.
SW3(config)#int fa0/2
SW3(config-if)#switchport port-security mac-address aaaa.bbbb.cccc

After connecting a device with a different mac to the interface, port violation is triggered and int fa0/2 is shut down.

SW3(config-if)#
00:55:59: %PM-4-ERR_DISABLE: psecure-violation error detected on Fa0/2, putting Fa0/2 in err-disable state
SW3(config-if)#
00:55:59: %PORT_SECURITY-2-PSECURE_VIOLATION: Security violation occurred, caused by MAC address 1234.5678.489d on port FastEthernet0/2.
SW3(config-if)#
00:56:00: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/2, changed state to down
00:56:01: %LINK-3-UPDOWN: Interface FastEthernet0/2, changed state to down

Get access to over 5 hours of IT webinar videos as well as regular study tips and ideas when you
join our mailing list

About This Site

We replaced this site some time ago with an upgraded version. Please feel free to enjoy the content and if you like what you see check out our brilliant new site:

howtonetwork.com

Keep In Touch

About Us

This is a free access website which has now been replaced by howtonetwork.com.

Navigation

  • Home
  • Join
  • Downloads
  • About Us
  • Whitepapers
  • Feature Articles
  • Helpdesk
  • FAQ
  • Free Training

Copyright

All content is protected by international copyright laws. Copyright Reality Press Ltd.

Copyright © 2023 · Dynamik Website Builder on Genesis Framework · WordPress · Log in