如何给交换机端口配置固定IP及具体指令是什么
为了限制端口上允许的最大MAC地址数量,可以执行 switch(config-if)#switchport port-security maximum 1。虽然默认值通常就是1,但显式配置更稳妥。此外,还需要定义违规处理策略,使用命令 switch(config-if)#switchport port-security violation shutdown。这意味着如果有未授权的MAC地址尝试通过该端口,端口将被自动关闭(shutdown),此时使用 show int f0/1 查看接口状态,会发现其处于 err-disable 状态。