HSRP+EIGRP Failover 自動切換機制

兩台設備+兩條線路達成自動備援切換機制,該如何做到

做法是使用HSRP+EIGRP,使用GNS3 模擬,設定皆在CE RT上,架構圖如下:
192.168.100.0/24 Data 網段,平常路由走在ISP1 RT,斷線或者設備故障切換ISP2 RT
172.16.100.0/24  VoIP 網段 ,平常路由走在ISP2 RT,斷線或者設備故障切換ISP1 RT
R1 & R3 建立GRE,R2 & R4建立GRE
R1 & R2 建立HSRP,R3 & R4建立HSRP,透過HSRP & Track & EIGRP機制自動切換路由

R1 設定 (ISP1)

...部分設定省略...
track 1 ip route 192.168.100.0 255.255.255.0 reachability #透過EIGRP track 192.168.100.0/24

interface Tunnel0
 description Data
 ip address 10.192.100.2 255.255.255.252
 tunnel source 192.168.101.253
 tunnel destination 192.168.100.253
!
interface FastEthernet0/0
 description WAN
 ip address 192.168.200.5 255.255.255.252
 duplex auto
 speed auto
!
interface FastEthernet0/1
 description LAN
 ip address 172.16.101.253 255.255.255.0 secondary
 ip address 192.168.101.253 255.255.255.0
 duplex auto
 speed auto
 standby 1 ip 192.168.101.254
 standby 1 preempt
 standby 1 track 1 decrement 50 #當Track down就降低HSRP Priority,切換走另外一條線路
 standby 2 ip 172.16.101.254
 standby 2 priority 90
 standby 2 preempt

router eigrp 100
 redistribute static #把靜態路由導入EIGRP
 network 10.192.100.0 0.0.0.3
 network 172.16.101.0 0.0.0.255
 network 192.168.101.0
 no auto-summary

ip route 0.0.0.0 0.0.0.0 192.168.101.1
ip route 172.16.100.253 255.255.255.255 192.168.200.6 
ip route 192.168.100.253 255.255.255.255 192.168.200.6

R2 設定 (ISP2)

...部分設定省略...
track 1 ip route 172.16.100.0 255.255.255.0 reachability #透過EIGRP Track 172.16.100.0

interface Tunnel0
 description VoIP
 ip address 10.192.101.2 255.255.255.252
 tunnel source 192.168.101.252
 tunnel destination 192.168.100.252
!
interface FastEthernet0/0
 description WAN
 ip address 172.16.200.5 255.255.255.252
 duplex auto
 speed auto
!
interface FastEthernet0/1
 description LAN
 ip address 172.16.101.252 255.255.255.0 secondary
 ip address 192.168.101.252 255.255.255.0
 duplex auto
 speed auto
 standby 1 ip 192.168.101.254
 standby 1 priority 90
 standby 1 preempt
 standby 2 ip 172.16.101.254
 standby 2 preempt
 standby 2 track 1 decrement 50 #當Track down就降低HSRP Priority,切換走另外一條線路

router eigrp 101
 redistribute static #把靜態路由導入EIGRP
 network 10.192.101.0 0.0.0.3
 network 172.16.101.0 0.0.0.255
 network 192.168.101.0
 no auto-summary

ip route 0.0.0.0 0.0.0.0 192.168.101.1
ip route 172.16.100.252 255.255.255.255 172.16.200.6
ip route 192.168.100.252 255.255.255.255 172.16.200.6 

R3 設定 (ISP1)

...部分設定省略...
track 1 ip route 192.168.101.0 255.255.255.0 reachability #透過EIGRP Track 192.168.101.0
interface Tunnel0
 description Data
 ip address 10.192.100.1 255.255.255.252
 tunnel source 192.168.100.253
 tunnel destination 192.168.101.253
!
interface FastEthernet0/0
 description WAN
 ip address 192.168.200.1 255.255.255.252
 duplex auto
 speed auto
!
interface FastEthernet0/1
 description LAN
 ip address 172.16.100.253 255.255.255.0 secondary
 ip address 192.168.100.253 255.255.255.0
 duplex auto
 speed auto
 standby 1 ip 192.168.100.254
 standby 1 preempt
 standby 1 track 1 decrement 50 #當Track down就降低HSRP Priority,切換走另外一條線路
 standby 2 ip 172.16.100.254
 standby 2 priority 90
 standby 2 preempt

router eigrp 100
 network 10.192.100.0 0.0.0.3
 network 172.16.100.0 0.0.0.255
 network 192.168.100.0
 no auto-summary

ip route 172.16.101.253 255.255.255.255 192.168.200.2
ip route 192.168.101.253 255.255.255.255 192.168.200.2

R4 設定(ISP2)

...部分設定省略...
track 1 ip route 172.16.101.0 255.255.255.0 reachability #透過EIGRP Track 172.16.101.0

interface Tunnel0
 description VoIP
 ip address 10.192.101.1 255.255.255.252
 tunnel source 192.168.100.252
 tunnel destination 192.168.101.252
!
interface FastEthernet0/0
 description WAN
 ip address 172.16.200.1 255.255.255.252
 duplex auto
 speed auto
!
interface FastEthernet0/1
 description LAN
 ip address 172.16.100.252 255.255.255.0 secondary
 ip address 192.168.100.252 255.255.255.0
 duplex auto
 speed auto
 standby 1 ip 192.168.100.254
 standby 1 priority 90
 standby 1 preempt
 standby 2 ip 172.16.100.254
 standby 2 preempt
 standby 2 track 1 decrement 50 #當Track down就降低HSRP Priority,切換走另外一條線路

router eigrp 101
 network 10.192.101.0 0.0.0.3
 network 172.16.100.0 0.0.0.255
 network 192.168.100.0
 no auto-summary

ip route 172.16.101.252 255.255.255.255 172.16.200.2
ip route 192.168.101.252 255.255.255.255 172.16.200.2

R1 HSRP Status

#show standby brief
Interface Grp Prio P State Active Standby Virtual IP
Fa0/1 1 100 P Active local 192.168.101.252 192.168.101.254
Fa0/1 2 90 P Standby 192.168.101.252 local 172.16.101.254

R1 Track Status

#show track brief
Track Object Parameter Value
1 ip route 192.168.100.0/24 reachability Up (EIGRP)

R1  eigrp neighbors

#sh ip eigrp neighbors
IP-EIGRP neighbors for process 100
H Address Interface Hold Uptime SRTT RTO Q Seq
 (sec) (ms) Cnt Num
0 10.192.100.1 Tu0 11 00:02:23 35 5000 0 3

斷線模擬
a.設備故障
b.線路故障

a.設備故障:測試方式,從PC3 ping PC1 ,R3關機後,查看ICMP狀態變動
R4會觸發HSRP切換從Standby成為Active

而R1 track down後會觸發decrement 讓HSRP切換從Active成為Standby
R2會觸發HSRP切換從Standby成為Active

ICMP狀態變更 從ISP1改走ISP2

b.線路故障:測試方式,從PC2 ping PC4,R6 f0/1 shutdown後,查看ICMP狀態變動
R4 track down後會觸發decrement 讓HSRP切換從Active成為Standby

R3 會觸發HSRP切換從Standby成為Active

R2 track down後會觸發decrement 讓HSRP切換從Active成為Standby

R1 會觸發HSRP切換從Standby成為Active

ICMP狀態變更 從ISP2改走ISP1

Facebook Comments