Lab Objective:
The objective of this lab exercise is for you to learn and understand how to secure Access ports on Cisco Catalyst switches using Port Security and Identity Based Networking Services
Lab Topology:
|
IMPORTANT NOTE
If you are using the www.howtonetwork.net racks, please begin each and every lab by shutting down all interfaces on all switches and then manually re-enabling the interfaces that are illustrated in this topology. |
|
LAB-SPECIFIC NOTE If you are using the www.howtonetwork.net racks, the diagram is based on the physical cabling of the CCNP Rack. This is seen in the CDP output:
If using a home lab, you can substitute the routers for any other devices, such as workstations. No explicit configuration is required other than that the device port or NIC is up so as to bring up the switch port |
Task 1
Enable interfaces FastEthernet0/1 to FastEthernet0/4 and verify the connected devices using or by looking at the switch CAM table entry for the specific port or ports
Task 2
Configure port security on FastEthernet0/1 as follows:
§ Only the explicit MAC address of the device connected to this port should be allowed
§ This entry should be flushed exactly every 8 hours
§ If another MAC is detected, a log message should be generated and the port shutdown
Task 3
Configure port security on FastEthernet0/2 as follows:
§ The MAC address of the connected device should be dynamically learned by the switch
§ This port should learn no more than 5 different MAC addresses
§ The learned MAC addresses should be flushed following 1 hour of inactivity
§ This port should discard all Unicast or Multicast frames with unknown source MACs
Task 4
Configure port security on FastEthernet0/3 as follows:
§ The MAC address of the connected device should be dynamically learned by the switch
§ This MAC address should be saved to NVRAM and be retained across a reboot
§ The port should never age out the MAC address
§ This port should drop packets with unknown MAC addresses and generate a Syslog trap
Task 5
Configure Identity Based Networking Services for FastEthernet0/4 as follows:
§ The port should use 802.1x port-based authentication
§ In the initial state, the port should allow only EAPOL frames to be sent and received
§ The supplicant should be authenticated against RADIUS server 192.168.1.254
Lab Validation
Task 1
| ALS1(config)#interface range fastethernet 0/1 – 4
ALS1(config-if-range)#no shutdown ALS1(config-if-range)#exit ALS1(config)#exit ALS1# ALS1#show cdp neighbors Capability Codes: R – Router, T – Trans Bridge, B – Source Route Bridge S – Switch, H – Host, I – IGMP, r – Repeater, P – Phone Device ID Local Intrfce Holdtme Capability Platform Port ID R2 Fas 0/1 150 R S I 2620XM Fas 0/0 R3 Fas 0/3 152 R S I 2620XM Fas 0/0 R1 Fas 0/2 153 R S I 2620XM Fas 0/0 R4 Fas 0/4 152 R S I 2620XM Fas 0/0 |
Task 2
To determine the MAC address of the device connected to the port, perform the following:
| ALS1#show mac-address-table int f0/1
Mac Address Table ——————————————- Vlan Mac Address Type Ports —- ———– ——– —– 1 000c.85f8.1640 DYNAMIC Fa0/1 Total Mac Addresses for this criterion: 1 |
Next, complete the task by configuring the following:
| ALS1(config)#interface fastethernet 0/1
ALS1(config-if)#switchport mode access ALS1(config-if)#switchport port-security ALS1(config-if)#switchport port-security mac-address 000c.85f8.1640 ALS1(config-if)#switchport port-security aging type absolute ALS1(config-if)#switchport port-security aging static ALS1(config-if)#switchport port-security aging time 480 |
Verify your configuration using the appropriate show commands as follows:
| ALS1#show port-security interface fastethernet 0/1
Port Security : Enabled Port Status : Secure-up Violation Mode : Shutdown Aging Time : 480 mins Aging Type : Absolute SecureStatic Address Aging : Enabled Maximum MAC Addresses : 1 Total MAC Addresses : 1 Configured MAC Addresses : 1 Sticky MAC Addresses : 0 Last Source Address : 0000.0000.0000 Security Violation Count : 0 ALS1#show port-security Secure Port MaxSecureAddr CurrentAddr SecurityViolation Security Action (Count) (Count) (Count) ————————————————————————— Fa0/1 1 1 0 Shutdown ————————————————————————— Total Addresses in System (excluding one mac per port) : 0 Max Addresses limit in System (excluding one mac per port) : 1024 ALS1#show port-security address Secure Mac Address Table ——————————————————————- Vlan Mac Address Type Ports Remaining Age (mins) —- ———– —- —– ————- 1 000c.85f8.1640 SecureConfigured Fa0/1 470 ——————————————————————- Total Addresses in System (excluding one mac per port) : 0 Max Addresses limit in System (excluding one mac per port) : 1024 |
Task 3
| ALS1(config)#interface fastethernet 0/2
ALS1(config-if)#switchport mode access ALS1(config-if)#switchport port-security ALS1(config-if)#switchport port-security maximum 5 ALS1(config-if)#switchport port-security aging type inactivity ALS1(config-if)#switchport port-security aging time 60 ALS1(config-if)#switchport port-security violation protect |
Verify your configuration as follows:
| ALS1#show port-security interface fastethernet 0/2
Port Security : Enabled Port Status : Secure-up Violation Mode : Protect Aging Time : 60 mins Aging Type : Inactivity SecureStatic Address Aging : Disabled Maximum MAC Addresses : 5 Total MAC Addresses : 1 Configured MAC Addresses : 0 Sticky MAC Addresses : 0 Last Source Address : 0013.c3bc.b720 Security Violation Count : 0
ALS1#show port-security Secure Port MaxSecureAddr CurrentAddr SecurityViolation Security Action (Count) (Count) (Count) ————————————————————————— Fa0/1 1 1 0 Shutdown Fa0/2 5 1 0 Protect ————————————————————————— Total Addresses in System (excluding one mac per port) : 0 Max Addresses limit in System (excluding one mac per port) : 1024
ALS1#show port-security address Secure Mac Address Table ——————————————————————- Vlan Mac Address Type Ports Remaining Age (mins) —- ———– —- —– ————- 1 000c.85f8.1640 SecureConfigured Fa0/1 454 1 0013.c3bc.b720 SecureDynamic Fa0/2 60 (I) ——————————————————————- Total Addresses in System (excluding one mac per port) : 0 Max Addresses limit in System (excluding one mac per port) : 1024 |
Task 4
| ALS1(config)#interface fastethernet 0/3
ALS1(config-if)#switchport mode access ALS1(config-if)#switchport port-security ALS1(config-if)#switchport port-security mac-address sticky ALS1(config-if)#switchport port-security violation restrict |
Verify your configuration as follows:
| ALS1#show port-security interface fastethernet 0/3
Port Security : Enabled Port Status : Secure-up Violation Mode : Restrict Aging Time : 0 mins Aging Type : Absolute SecureStatic Address Aging : Disabled Maximum MAC Addresses : 1 Total MAC Addresses : 1 Configured MAC Addresses : 0 Sticky MAC Addresses : 1 Last Source Address : 0019.55b2.9520 Security Violation Count : 0
ALS1#show port-security Secure Port MaxSecureAddr CurrentAddr SecurityViolation Security Action (Count) (Count) (Count) ————————————————————————— Fa0/1 1 1 0 Shutdown Fa0/2 5 1 0 Protect Fa0/3 1 1 0 Restrict ————————————————————————— Total Addresses in System (excluding one mac per port) : 0 Max Addresses limit in System (excluding one mac per port) : 1024
ALS1#show port-security address Secure Mac Address Table ——————————————————————- Vlan Mac Address Type Ports Remaining Age (mins) —- ———– —- —– ————- 1 000c.85f8.1640 SecureConfigured Fa0/1 257 1 0013.c3bc.b720 SecureDynamic Fa0/2 60 (I) 1 0019.55b2.9520 SecureSticky Fa0/3 – ——————————————————————- Total Addresses in System (excluding one mac per port) : 0 Max Addresses limit in System (excluding one mac per port) : 1024 |
Task 5
| ALS1(config)#aaa new-model
ALS1(config)#aaa authentication dot1x default group radius ALS1(config)#radius–server host 192.168.1.254 ALS1(config)#dot1x system-auth-control ALS1(config)#interface fastethernet 0/4 ALS1(config-if)#switchport mode access ALS1(config-if)#dot1x port-control auto ALS1(config-if)#exit |
Verify your configuration as follows:
NOTE: Unless you have an 802.1x client or supplicant, and a configured RADIUS server, the connected host won’t actually be authenticated. However, you can still verify your configuration by looking at the interface state and 802.1x interface statistics for FastEthernet0/1
| ALS1#show dot1x interface fastethernet 0/4
Supplicant MAC <Not Applicable> AuthSM State = CONNECTING BendSM State = IDLE Posture = N/A PortStatus = UNAUTHORIZED MaxReq = 2 MaxAuthReq = 2 HostMode = Single Port Control = Auto ControlDirection = Both QuietPeriod = 60 Seconds Re-authentication = Disabled ReAuthPeriod = 3600 Seconds ServerTimeout = 30 Seconds SuppTimeout = 30 Seconds TxPeriod = 30 Seconds Guest-Vlan = 0
ALS1#show dot1x statistics interface fastethernet 0/4 PortStatistics Parameters for Dot1x ——————————————– TxReqId = 6 TxReq = 6 TxTotal = 8 RxStart = 0 RxLogoff = 0 RxRespId = 0 RxResp = 0 RxInvalid = 0 RxLenErr = 0 RxTotal= 0 RxVersion = 0 LastRxSrcMac 0000.0000.0000 |
Final Switch Configurations
ALS1
| ALS1#show running-config
Building configuration…
Current configuration : 2291 bytes ! version 12.1 no service pad service timestamps debug uptime service timestamps log uptime no service password-encryption ! hostname ALS1 ! no logging console aaa new-model aaa authentication dot1x default group radius ! ip subnet-zero ! ip ssh time-out 120 ip ssh authentication-retries 3 vtp domain ETHER vtp mode transparent ! spanning-tree mode pvst no spanning-tree optimize bpdu transmission spanning-tree extend system-id dot1x system-auth-control ! ! ! ! interface FastEthernet0/1 switchport mode access switchport port-security switchport port-security aging time 480 switchport port-security aging static switchport port-security mac-address 000c.85f8.1640 ! interface FastEthernet0/2 switchport mode access switchport port-security switchport port-security maximum 5 switchport port-security aging time 60 switchport port-security violation protect switchport port-security aging type inactivity ! interface FastEthernet0/3 switchport mode access switchport port-security switchport port-security violation restrict switchport port-security mac-address sticky switchport port-security mac-address sticky 0019.55b2.9520 ! interface FastEthernet0/4 switchport mode access dot1x port-control auto spanning-tree portfast ! interface FastEthernet0/5 shutdown ! interface FastEthernet0/6 shutdown ! interface FastEthernet0/7 shutdown ! interface FastEthernet0/8 shutdown ! interface FastEthernet0/9 shutdown ! interface FastEthernet0/10 shutdown ! interface FastEthernet0/11 shutdown ! interface FastEthernet0/12 shutdown ! interface FastEthernet0/13 shutdown ! interface FastEthernet0/14 shutdown ! interface FastEthernet0/15 shutdown ! interface FastEthernet0/16 shutdown ! interface FastEthernet0/17 shutdown ! interface FastEthernet0/18 shutdown ! interface FastEthernet0/19 shutdown ! interface FastEthernet0/20 shutdown ! interface FastEthernet0/21 shutdown ! interface FastEthernet0/22 shutdown ! interface FastEthernet0/23 shutdown ! interface FastEthernet0/24 shutdown ! interface GigabitEthernet0/1 ! interface GigabitEthernet0/2 ! interface Vlan1 no ip address no ip route-cache shutdown ! ip http server radius-server host 192.168.1.254 auth-port 1812 acct-port 1813 radius-server retransmit 3 ! line con 0 line vty 5 15 ! ! end ALS1# |