diff --git "a/13\351\237\251\347\224\263\347\220\246/20240507.md" "b/13\351\237\251\347\224\263\347\220\246/20240507.md" new file mode 100644 index 0000000000000000000000000000000000000000..6785055c061be353e4c6545c90a5e39895ed30bc --- /dev/null +++ "b/13\351\237\251\347\224\263\347\220\246/20240507.md" @@ -0,0 +1,19 @@ +## 生成树协议(STP/RSTP)and聚合端口 +``` +生成树协议作用(STP):防止网络中的冗余链路形成环路工作。 +收敛时间50s +缺点:慢 +RSTP(快速生成树协议) +收敛时间1s +Switch#show spanning-tree //生成树运行状态 +Switch#show spanning-tree summary //生成树配置信息 +在全局模式中指定生成协议类型为RSTP Switch(config)#spanning-tree mode rapid-pvst +Switch(config)#inter range f0/1-3 +Switch(config-if-range)#switch mode trunk //将端口配置为Trun模式 +Switch(config-if-range)#channel-group 1 mode on //加入链路组1并开启 +Switch(config-if-range)#exit +Switch(config)#port-channel load-balance dst-ip //按目的IP地址来实现负载均衡 +Switch(config)#exit +Switch#show etherchannel summary //显示以太通道信息 +Switch#show interfaces etherchannel //显示聚合端口信息 +``` \ No newline at end of file diff --git "a/13\351\237\251\347\224\263\347\220\246/20240508.md" "b/13\351\237\251\347\224\263\347\220\246/20240508.md" new file mode 100644 index 0000000000000000000000000000000000000000..4cefab5c1bc8fd0cd0d6f64a23454f082842bd82 --- /dev/null +++ "b/13\351\237\251\347\224\263\347\220\246/20240508.md" @@ -0,0 +1,19 @@ +## 端口安全 +``` +Switch(config)#inter rang f0/1-2 +Switch(config-if-range)#switchport mode access //配置端口为接入类型,否则默认为动态端口,不能启用安全模式, +少了这句会报Command rejected: FastEthernet0/1 is a dynamic port. 错误 +Switch(config-if-range)#switchport port-security //开启端口安全功能 +//设置端口最大连接数为1,即启用动态MAC安全地址 +Switch(config-if-range)#switchport port-security maximum 1 +//若发现违规动作,处理方式为关闭端口 +Switch(config-if-range)#switchport port-security violation shutdown +Switch(config-if-range)#end +Switch#show port-security //查看端口安全配置 +Switch#show port-security int f 0/1 //查看f0/1端口的安全配置 +Switch(config-if-range)#switchport port-security mac-address sticky //启用粘性MAC地址,自动绑定接入的MAC地址 +//然后互换PC2和PC3在交换机上的端口,ping测试,结果链路均不通 +Switch(config-if-range)#end +Switch#show mac-address-table //查看端口MAC地址绑定配置 +Switch#clear port-security sticky //清除所有已绑定的粘性MAC地址 +``` \ No newline at end of file