Demonstrating, "Port Security" using "Cisco Packet Tracer", Restricting the MAC address of the device for the particular port. If any other MAC address is detected on that port, port security features violation at the switch port.
There are 3 types of Violation, which are shown below in the configurations.
There are 3 types of Violation, which are shown below in the configurations.
Network Topology
![]() |
| Figure 1 |
This topology contains 1 switch and 4 end devices, 1 of the 4 end devices is a console device, here any configuration can be made. Other 3 devices are connected to the Fast Ethernet.
Here are the name of the devices labeled.
Switch0, PC0, PC1, PC2, PC3.
onnect Switch0 and PC0 through console Connections. Selecting 'Console' at Switch0 and 'RS 232' at PC0. As Shown in figure 1.
Connect Switch0 and PC1,PC2,PC3 through 'FastEthernet'.
Selecting 'FastEthernet 0/1', 'FastEthernet 0/2', 'FastEthernet 0/3' for PC1,PC2,PC3 respectively. Shown in figure 2.
Add 2 more End devices (PC), on this topology, here PC4 & PC5 as shown in Figure 2(b)
Assign IP to every end devices, here I have shown how to assign IP to PC4. Assign IP to all the devices (PC1, PC2, PC3, P5 - 10.0.0.1, 10.0.0.2, 10.0.0.3, 10.0.0.5) respectively.
As Shown in figure 2(c)
Securing Fast Ethernet Port For 2 Mac Addresses Using "Sticky" With 3 different modes of Violation (Shutdown, Protect, Restrict)
To Enter Priveledge Mode From User Mode, perform the following command
Switch>en
Shutdown Fa 0/2 Using "Sticky"
At the terminal of PC0, write these commands,
Switch(config)#interface fa 0/2
Switch(config-if)#switchport mode access
Switch(config-if)#switchport port-security
Switch(config-if)#switchport port-security mac-address sticky
Switch(config-if)#switchport port-security max 2
Switch(config-if)#switchport port-security violation shutdown
Switch(config-if)#exit
Shown In Figure 4
Ping any of the connected devices, and now remove the wire between PC2 and Switch,
Connect 'Copper Straight Through' wire from switch 'Fast Ethernet' to PC4 'fastethernet 0/2'.
and now remove the wire between PC4 and Switch, Connect 'Copper Straight Through' wire from switch 'Fast Ethernet' to PC5 'fastethernet 0/2'.
Again Ping any of the device again. Ping will be 'Request Timed Out' Wire between PC5 and switch got red marks on it, that shows that 'Shutdown' is successful. Shown in Figure 5.
To Change State To Up. Perform the following command on the terminal of PC0. As shown in Figure 6.
Switch(config-if)#no shutdown
Connect Switch0 and PC1,PC2,PC3 through 'FastEthernet'.
Selecting 'FastEthernet 0/1', 'FastEthernet 0/2', 'FastEthernet 0/3' for PC1,PC2,PC3 respectively. Shown in figure 2.
![]() |
| Figure 2 |
As Shown in figure 2(c)
![]() |
| Figure 2(b) |
![]() |
| Figure 2(C) |
To Configure each port for the End device, connected through FastEthernet, Open the Terminal of PC0, as shown in figure 3.
![]() |
| Figure 3 |
Securing Fast Ethernet Port For 2 Mac Addresses Using "Sticky" With 3 different modes of Violation (Shutdown, Protect, Restrict)
To Enter Priveledge Mode From User Mode, perform the following command
![]() |
| Figure 4 |
Shutdown Fa 0/2 Using "Sticky"
At the terminal of PC0, write these commands,
Switch(config)#interface fa 0/2
Switch(config-if)#switchport mode access
Switch(config-if)#switchport port-security
Switch(config-if)#switchport port-security mac-address sticky
Switch(config-if)#switchport port-security max 2
Switch(config-if)#switchport port-security violation shutdown
Switch(config-if)#exit
Shown In Figure 4
Ping any of the connected devices, and now remove the wire between PC2 and Switch,
Connect 'Copper Straight Through' wire from switch 'Fast Ethernet' to PC4 'fastethernet 0/2'.
and now remove the wire between PC4 and Switch, Connect 'Copper Straight Through' wire from switch 'Fast Ethernet' to PC5 'fastethernet 0/2'.
Again Ping any of the device again. Ping will be 'Request Timed Out' Wire between PC5 and switch got red marks on it, that shows that 'Shutdown' is successful. Shown in Figure 5.
![]() |
| Figure 5 |
To Change State To Up. Perform the following command on the terminal of PC0. As shown in Figure 6.
Switch(config-if)#no shutdown
![]() |
| Figure 6 |
now ping any connected system.








No comments:
Post a Comment