首页 > 代码库 > Cisco VRRP Config Case1

Cisco VRRP Config Case1

实验图如下图示:

技术分享

实验连线如下:
R1 f0/0 <—> ESW1 f0/0
R1 f0/1 <—> ESW2 f0/1
R2相当于PC1,关闭路由器功能后,设置f0/1接口地址为192.168.1.1/24和网关192.168.1.254。
R3相当于PC2,关闭路由器功能后,设置f0/0接口地址为192.168.2.2/24和网关192.168.2.254。
ESW1 f0/14 <—> ESW2 f0/14
ESW1 f0/15 <—> ESW2 f0/15
ESW1 f1/1  <—> R2 f0/1
ESW2 f1/0  <—> R3 f0/0
实验效果:
当配置完成后,R2能够与R3互通,VRRP Master全部由ESW1接管。
当断开ESW1上连R1的接口后,VRRP Master全部由ESW2接管,R2还是能够与R3互通。

R1:
interface Loopback0
 ip address 1.1.1.1 255.255.255.255
interface FastEthernet0/0
 ip address 12.1.1.1 255.255.255.0
 no sh
interface FastEthernet0/1
 ip address 13.1.1.1 255.255.255.0
 no sh
router rip
 network 1.0.0.0
 network 12.0.0.0
 network 13.0.0.0

ESW1:
interface Loopback0
 ip address 2.2.2.2 255.255.255.255
interface Port-channel1
 switchport mode trunk
interface FastEthernet0/0
 ip address 12.1.1.2 255.255.255.0
 no sh
interface FastEthernet1/1
 switchport access vlan 10
 no sh
interface FastEthernet1/14
 switchport mode trunk
 duplex full
 speed 100
 channel-group 1 mode on
 no sh
interface FastEthernet1/15
 switchport mode trunk
 duplex full
 speed 100
 channel-group 1 mode on
 no sh
track 1 interface FastEthernet0/0 line-protocol
track 2 interface Port-channel1 line-protocol
interface Vlan10
 ip address 192.168.1.251 255.255.255.0
 vrrp 10 ip 192.168.1.254
 vrrp 10 priority 130
 vrrp 10 track 1
 vrrp 10 track 2
interface Vlan20
 ip address 192.168.2.251 255.255.255.0
 vrrp 20 ip 192.168.2.254
 vrrp 20 priority 120
 vrrp 20 track 1
 vrrp 20 track 2
router rip
 network 2.0.0.0
 network 12.0.0.0
 network 192.168.1.0
 network 192.168.2.0

ESW2:
interface Loopback0
 ip address 3.3.3.3 255.255.255.255
interface Port-channel1
 switchport mode trunk
 no sh
interface FastEthernet0/1
 ip address 13.1.1.3 255.255.255.0
 no sh
interface FastEthernet1/0
 switchport access vlan 20
 duplex full
 speed 100
 no sh
interface FastEthernet1/14
 switchport mode trunk
 duplex full
 speed 100
 channel-group 1 mode on
 no sh
interface FastEthernet1/15
 switchport mode trunk
 duplex full
 speed 100
 channel-group 1 mode on
 no sh
track 1 interface FastEthernet0/1 line-protocol
track 2 interface Port-channel1 line-protocol
interface Vlan10
 ip address 192.168.1.252 255.255.255.0
 vrrp 10 ip 192.168.1.254
 vrrp 10 priority 120
 vrrp 10 track 1
 vrrp 10 track 2
interface Vlan20
 ip address 192.168.2.252 255.255.255.0
 vrrp 20 ip 192.168.2.254
 vrrp 20 priority 110
 vrrp 20 track 1
 vrrp 20 track 2
router rip
 network 3.0.0.0
 network 13.0.0.0
 network 192.168.1.0
 network 192.168.2.0

R2:
no ip routing
interface FastEthernet0/1
 ip address 192.168.1.1 255.255.255.0
 no sh
ip default-gateway 192.168.1.254

R3:
no ip routing
interface FastEthernet0/0
 ip address 192.168.2.2 255.255.255.0
 no sh
ip default-gateway 192.168.2.254

ESW1:
config t
int f0/0
sh
当断开与R1上连后,VRRP Master开始发生变化了,原来在ESW1的Master全部变成Backup状态。
*Mar  1 00:10:43.283: %VRRP-6-STATECHANGE: Vl10 Grp 10 state Master -> Backup
*Mar  1 00:10:43.287: %VRRP-6-STATECHANGE: Vl20 Grp 20 state Master -> Backup

 

Cisco VRRP Config Case1