Ruijie Community

Title: What's the function of port security? [Print this page]

Author: GTAC-Sophia    Time: 2022-7-14 15:04
Title: What's the function of port security?
Port security function allows the packets to enter the switch port by the source MAC address, source MAC+IP address or source IP address. You can control the packets by setting the specific MAC address statically, static IP+MAC binding or IP binding, or dynamically learning limited MAC addresses. The port with port security enabled is named as secure port. Only the packets with the source MAC address in the port security address table, or IP+MAC binding configured, or IP binding configured, or the learned MAC address,can join the switch communication, while other packets are dropped.  
Requirements
1. You can only connect PC1 (IP: 192.168.1.1,MAC: 0021.CCCF.6F70)  to port F0/1 . If you connect PC1 to other ports, PC1 cannot access the network.
If other PCs connect port F0/1 , they cannot access the network neither.
2. Port F0/2 can only foward traffic of PC (IP=192.168.1.2, MAC=any) to the network.
Network Topology



Configuration Tips
Enable Port security on port F0/1 and F0/2, then set port security maximun value to 1.
Configuration Steps
Configuring Core switch:
Ruijie(config)#interface vlan 10
Ruijie(config-if-VLAN 10)#ip address 192.168.1.254 255.255.255.0
Ruijie(config-if-VLAN 10)#end
Ruijie#wr
Configuring Access switch:
Ruijie(config-if-VLAN 10)#end
Ruijie#configure terminal
Ruijie(config)#interface fastEthernet 0/1                                   
Ruijie(config-if-FastEthernet 0/1)#switchport port-security binding 0021.CCCF.6F70 vlan 10 192.168.1.1  
Ruijie(config-if-FastEthernet 0/1)#switchport port-security   ------>enable Port Security
Ruijie(config-if-FastEthernet 0/1)#exit
2.Enable port security on interface F0/2 to allow the PC (IP = 192.168.1.1 VLAN=10, MAC=any) to access network.
Ruijie(config)#interfac fastEthernet 0/2
Ruijie(config-if-FastEthernet 0/2)# switchport port-security binding 192.168.1.2  ------>binding ip address 192.168.1.2 to interface f0/2
Ruijie(config-if-FastEthernet 0/2)#switchport port-security   ------>enable port security
3.Save Configuration
Ruijie(config-if-FastEthernet 0/2)#end
Ruijie#write                  ------>confirm and save
Verification
Display Port security table








Welcome to Ruijie Community (https://community.ruijienetworks.com/) Powered by Discuz! X3.2