[数通]VRRP配置

[数通]VRRP配置

image

配置

R1:

#
sysname R1
#
vlan batch 10 20 30 40
#
aaa 
 authentication-scheme default
 authorization-scheme default
 accounting-scheme default
 domain default 
 domain default_admin 
 local-user admin password cipher oRE|2@TqG~ECB7Ie7'/)sId#
 local-user admin service-type http
#
firewall zone Local
 priority 16
#
interface Ethernet0/0/0
 ip address 10.1.11.1 255.255.255.0 
#
interface Ethernet0/0/1
 ip address 10.1.12.1 255.255.255.0 
#
interface Serial0/0/0
 link-protocol ppp
#
interface Serial0/0/1
 link-protocol ppp
#
interface Serial0/0/2
 link-protocol ppp
#
interface Serial0/0/3
 link-protocol ppp
#
interface GigabitEthernet0/0/0
#
interface GigabitEthernet0/0/1
#
interface GigabitEthernet0/0/2
#
interface GigabitEthernet0/0/3
#
wlan
#
interface NULL0
#
interface LoopBack0
 ip address 1.1.1.1 255.255.255.255 
#
ospf 1 
 area 0.0.0.0 
  network 0.0.0.0 255.255.255.255 
#
user-interface con 0
user-interface vty 0 4
user-interface vty 16 20
#
return 

LSW1:


#
sysname SW1
#
vlan batch 10 20 30 40
#
cluster enable
ntdp enable
ndp enable
#
drop illegal-mac alarm
#
diffserv domain default
#
drop-profile default
#
aaa 
 authentication-scheme default
 authorization-scheme default
 accounting-scheme default
 domain default 
 domain default_admin 
 local-user admin password simple admin
 local-user admin service-type http
#
interface Vlanif1
#
interface Vlanif10
 ip address 192.168.10.251 255.255.255.0 
 vrrp vrid 10 virtual-ip 192.168.10.254
 vrrp vrid 10 priority 150
 vrrp vrid 10 track interface Vlanif30 reduced 100
 vrrp vrid 10 authentication-mode simple huawei
#
interface Vlanif20
 ip address 192.168.20.251 255.255.255.0 
 vrrp vrid 20 virtual-ip 192.168.20.254
 vrrp vrid 20 authentication-mode md5 G7z}ED2IJHEBi%T]n/.I%yG#
#
interface Vlanif30
 ip address 10.1.11.2 255.255.255.0 
#
interface MEth0/0/1
#
interface GigabitEthernet0/0/1
 port link-type trunk
 port trunk allow-pass vlan 2 to 4094
#
interface GigabitEthernet0/0/2
 port link-type access
 port default vlan 30
#
interface GigabitEthernet0/0/3
#
interface GigabitEthernet0/0/4
#
interface GigabitEthernet0/0/5
#
interface GigabitEthernet0/0/6
#
interface GigabitEthernet0/0/7
#
interface GigabitEthernet0/0/8
 port link-type trunk
 port trunk allow-pass vlan 2 to 4094
#
interface GigabitEthernet0/0/9
 port link-type trunk
 port trunk allow-pass vlan 2 to 4094
#
interface GigabitEthernet0/0/10
#
interface GigabitEthernet0/0/11
#
interface GigabitEthernet0/0/12
#
interface GigabitEthernet0/0/13
#
interface GigabitEthernet0/0/14
#
interface GigabitEthernet0/0/15
#
interface GigabitEthernet0/0/16
#
interface GigabitEthernet0/0/17
#
interface GigabitEthernet0/0/18
#
interface GigabitEthernet0/0/19
#
interface GigabitEthernet0/0/20
#
interface GigabitEthernet0/0/21
#
interface GigabitEthernet0/0/22
#
interface GigabitEthernet0/0/23
#
interface GigabitEthernet0/0/24
#
interface NULL0
#
ospf 1 
 area 0.0.0.0 
  network 0.0.0.0 255.255.255.255 
#
user-interface con 0
user-interface vty 0 4
#
port-group 1
 group-member GigabitEthernet0/0/1
 group-member GigabitEthernet0/0/8
 group-member GigabitEthernet0/0/9
#
return 

LSW2:


#
sysname SW2
#
vlan batch 10 20 30 40
#
cluster enable
ntdp enable
ndp enable
#
drop illegal-mac alarm
#
diffserv domain default
#
drop-profile default
#
aaa 
 authentication-scheme default
 authorization-scheme default
 accounting-scheme default
 domain default 
 domain default_admin 
 local-user admin password simple admin
 local-user admin service-type http
#
interface Vlanif1
#
interface Vlanif10
 ip address 192.168.10.252 255.255.255.0 
 vrrp vrid 10 virtual-ip 192.168.10.254
 vrrp vrid 10 authentication-mode simple huawei
#
interface Vlanif20
 ip address 192.168.20.252 255.255.255.0 
 vrrp vrid 20 virtual-ip 192.168.20.254
 vrrp vrid 20 priority 150
 vrrp vrid 20 track interface Vlanif40 reduced 100
 vrrp vrid 20 authentication-mode md5 lGWb~5*<J,Wq<}.DH-])0x9#
#
interface Vlanif40
 ip address 10.2.11.2 255.255.255.0 
#
interface MEth0/0/1
#
interface GigabitEthernet0/0/1
 port link-type access
 port default vlan 40
#
interface GigabitEthernet0/0/2
#
interface GigabitEthernet0/0/3
#
interface GigabitEthernet0/0/4
 port link-type trunk
 port trunk allow-pass vlan 2 to 4094
#
interface GigabitEthernet0/0/5
 port link-type trunk
 port trunk allow-pass vlan 2 to 4094
#
interface GigabitEthernet0/0/6
#
interface GigabitEthernet0/0/7
#
interface GigabitEthernet0/0/8
#
interface GigabitEthernet0/0/9
#
interface GigabitEthernet0/0/10
 port link-type trunk
 port trunk allow-pass vlan 2 to 4094
#
interface GigabitEthernet0/0/11
#
interface GigabitEthernet0/0/12
#
interface GigabitEthernet0/0/13
#
interface GigabitEthernet0/0/14
#
interface GigabitEthernet0/0/15
#
interface GigabitEthernet0/0/16
#
interface GigabitEthernet0/0/17
#
interface GigabitEthernet0/0/18
#
interface GigabitEthernet0/0/19
#
interface GigabitEthernet0/0/20
#
interface GigabitEthernet0/0/21
#
interface GigabitEthernet0/0/22
#
interface GigabitEthernet0/0/23
#
interface GigabitEthernet0/0/24
#
interface NULL0
#
ospf 1 
 area 0.0.0.0 
  network 0.0.0.0 255.255.255.255 
#
user-interface con 0
user-interface vty 0 4
#
port-group 1
 group-member GigabitEthernet0/0/4
 group-member GigabitEthernet0/0/5
 group-member GigabitEthernet0/0/10
#
return 

关键配置:

  1. 监测上行链路的track
#上行链路关闭,优先级减少100,即150-100=50,这个时候就会发生主备的切换
vrrp vrid 10 track interface Vlanif30 reduced 100
  1. vrrp接口密码配置
#明文
vrrp vrid 10 authentication-mode simple huawei
#密文
vrrp vrid 20 authentication-mode md5 lGWb~5*<J,Wq<}.DH-])0x9#
posted @ 2021-06-10 11:46  SkyBiuBiu  阅读(161)  评论(0编辑  收藏  举报