思科交换机端口模式配置 端口安全配置 思科模拟器

查看mac地址表

首先先将拓扑建立出来

分别为pc0、pc1配置IP地址,并相互ping一下

Ping IP              //ping命令得使用

Switch#show mac-address-table    //查看mac地址表

我们可以在特权模式下查看mac地址表,可以看到每个接口上设备的mac地址

 交换机端口模式配置

交换机常用的工作模式:

1、access: 主要用来接入终端设备,如PC机、服务器、打印服务器等。  //单个vlan

2、trunk: 主要用在连接其它交换机,以便在线路上承载多个vlan。          //多个vlan

配置命令:

interface fastEthernet 0/1           //进入接口   interface fast Ethernet 接口

switchport mode access/trunk   //配置模式,access或trunk

端口模式安全配置

switchport port-security                                                //开启端口安全

switchport port-security mac-address 000d.bd8c.6ccd  //表明次端口只能这个msc地址的设备使用

switchport port-security maximum 4                             //允许最大mac地址数

switchport port-security violation   模式                //违规后的操作,有以下三种模式

 shutdown      //如果违反规则端口关闭

protect        //当违规时,只丢弃违规的数据流量而且不会通知有流量违规

restrict        //当违规时,只丢弃违规的流量,不违规的正常转发,但它会产生流量违规通知

利用mac地址表绑定接口:

mac-address-table static 000d.bd8c.6ccd vlan 1 int f0/5

mac-address-table static  MAC地址  VLAN NUM  int 接口

Show run    //可以查看对接口的配置

猜你喜欢

转载自blog.csdn.net/m0_73910867/article/details/127334599