思科核心交换机双机热备份
本文最后更新于 2025年4月27日 晚上

| 描述 | 交换机A | 交换机B |
|---|---|---|
| 配置vlan接口地址 | int vlan 10ip add 192.168.10.254 255.255.255.0int vlan 20ip add 192.168.20.254 255.255.255.0 |
int vlan 10ip add 192.168.10.253 255.255.255.0int vlan 20ip add 192.168.20.253 255.255.255.0 |
| 配置虚拟地址优先级 抢占 监控上行接口(中断时切换) (standby编号可以指定其他,但为了方便一般与vlan号相同) |
int vlan 10standby 10 ip 192.168.10.252standby 10 priority 101standby 10 preemptstandby 10 track f0/1standby 10 track f0/2 int vlan 20standby 20 ip 192.168.20.252standby 20 priority 100(default)standby 20 track f0/1standby 20 track f0/2 |
int vlan 10standby 10 ip 192.168.10.252standby 10 priority 100(default)standby 10 track f0/1standby 10 track f0/2int vlan 20standby 20 ip 192.168.20.252standby 20 priority 101standby 10 preemptstandby 20 track f0/1standby 20 track f0/2 |
| 配置生成树,分配vlan,负载均衡 | spanning-tree mode pvstspanning-tree vlan 10 root primaryspanning-tree vlan 20 root secondary |
spanning-tree mode pvstspanning-tree vlan 20 root primaryspanning-tree vlan 10 root secondary |
| 配置上行接口为路由接口,关闭二层交换功能 | int f0/1no switchportip add 192.168.11.13 255.255.255.252int f0/2no switchportip add 192.168.11.9 255.255.255.252 |
int f0/1no switchportip add 192.168.11.1 255.255.255.252int f0/2no switchportip add 192.168.11.5 255.255.255.252 |
| 捆绑链路聚合接口 | int f0/3switchport trunk encapsulation dot1qswitchport mode trunkchannel-group 1 mode on int f0/4switchport trunk encapsulation dot1qswitchport mode trunkchannel-group 1 mode on |
int f0/3switchport trunk encapsulation dot1qswitchport mode trunkchannel-group 1 mode onint f0/4switchport trunk encapsulation dot1qswitchport mode trunkchannel-group 1 mode on |
| 其余端口配置为trunk | int range f0/5-7switchport trunk encapsulation dot1qswitchport mode trunkswitchport trunk allowed vlan all(default) |
int range f0/5-7switchport trunk encapsulation dot1qswitchport mode trunkswitchport trunk allowed vlan all(default) |
思科核心交换机双机热备份
https://xinhaojin.github.io/2024/11/21/思科核心交换机双机热备份/