多个VLAN中的VRRP备份组配置举例

组网需求
• • VLAN 2 内主机的缺省网关为 10.1.1.100/25;VLAN 3 内主机的缺省网关为 10.1.1.200/25;
• • Switch A 和 Switch B 同时属于虚拟 IP 地址为 10.1.1.100/25 的备份组 1 和虚拟 IP 地址为
10.1.1.200/25 的备份组 2;
• • 在备份组 1中 Switch A的优先级高于Switch B,在备份组 2中 Switch B的优先级高于 Switch
A,从而保证 VLAN 2 和 VLAN 3 内的主机分别通过 Switch A 和 Switch B 通信,当 Switch A
或 Switch B 出现故障时,主机可以通过另一台设备继续通信,避免通信中断。

  1. 配置步骤
    (1) 配置 Switch A
    <H3C> system-view
    [H3C]hostname SwitchA
    [SwitchA]inter range g 1/0/21 to g 1/0/24
    [SwitchA-if-range]port link-type trunk
    [SwitchA-if-range]port trunk per vlan all
    [SwitchA-if-range]quit

配置 VLAN 2。

[SwitchA] vlan 2
[SwitchA-vlan2] quit
[SwitchA] interface vlan-interface 2
[SwitchA-Vlan-interface2] ip address 10.1.1.1 255.255.255.128

创建备份组 1,并配置备份组 1 的虚拟 IP 地址为 10.1.1.100。

[SwitchA-Vlan-interface2] vrrp vrid 1 virtual-ip 10.1.1.100

设置 Switch A 在备份组 1 中的优先级为 110,高于 Switch B 的优先级 100,以保证在备份组 1

中 Switch A 成为 Master 负责转发流量。
[SwitchA-Vlan-interface2] vrrp vrid 1 priority 110
[SwitchA-Vlan-interface2] quit

配置 VLAN 3。

[SwitchA] vlan 3
[SwitchA-vlan3] quit
[SwitchA] interface vlan-interface 3
[SwitchA-Vlan-interface3] ip address 10.1.1.130 255.255.255.128

创建备份组 2,并配置备份组 2 的虚拟 IP 地址为 10.1.1.200。

[SwitchA-Vlan-interface3] vrrp vrid 2 virtual-ip 10.1.1.200
[SwitchA-Vlan-interface3]quit

[SwitchA]inter g 1/0/1
[SwitchA-GigabitEthernet1/0/1]port link-m r
[SwitchA-GigabitEthernet1/0/1]ip add 10.1.3.1 24
[SwitchA-GigabitEthernet1/0/1]undo shut
[SwitchA-GigabitEthernet1/0/1]quit

[SwitchA]ip route-static 0.0.0.0 0 10.1.3.2

(2) 配置 Switch B
<H3C> system-view
[H3C]hostname SwitchB
[SwitchB]inter range g 1/0/21 to g 1/0/24
[SwitchB-if-range]port link-type trunk
[SwitchB-if-range]port trunk per vlan all
[SwitchB-if-range]quit

配置 VLAN 2。

[SwitchB] vlan 2
[SwitchB-vlan2] quit
[SwitchB] interface vlan-interface 2
[SwitchB-Vlan-interface2] ip address 10.1.1.2 255.255.255.128

创建备份组 1,并配置备份组 1 的虚拟 IP 地址为 10.1.1.100。

[SwitchB-Vlan-interface2] vrrp vrid 1 virtual-ip 10.1.1.100
[SwitchB-Vlan-interface2] quit

配置 VLAN 3。

[SwitchB] vlan 3
[SwitchB-vlan3] quit
[SwitchB] interface vlan-interface 3
[SwitchB-Vlan-interface3] ip address 10.1.1.131 255.255.255.128

创建备份组 2,并配置备份组 2 的虚拟 IP 地址为 10.1.1.200。

[SwitchB-Vlan-interface3] vrrp vrid 2 virtual-ip 10.1.1.200

设置 Switch B 在备份组 2 中的优先级为 110,高于 Switch A 的优先级 100,以保证在备份组 2

中 Switch B 成为 Master 负责转发流量。
[SwitchB-Vlan-interface3] vrrp vrid 2 priority 110
[SwitchA-Vlan-interface3]quit

[SwitchA]inter g 1/0/2
[SwitchA-GigabitEthernet1/0/2]port link-m r
[SwitchA-GigabitEthernet1/0/2]ip add 10.1.4.1 24
[SwitchA-GigabitEthernet1/0/2]undo shut
[SwitchA-GigabitEthernet1/0/2]quit

[SwitchA]ip route-static 0.0.0.0 0 10.1.4.2

转载于:https://blog.51cto.com/14224935/2405645

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值