以前的学习笔记整理:第二层交换和生成树协议(STP) ...

 Talen Hao LINUX 学习笔记系列■■■■■

8

第二层交换和生成树协议(STP

系统:cisco


一:打开cisco交换机管理功能(即管理VLAN)


进入接口模式vlan 1:

Switch>enable

Switch#config t

Enter configuration commands, one per line. End with CNTL/Z.

Switch(config)#interface vlan 1

Switch(config-if)#ip address 192.168.0.1 255.255.255.0

Switch(config-if)#no shutdown


Switch(config-if)#

%LINK-5-CHANGED: Interface Vlan1, changed state to up


%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan1, changed state to up

退出到全局模式,设置默认网关:

Switch(config)#ip default-network 192.168.0.254


二:端口安全


Switch#configure terminal

Enter configuration commands, one per line. End with CNTL/Z.

为端口设置静态MAC:

Switch(config)#interface range f0/1-13

Switch(config-if-range)#switchport port-security maximum 1

Switch(config-if-range)#switchport port-security mac-address sticky

Switch(config-if-range)#switchport port-security violation shutdown


STP扩展特性:

portfast: switch(config-if-range)#spanning-tree portfast

BPDUGuard(禁用启用了portfast的接入层端口):(二选一)

switch(config-if-range)#spanning-tree bpduguard enable

BPDUGuard(收到BPDU的端口禁用portfast):

switch(config-if-range)#spanning-tree bpdufilter enable

uplinkfast: switch(config)#spanning-tree uplinkfast(全局命令)

backbonefast: switch(config)#spanning-tree backbonefast


启用带上面所有特性的802.1w RSTP

switch(config)#spanning-tree mode rapid-pvst

Talen Hao LINUX 学习笔记系列■■■■■

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值