#设定端口模式
[Quidway] int gigabitethernet 0/0/1
[Quidway-GigabitEthernet0/0/1] port link-type access
#将端口加入Vlan
[Quidway] vlan 2
[Quidway-vlan2] port gigabitethernet 0/0/2 to 0/0/20
[Quidway-Vlan2] quit
#设置VLAN IP(管理IP)
[Quidway] interface vlanif 2
[Quidway-Vlanif2 ip address 192.168.0.253 255.255.255.0
[Quidway-Vlanif2] shutdown
[Quidway-Vlanif2] undo shutdown
#设置默认路由
[Quidway] ip route-static 0.0.0.0 0.0.0.0 192.168.0.253
# 关闭WEB Server,dhcp
[Quidway] undo http server enable
[Quidway] undo dhcp enable
[Switch]interface g0/0/2
[Switch-GigabitEthernet0/0/2]ip source check user-bind enable
[Switch-GigabitEthernet0/0/2]quit
[Switch]interface g0/0/3
[Switch-GigabitEthernet0/0/3]ip source check user-bind enable
[Switch-GigabitEthernet0/0/3]quit
上述命令,是在接口下启用数据包源IP-MAC地址绑定检查,检查的依据是user-bind绑定表,
检查不通过的数据包将被丢弃掉。
[Switch]user-bind static ip-address 12.12.12.1 mac-address 5489-98d7-3ae9
[Switch]user-bind static ip-address 12.12.12.2 mac-address 5489-987b-4b2c
上述命令,用于静态绑定IP地址与MAC地址的对应关系。
测试结果是PC以指定IP地址互Ping时可以通,而只要用任何一方更改了IP地址,它们将无法通信。




