管理员计划为交换机配置VRRP,以提高网络的可靠性。通过调整优先级使SwitchA作为 Master 设备承担流量转发,同时为了防止震荡,设置 20s 抢占延时SwitchB为默认优先级,作为 Bakup 设备,实现网关冗余备份。接口 IP 地址配置如表4-1所示。请将下面的配置代码补充完整。
1.配置SwitchA接口转发方式、IP地址和VRRP
(7)
[HUAWEI] (8) SwitchA
[SwitchAl vlan (9) 100 200
[SwitchAl interface gigabitethernet 0/0/1
[SwitchA-GigabitEtheret0/0/1]port link-type (10)
[SwitchA-GigabitEthernet0/0/1]port hybrid (11) vlan 200
[SwitchA GigabitEtherpet0/0/1]port hybrid untagged vlan 200
[SwitchA-GigabitEthernet0/0/1]guit
.....................
[SwitchA] interface vlanif 100
[SwitchA-Vlanif100] ip address 10.1.1.1 24
[SwitchA-Vlanif100] quit
[SwitchA] interface vlanif 200
[SwitchA-Vlanif200] ip address (12) 24
[SwitchA-Vlanif200] quit
[SwitchAl interface vlanif 100
[SwitchA-Vlanif100](13) vrid 1 virtual-ip 10.1.1.111
[SwitchA-Vlanifl00] vrrp vrid 1 priority 120
[SwitchA-Vlanifl00] vrrp vrid 1 preempt-mode timer delay (14)
[SwitchA-Vlanif100] quit
2.在 SwitchB上创建VRRP备份组1
[SwitchB] interface vlanif 100
[SwitchB-Vlanif100] MIIpyid 1 virtual-ipl (15)
[SwitchB-Vlanif100] quit