diff --git "a/18\345\217\244\347\216\211\350\220\215/20240507--\344\272\244\346\215\242\346\234\272\347\224\237\344\272\247\346\240\221\345\215\217\350\256\256\351\205\215\347\275\256\345\222\214\347\253\257\345\217\243\350\201\232\345\220\210.md" "b/18\345\217\244\347\216\211\350\220\215/20240507--\344\272\244\346\215\242\346\234\272\347\224\237\344\272\247\346\240\221\345\215\217\350\256\256\351\205\215\347\275\256\345\222\214\347\253\257\345\217\243\350\201\232\345\220\210.md" new file mode 100644 index 0000000000000000000000000000000000000000..4d0e304b14fc4921d61b4f2c8bd0dc497ac6e1b7 --- /dev/null +++ "b/18\345\217\244\347\216\211\350\220\215/20240507--\344\272\244\346\215\242\346\234\272\347\224\237\344\272\247\346\240\221\345\215\217\350\256\256\351\205\215\347\275\256\345\222\214\347\253\257\345\217\243\350\201\232\345\220\210.md" @@ -0,0 +1,52 @@ +# 交换机生产树协议配置和端口聚合 + +### STP(Spanning Tree Protocol)生成树协议: + +防止网络中的冗余链路形成闭环,整个收敛时间为50s左右 + +交换机,默认生产协议STP在工作 + +### RSTP(快速生产协议): + + 用于在 局域网 中消除 数据链路层 物理环路,其核心是快速生成树算法,收敛时间1s + +``` +show spanning-tree //查看STP协议 +show spanning-tree summary //以汇总式查看 +spanning-tree mode rapid-pvst //SRTP快速生成树协议 + +``` + +![img](https://gitee.com/xie-cuiping/network/raw/master/16%E8%B0%A2%E7%BF%A0%E8%90%8D/img/05.07(1).PNG) + +``` + +Switch(config)#int range f 0/3-5 +Switch(config-if-range)#switchport mode trunk //改为创口模式 +Switch(config-if-range)#ex +Switch(config)#spanning-tree mode rapid-pvst //改为RSTP协议 +Switch(config)#end +Switch#show spanning-tree //判断根交换机、端口角色、端口状态等 + + +``` + +### 交换机的端口聚合配置 + +聚合端口的前提是这几个人聚合得的端口的编号是连续的 + +![img](https://gitee.com/xie-cuiping/network/raw/master/16%E8%B0%A2%E7%BF%A0%E8%90%8D/img/05.07(2).PNG) + +``` + +Switch>en +Switch#conf t +Switch(config)#int range f 0/3-5 +Switch(config-if-range)#switchport mode trunk //将端口配置为trunk模式 +Switch(config-if-range)#channel-group 1 mode on //加入链路组1并开启 +Switch(config-if-range)#ex +Switch(config)#port-channel load-balance dst-ip //按目的IP地址来实现负载均衡 +Switch#show etherchannel summary //显示以太通道信息 +Switch#show interfaces etherchannel //显示聚合端口信息 +``` + diff --git "a/18\345\217\244\347\216\211\350\220\215/20240508--\344\272\244\346\215\242\346\234\272\347\232\204\347\253\257\345\217\243\345\256\211\345\205\250\350\256\276\347\275\256.md" "b/18\345\217\244\347\216\211\350\220\215/20240508--\344\272\244\346\215\242\346\234\272\347\232\204\347\253\257\345\217\243\345\256\211\345\205\250\350\256\276\347\275\256.md" new file mode 100644 index 0000000000000000000000000000000000000000..aeb333e8980f1220d8a45dae91e0a8f8ae9ebaa1 --- /dev/null +++ "b/18\345\217\244\347\216\211\350\220\215/20240508--\344\272\244\346\215\242\346\234\272\347\232\204\347\253\257\345\217\243\345\256\211\345\205\250\350\256\276\347\275\256.md" @@ -0,0 +1,29 @@ +# 交换机的端口安全设置 + +1. 选择进行安全设置的端口 + +``` +Switch(config)#int f 0/1 +``` + +2. 启用交换机接口的接口安全设置 + +``` +Switch(config)#switchport port-security //直接这么写会报提示 ,因为端口默认是动态的,要改成访问access +``` + +3. 改成访问模式access + +``` +Switch(config)#switchport mode access +Switch(config)#switchport port-security //再次开启交换机接口的接口安全设置 +Switch(config)#switchport port-security maximum 1 //设置最大允许连接的终端数量1 +Switch(config)#switchport port-security violation shutdown //设置超过最大连接的违规设备的处理方式 +Switch(config)#switchport port-security mac-address sticky //绑定正确的MAC地址 +Switch# show mac-address-table //查看端口MAC地址绑定配置 +Switch#clear port-security sticky //清楚交换机已经记录的安全mac地址,重新开始记录 +``` + +![img](https://gitee.com/xie-cuiping/network/raw/master/16%E8%B0%A2%E7%BF%A0%E8%90%8D/img/05.08-2.PNG) + +![img](https://gitee.com/xie-cuiping/network/raw/master/16%E8%B0%A2%E7%BF%A0%E8%90%8D/img/05.08-1.PNG)