Lab 2.5: Настройка безопасности порта доступа коммутатора

Топология:

Пожалуйста, используйте следующую топологию для выполнения этого лабораторного упражнения:

Task 1:

Настройте имена хостов на Sw1 и R1, как показано в топологии.

Task 2:

Создайте VLAN 10 на Sw1 и назначьте порт FastEthernet0/2 этой VLAN в качестве порта доступа.

Task 3:

Настройте IP-адрес 10.0.0.1/30 на интерфейсе R1 FastEthernet0/0 и IP-адрес 10.0.0.2/30 на интерфейсе Sw2 VLAN10. Убедитесь, что R1 может пинговать Sw1, и наоборот.

Task 4:

Настройте безопасность порта на порту FastEthernet0/2 на Sw1 таким образом, чтобы на этом интерфейсе можно было хранить только один MAC-адрес. В случае нарушения конфигурации безопасности порта, когда на этом интерфейсе наблюдается более одного MAC-адреса, коммутатор должен отключить интерфейс. Проверьте свою конфигурацию с помощью команд защиты портов в Cisco IOS.

Настройка и проверка

Task 1:

For reference information on configuring hostnames, please refer to earlier labs.

Task 2:

For reference information on configuring VLANs, please refer to earlier labs. The port can’t be dynamic if you intend to add port security. It must be manually set to trunk or access.

Task 3:

For reference information on configuring router IP interfaces, please refer to earlier labs.

Sw1(config)#int vlan10 
%LINK-5-CHANGED: Interface Vlan10, changed state to up 
Sw1(config-if)#ip add 10.0.0.2 255.255.255.252 
Sw1(config-if)#no shut 
Sw1(config-if)#end 
Sw1#ping 10.0.0.1 

Type escape sequence to abort. 
Sending 5, 100-byte ICMP Echos to 10.0.0.1, timeout is 2 seconds: 
.!!!! Success rate is 80 percent (4/5), round-trip min/avg/max = 0/0/0 ms

Task 4:

Sw1#conf t 
Enter configuration commands, one per line.  End with CTRL/Z. 
Sw1(config)#interface fastethernet 0/2 
Sw1(config-if)#switchport port-security 
Sw1(config-if)#switchport port-security maximum 1 
Sw1(config-if)#switchport port-security violation shutdown 
Sw1(config-if)#end
Sw1#show port-security 
Secure Port MaxSecureAddr CurrentAddr SecurityViolation Sec Action 
(Count)        (Count)      (Count) 
---------------------------------------------------------------------- 
Fa0/2           1               0             0            Shutdown
 ---------------------------------------------------------------------- 
Total Addresses in System : 0 
Max Addresses limit in System : 1024 

[Output Truncated]

NOTE: If you wanted to test your port security configuration, you could simply change the MAC address of FastEthernet0/0 on R1 to 000a.bc01.2300, and then you would see a port security violation. For example:

R1#conf t 
Enter configuration commands, one per line.  End with CTRL/Z. 
R1(config)#interface fastethernet0/0 
R1(config-if)#mac-address 000a.bc01.2300 
R1(config)#end 
R1# 

Sw1#show port-security 
Secure Port MaxSecureAddr CurrentAddr SecurityViolation Sec Action
             (Count)        (Count)      (Count)
 ---------------------------------------------------------------------- 
Fa0/2           1               0             1              Shutdown 
---------------------------------------------------------------------- 
Total Addresses in System : 0 
Max Addresses limit in System : 1024 

Sw1#show interfaces fastethernet 0/2 
FastEthernet0/2 is down, line protocol is down (errdisabled)

As can be seen in the output above, the violation counter has incremented and the interface is now in an errdisabled mode, which basically means it has been shut down due to a port security violation. To bring this interface back up, you need to issue a shutdown command and then a no shutdown command under the interface.