【ENSP模拟器】ENSP——VRRP的配置⽰例本篇主要讲解的是VRRP协议的配置过程和VRRP的⼏个⼩实验。
黄有龙为赵薇庆生(1)案例1:基础VRRP
完成简单并且基础的VRRP配置
#
sysname R2
#
interface GigabitEthernet0/0/2
ip address 192.168.1.253 255.255.255.0
vrrp vrid 1 virtual-ip 192.168.1.254
vrrp vrid 1 priority 120
vrrp vrid 1 preempt-mode timer delay 60
金瀚恋情疑曝光
#
sysname R3
#
interface GigabitEthernet0/0/1
ip address 192.168.1.252 255.255.255.0
vrrp vrid 1 virtual-ip 192.168.1.254
检查:
display vrrp:在R1上使⽤检查⼀下配置结果;
杨澜前夫张一兵
display vrrp brief:在R2上检查VRRP的运⾏状态。
(2)案例2:监视上⾏链路
之前介绍了,Master路由器会周期性的发送VRRP报⽂,以便告知同⼀个VRRP组中的Backup路由器⾃⼰的存活情况。缺省时,VRRP时⽆法感知的上⾏链路是否发送故障或者是上⾏接⼝故障,所以⼀旦发送故障,PC机发送的数据包仍然转发给失效的接⼝,所以我们可以在VRRP路由器上配置VRRP监视(Track)功能,通过这个功能来监视上⾏接⼝,当感知到接⼝的切换到Down时,会⾃动将VRRP的优先级减去⼀个值,从⽽使Backup上位。
#
sysname R1
#
interface GigabitEthernet0/0/1
ip address 192.168.1.253 255.255.255.0
vrrp vrid 1 virtual-ip 192.168.1.254
vrrp vrid 1 priority 120
vrrp vrid 1 track interface GigabitEthernet0/0/0 reduced 30 #监视命令,若接⼝Down则优先级-30
#
sysname R2
#
interface GigabitEthernet0/0/2
ip address 192.168.1.252 255.255.255.0
广播电视新闻学
vrrp vrid 1 virtual-ip 192.168.1.254
(3)案例3:在路由器⼦接⼝上部署VRRP
正常情况下从PC到达外部⽹络的数据始终被发往Master路由器,在Master路由器发送故障之前,Backup路由器始终不承担数据转发任务,交换机与Backup路由器之间的这段链路也不会承担业务数据,这就造成了设备资源和链路带宽的浪费。在某些⽹络中,⽹关路由器的性能以及链路的带宽⾜以承载所有的业务流量,这种⼀主⼀备的VRRP⼯作⽅式确实能够满⾜需求,然⽽当业务流量特别⼤⽽路由器的性能及链路带宽⼜存在瓶颈时,就不得不考虑让另⼀台路由器也参与到业务流量转发的⼯作中来。
#
sysname SW1
#
vlan batch 10 20
#
interface Ethernet0/0/1
port link-type access
port default vlan 20
#
interface Ethernet0/0/2
port link-type access
port default vlan 10
#
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 2 to 4094
#
interface GigabitEthernet0/0/2
port link-type trunk
port trunk allow-pass vlan 2 to 4094
#
sysname R1
#
interface GigabitEthernet0/0/1.10
dot1q termination vid 10
dot1q vrrp vid 10 #(重要)
ip address 192.168.10.253 255.255.255.0 vrrp vrid 10 virtual-ip 192.168.10.254
vrrp vrid 10 priority 120
arp broadcast enable
#
interface GigabitEthernet0/0/1.20
dot1q termination vid 20
dot1q vrrp vid 20 #(重要)
ip address 192.168.20.253 255.255.255.0 vrrp vrid 20 virtual-ip 192.168.20.254
arp broadcast enable
interface GigabitEthernet0/0/2.10
dot1q termination vid 10
dot1q vrrp vid 10 #(重要)
ip address 192.168.10.252 255.255.255.0
vrrp vrid 10 virtual-ip 192.168.10.254
arp broadcast enable
#
interface GigabitEthernet0/0/2.20
dot1q termination vid 20
dot1q vrrp vid 20 #(重要)
ip address 192.168.20.252 255.255.255.0
vrrp vrid 20 virtual-ip 192.168.20.254
vrrp vrid 20 priority 120
arp broadcast enable
(4)案例4:在三层交换机上部署VRRP
实际上,许多交换机及防⽕墙产品也是⽀持VRRP的,在传统的双核⼼园区⽹络中,企业会部署两台核⼼层交换机作为内⽹⽤户的⽹关设备,并在这两台交换机上采⽤VRRP来实现⽹关的冗余,这以及成为⼀个经典的解决⽅案。
vlan batch 10 20
#
interface Ethernet0/0/1
port link-type access
port default vlan 10
#
interface Ethernet0/0/2
port link-type access
port default vlan 20
#
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 2 to 4094
#
interface GigabitEthernet0/0/2
port link-type trunk
port trunk allow-pass vlan 2 to 4094
#
sysname SW2
#
vlan batch 10 20
#
interface Vlanif10
ip address 192.168.10.253 255.255.255.0 vrrp vrid 10 virtual-ip 192.168.10.254
乡村爱情7演员表
vrrp vrid 10 priority 120
#
interface Vlanif20
羊字成语
ip address 192.168.20.253 255.255.255.0 vrrp vrid 20 virtual-ip 192.168.20.254
#
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 2 to 4094
#
sysname SW3
#
vlan batch 10 20
#
interface Vlanif10
ip address 192.168.10.252 255.255.255.0 vrrp vrid 10 virtual-ip 192.168.10.254
#
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 120
#
interface GigabitEthernet0/0/2
port link-type trunk
port trunk allow-pass vlan 2 to 4094