HSRP与链路追踪
1、链路追踪的概念:当网络中存在着HSRP的备份路由器时,可以配置HSRP的上行链路追踪,当指定的追踪接口down掉时,马上减小该HSRP设备的优先级,使另一个备份设备能马上被激活成为ACTIVE状态,并接替down掉的设备继续引导路由数据,实现网络的畅通性
2、拓扑规划:
3、案例实施:
1)、各设备配置:
R1配置:
1
2
3
4
5
6
7
8
9
10
11
interface Loopback0
ipaddress 202.102.12.1 255.255.255.0
interface Serial1/0
ipaddress 172.16.0.1 255.255.255.252
serial restart-delay 0
clock rate 64000
!
interface Serial1/1
ipaddress 172.16.0.5 255.255.255.252
serial restart-delay 0
clock rate 64000
R2配置:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
interface FastEthernet0/0.10
encapsulation dot1Q 10
ipaddress 192.168.10.1 255.255.255.0
ipnat inside
ipvirtual-reassembly
standby 10 ip 192.168.10.254
standby 10 priority 120
standby 10 preempt
standby 10 track Serial1/0 30
!
interface FastEthernet0/0.20
encapsulation dot1Q 20
ipaddress 192.168.20.1 255.255.255.0
ipnat inside
ipvirtual-reassembly
standby 20 ip 192.168.20.254
standby 20 preempt
interface Serial1/0
ipaddress 172.16.0.2 255.255.255.252
ipnat outside
ipvirtual-reassembly
serial restart-delay 0
ip route 0.0.0.0 0.0.0.0 Serial1/0
ip nat inside source list 100 interfaceSerial1/0 overload
R3配置:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
interface FastEthernet0/0.10
encapsulation dot1Q 10
ipaddress 192.168.10.2 255.255.255.0
ipnat inside
ipvirtual-reassembly
standby 10 ip 192.168.10.254
standby10 preempt
!
interface FastEthernet0/0.20
encapsulation dot1Q 20
ipaddress 192.168.20.2 255.255.255.0
ipnat inside
ipvirtual-reassembly
standby 20 ip 192.168.20.254
standby 20 priority 120
standby 20 preempt
standby 20 track Serial1/1 30
interface Serial1/1
ipaddress 172.16.0.5 255.255.255.252
ipnat outside
ipvirtual-reassembly
serial restart-delay 0
ip route 0.0.0.0 0.0.0.0 Serial1/1
ip nat inside source list 100 interfaceSerial1/1 overload
Sw1配置:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
interface FastEthernet0/0
switchport mode trunk
!
interface FastEthernet0/1
switchport mode trunk
!
interface FastEthernet0/2
switchport mode trunk
!
interface FastEthernet0/3
switchport access vlan 10
!
interface FastEthernet0/4
switchport access vlan 20
vlan database
vlan10
vlan20
Sw2配置:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
interface FastEthernet0/0
switchport mode trunk
!
interface FastEthernet0/1
switchport mode trunk
!
interface FastEthernet0/2
switchport mode trunk
!
interface FastEthernet0/3
switchport access vlan 10
!
interface FastEthernet0/4
switchport access vlan 20
vlan database
vlan10
vlan20
PC1配置:
1
2
3
4
5
6
7
8
9
no ip routing
interface FastEthernet0/0
ipaddress 192.168.10.100 255.255.255.0
noip route-cache
duplex auto
speed auto
ip default-gateway 192.168.10.254
PC2配置:
1
2
3
4
5
6
7
8
9
no ip routing
interface FastEthernet0/0
ipaddress 192.168.20.100 255.255.255.0
noip route-cache
duplex auto
speed auto
ip default-gateway 192.168.20.254
PC3配置:
1
2
3
4
5
6
7
8
9
no ip routing
interface FastEthernet0/0
ipaddress 192.168.10.200 255.255.255.0
noip route-cache
duplexauto
speed auto
ip default-gateway 192.168.10.254
PC4配置:
1
2
3
4
5
6
7
no ip routing
interface FastEthernet0/0
ipaddress 192.168.20.200 255.255.255.0
noip route-cache
ip default-gateway 192.168.20.254
2)、配置完成后查看R2和R3的HSRP信息:
R2:
R3:
此时在PC2上跟踪一下到202.102.12.1的路由情况
在PC3上跟踪到202.102.12.1的路有情况
此时将R1的接口S1/0设置为shutdown模式,再查看HSRP信息:
R2:
R3:
此时再在PC1和PC2上跟踪到202.102.12.1的路由,发现R3自动接管原先的路由:
PC1:
PC3:
页:
[1]