三层交换VRRP和MSTP

三层交换VRRP和MSTP_第1张图片

配置ce1:
sys
vlan batch 10 20 //创立10 20 号vlan
commit
int g1/0/0
undo shutdown     //打开端口,默认关闭
commit
p l t             //设置链路为干道类型
p t a v 10 20     //此端口可以负载vlan10 20
commit
int g1/0/1
undo shutdown
commit
p l t
p t a v 10 20     //干道类型可以负载多个vlan
commit
int vlan 10       //进入虚拟接口
ip add 192.168.10.252 24//设置虚拟ip地址
int vlan 20
ip add 192.168.20.252 24
commit
int g1/0/2
undo shutdown
commit
undo portswitch  //由二层转到三层以配置ip地址
commit
ip add 172.16.1.2 30
commit
q
stp enable    //汇聚路由器默认接口协议为关闭
y
commit
stp mode mstp  //启动多生成树协议,实现vlan的负载均衡
commit
stp region-configuration  //进入区域配置
region-name R1            //命名为R1
instance 1 vlan 10        //实例1为vlan,一个实例一个生成树
instance 2 vlan 20
commit
q
stp instance 1 root primary  //设置CE1为实例1,即vlan10的根网桥
commit
int vlan 10
vrrp vrid 100 virtual-ip 192.168.10.254 //设置虚拟路由地址,作为用户通信网关
vrrp vrid 100 priority 120         //优先级120,默认100,此时为master路由器,实际经过的路由
vrrp vrid 100 track int g1/0/2 reduce 30  //跟踪端口优先级,减少30
commit
int vlan 20
vrrp vrid 200 virtual-ip 192.168.20.254 //设置虚拟路由地址,作为用户通信网关
commit
q
ip route-static 192.168.30.0 24 172.16.1.1 //设置静态默认网关
commit

你可能感兴趣的:(网安,智能路由器,网络)