Title: How to configure port security on CLI for Ruijie Series Switch? [Print this page] Author: GTAC-Sophia Time: 2023-7-11 17:36 Title: How to configure port security on CLI for Ruijie Series Switch? Requirement: 1.
PC1(IP: 192.168.1.1,MAC: 0021.CCCF.6F70)canonly connect to access switch F0/1,and configure IP+MAC binding other PC conenct to this port cannot be accessed when connected to this port; 2. F0/2port can only allow ip address 192.168.1.2 access to the internet, MAC address is not limited other ip address cannot access internet when connected to this port. Topology:
\
Configuration tips:
On ports F0/1 and F0/2, you need to enable switchport port-security and limit MAC address binding entries to 1 Configuration Steps:
>Requirement 1:
In core switch:
Ruijie>en
Ruijie#config ter
Ruijie(config)#vlan 10
Ruijie(config)#interface vlan 10
Ruijie(config-if-VLAN 10)#ip address 192.168.1.254255.255.255.0 --->Create the IP address of the core device, that is, the gateway address of the user
Ruijie(config-if-VLAN 10)#end
Ruijie#wr ---> save the configuration
In access switch:
Ruijie>enable
Ruijie#configure terminal
Ruijie(config)#interface fast Ethernet 0/1
Ruijie(config-if-Fast Ethernet 0/1)#switchportport-security binding 0021.CCCF.6F70 vlan10 192.168.1.1 ----> Bind the PC whose mac address is0021.CCCF.6F70 and ip address is 192.168.1.1 to the fastEthernet 0/1 port onthe switch
Ruijie(config-if-FastEthernet 0/1)#switchportport-security ------>enableport security function
Ruijie(config-if-FastEthernet 0/1)#exit
Ruijie#write ---> save the configuration
>Requirement 2:
Ruijie(config)#interfac fastEthernet 0/2
Ruijie(config-if-FastEthernet 0/2)# switchportport-security binding 192.168.1.2 ------>Bindthe PC whose ip address is 192.168.1.2 to the fastEthernet 0/2 port on the switch
Ruijie(config-if-FastEthernet 0/2)#switchportport-security ------>enableport security function
Ruijie(config-if-FastEthernet 0/2)#end
Ruijie#write ---> save the configuration
Verification:
Ruijie#show port-security address
Welcome to Ruijie Community (https://community.ruijienetworks.com/)