华为VRRP-基于交换机的VRRP配置

要求:在S2、S3上配置VRRP,以实现网关冗余,提高网络的可靠性,最后达到全网互通。其中PC1在vlan10下,PC 2在vlan20下,通过DHCP获取IP。

PC网关:100.1.10.1
PC2网关:100.1.20.1

华为VRRP-基于交换机的VRRP配置
S1配置

sys
sys S1
vlan batch 10 20
interface GigabitEthernet0/0/1
 port link-type access
 port default vlan 10
q
interface GigabitEthernet0/0/2
 port link-type access
 port default vlan 20
q
interface GigabitEthernet0/0/3
 port link-type trunk
 port trunk allow-pass vlan 10 20
q
interface GigabitEthernet0/0/4
 port link-type trunk
 port trunk allow-pass vlan 10 20
 

S2配置

在S2上vlanif10上的配置的VRRP虚拟路由为Master,vlanif20为Backup,在S3上与之相反,各自分担流量。
同时设置了路由追踪,防止上行链路故障可以达到自动调节

sys
sys S2
vlan batch 10 20
interface GigabitEthernet0/0/1
 port link-type trunk
 port trunk allow-pass vlan 10 20
interface GigabitEthernet0/0/2
 port link-type trunk
q
interface Vlanif1
 ip address 100.1.123.1 255.255.255.0
q
dhcp enable
ip pool vlan10
 gateway-list 100.1.10.1
 network 100.1.10.0 mask 255.255.255.0
 dns-list 8.8.8.8
q
ip pool vlan20
 gateway-list 100.1.20.1
 network 100.1.20.0 mask 255.255.255.0
 dns-list 8.8.8.8
q
interface Vlanif10
 ip address 100.1.10.11 255.255.255.0
 vrrp vrid 10 virtual-ip 100.1.10.1								//虚拟网关
 vrrp vrid 10 priority 200										//设置优先级为200,该设备为Master是主设备
 vrrp vrid 10 preempt-mode timer delay 10						//延迟抢占
 vrrp vrid 10 track interface GigabitEthernet0/0/2 reduced 101  //路由追踪
 dhcp select global
 q
 interface Vlanif20
 ip address 100.1.20.22 255.255.255.0
 vrrp vrid 20 virtual-ip 100.1.20.1
 dhcp select global
q
ospf 1 router-id 100.1.123.1
 area 0.0.0.0
  network 100.1.10.0 0.0.0.255
  network 100.1.20.0 0.0.0.255
  network 100.1.123.0 0.0.0.255

S3配置

sysname S3
vlan batch 10 20
q
dhcp enable
q
ip pool vlan10
 gateway-list 100.1.10.1
 network 100.1.10.0 mask 255.255.255.0
 dns-list 8.8.8.8
q
ip pool vlan20
 gateway-list 100.1.20.1
 network 100.1.20.0 mask 255.255.255.0
 dns-list 8.8.8.8
q
interface Vlanif1
 ip address 100.1.123.10 255.255.255.0
#
interface Vlanif10
 ip address 100.1.10.12 255.255.255.0
 vrrp vrid 10 virtual-ip 100.1.10.1
 dhcp select global
#
interface Vlanif20
 ip address 100.1.20.23 255.255.255.0
 vrrp vrid 20 virtual-ip 100.1.20.1
 vrrp vrid 20 priority 200
 vrrp vrid 20 preempt-mode timer delay 10
 vrrp vrid 20 track interface GigabitEthernet0/0/2 reduced 101  //路由追踪
 dhcp select global
q
interface GigabitEthernet0/0/1
 port link-type trunk
 port trunk allow-pass vlan 10 20
q
interface GigabitEthernet0/0/2
 port link-type trunk
q
ospf 1 router-id 100.10.123.2
 area 0.0.0.0
  network 100.1.10.0 0.0.0.255
  network 100.1.20.0 0.0.0.255
  network 100.1.123.0 0.0.0.255
q

S4不做配置

AR1配置

sys
sys AR1
interface GigabitEthernet0/0/0
 ip address 100.1.123.3 255.255.255.0 
q
interface GigabitEthernet0/0/1
 ip address 1.0.0.254 255.255.255.0 
q
interface GigabitEthernet0/0/2
q
ospf 1 router-id 100.1.123.3 
 area 0.0.0.0 
  network 1.0.0.0 0.0.0.255 
  network 100.1.10.0 0.0.0.255 
  network 100.1.20.0 0.0.0.255 
  network 100.1.123.0 0.0.0.255 

PC6配置

IPv4 address......................: 1.0.0.1
Subnet mask.......................: 255.255.255.0
Gateway...........................: 1.0.0.254
上一篇:接口(interface)知识点(重要)


下一篇:30_Go基础(接口)