Pengertian HSRP (Hot Standby Router Protocol)
Salam IT semuanya Kali ini kita akan membahas HSRP (Hot Standby Router Protocol.HSRP (Hot Standby Router Protocol) adalah Cisco-proprietary redundancy protocol untuk membangun toleransi kesalahan pada default gateway. HSRP menerapkan mekanisme failover transparent pada end device di dalam jaringan. Dalam hal ini user yang berada pada layer access(L2) tidak akan tergangu apabila primary default gateway mengalami gangguan dalam hal akses.
sesuai gambar diatas kita akan mengkonfigurasikan penggunaan HSRP dengan langkah-langkah sebagai berikut :
- Konfigurasi STP port fast di switch
- konfigurasi OSPF routing dan verifikasi di seiap router
- konfigurasi HSRP and verifikasi di router R-100 dan R-200
- konfigurasi Ethernet interface di PC0 dan server0 dan test failover
Konfigurasi STP Port fast di switch
- Switch>enable
- Switch#config term
- SWX#config)#hostname SWX
- SWX#config)#spanning-tree mode rapid-pvst
- SWX#config)#spanning-tree portfast default
Konfigurasi IP address pada setiap router dan OSPF routing di R-100 R-200 dan R-OUT
Router R-100
- Router>en
- Router#conf t
- Router(config)#hostname R-100
- R-100(config)#interface gi0/0
- R-100(config-if)#ip address 10.0.20.2 255.255.255.0
- R-100(config-if)#no shut
- R-100(config-if)#interface gi0/1
- R-100(config-if)#ip address 192.168.10.100 255.255.255.0
- R-100(config-if)#no shut
- R-100(config-if)#exit
- R-100(config)#router ospf 100
- R-100(config-router)#network 192.168.10.0 0.0.0.255 area 0
- R-100(config-router)#network 10.0.20.0 0.0.0.255 area 0
- R-100(config-router)#end
Router R-200
- Router>en
- Router#conf t
- Router(config)#hostname R-200
- R-200(config)#interface gi0/0
- R-200(config-if)#ip address 10.0.10.2 255.255.255.0
- R-200(config-if)#no shut
- R-200(config-if)#interface gi0/1
- R-200(config-if)#ip address 192.168.10.200 255.255.255.0
- R-200(config-if)#no shut
- R-200(config-if)#exit
- R-200(config)#router ospf 100
- R-200(config-router)#network 192.168.10.0 0.0.0.255 area 0
- R-200(config-router)#network 10.0.10.0 0.0.0.255 area 0
- R-200(config-router)#end
Router R-OUT
- Router>en
- Router#conf t
- Router(config)#hostname R-OUT
- R-OUT(config)#int gi0/0
- R-OUT(config-if)#ip address 10.0.10.1 255.255.255.0
- R-OUT(config-if)#no shut
- R-OUT(config-if)#int gi0/1
- R-OUT(config-if)#ip address 10.0.20.1 255.255.255.0
- R-OUT(config-if)#no shut
- R-OUT(config-if)#int gi0/2
- R-OUT(config-if)#ip add 172.16.10.1 255.255.255.0
- R-OUT(config-if)#no shut
- R-OUT(config-if)#exit
- R-OUT(config)#router ospf 100
- R-OUT(config-router)#network 10.1.20.0 0.0.0.255 area 0
- R-OUT(config-router)#network 10.1.10.0 0.0.0.255 area 0
- R-OUT(config-router)#default-information originate
- R-OUT(config-router)#exit
- R-OUT(config)#ip route 0.0.0.0 0.0.0.0 Gi0/2
- R-200#show ip route
- Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
- D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
- N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
- E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
- i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
- * - candidate default, U - per-user static route, o - ODR
- P - periodic downloaded static route
- Gateway of last resort is 10.0.20.1 to network 0.0.0.0
- 10.0.0.0/8 is variably subnetted, 3 subnets, 2 masks
- O 10.0.10.0/24 [110/2] via 10.0.20.1, 00:08:19, GigabitEthernet0/0
- C 10.0.20.0/24 is directly connected, GigabitEthernet0/0
- L 10.0.20.2/32 is directly connected, GigabitEthernet0/0
- 192.168.10.0/24 is variably subnetted, 2 subnets, 2 masks
- C 192.168.10.0/24 is directly connected, GigabitEthernet0/1
- L 192.168.10.200/32 is directly connected, GigabitEthernet0/1
- O*E2 0.0.0.0/0 [110/1] via 10.0.20.1, 00:05:50, GigabitEthernet0/0
Konfigurasi HSRP
Konfigurasi HSRP group 1 di R-100 dan R-200
menggunakan 192.168.10.100 sebagai standby virtual IP address. R-100
akan dikonfigurasi sebagai HSRP active default-gateway dan R-200 akan
dikonfigurasi sebagai standby preemption akan dikonfigurasikan di kedua
router.
Mengaktifkan HSRP di R-100
- R-100(config)#interface gi0/1
- R-100(config-if)#standby 1 ip 192.168.10.50
- R-100(config-if)#standby 1 preempt
- R-200(config)#interface gi0/1
- R-200(config-if)#standby 1 ip 192.168.10.50
- R-200(config-if)#standby 1 priority 95
- R-200(config-if)#standby 1 preempt
Pada konfigurasi diatas ada preempt
hal ini memastikan bila R-100 down lalu setelah beberapa saat up
kembali maka jalur data akan dikembalikan melewati R-100 kembali.
- R-100#show standby
- GigabitEthernet0/1 - Group 1 (version 2)
- State is Active
- 7 state changes, last state change 01:17:39
- Virtual IP address is 192.168.10.50
- Active virtual MAC address is 0000.0C9F.F001
- Local virtual MAC address is 0000.0C9F.F001 (v2 default)
- Hello time 3 sec, hold time 10 sec
- Next hello sent in 0.209 secs
- Preemption enabled
- Active router is local
- Standby router is 192.168.10.200
- Priority 100 (default 100)
- Group name is hsrp-Gig0/1-1 (default)
- R-100#sh standby brief
- P indicates configured to preempt.
- |
- Interface Grp Pri P State Active Standby Virtual IP
- Gig0/1 1 100 P Active local 192.168.10.200 192.168.10.50
- R-200#show standby brief
- P indicates configured to preempt.
- |
- Interface Grp Pri P State Active Standby Virtual IP
- Gig0/1 1 95 P Standby 192.168.10.100 local 192.168.10.50
pada step ini sudah 80% komplit jika saat
verifikasi HSRP tidak seperti diatas coba di cek lagi mungkin ada salah
atau kurang pada konfigurasi.
Konfigurasi Ethernet interface pada host PC dan
tes fungsi HSRP failover dengan mengkonfigurasi terlebih dahulu ip
address, netmask dan default gateway PC0 dan server0 sesuai table
diatas.
Tes konektivitas dengan ping dari PC0 ke server0
- PC>ping 172.16.10.2
- Pinging 172.16.10.2 with 32 bytes of data:
- Reply from 172.16.10.2: bytes=32 time=1ms TTL=126
- Reply from 172.16.10.2: bytes=32 time=18ms TTL=126
- Reply from 172.16.10.2: bytes=32 time=10ms TTL=126
- Reply from 172.16.10.2: bytes=32 time=16ms TTL=126
- Ping statistics for 172.16.10.2:
- Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
- Approximate round trip times in milli-seconds:
- Minimum = 1ms, Maximum = 18ms, Average = 11ms
- PC>tracert 172.16.10.2
- Tracing route to 172.16.10.2 over a maximum of 30 hops:
- 1 18 ms 0 ms 0 ms 192.168.10.100
- 2 12 ms 12 ms 12 ms 10.0.10.1
- 3 15 ms 11 ms 12 ms 172.16.10.2
- Trace complete.
Tes HSRP dengan ping
dari PCO ke server 0 menggunakan ping –t 172.16.10.2 Setelah ping
berjalan berikutnya adalah kita matikan interface g0/1 pada router
R-100.
- R-100#conf t
- R-100(config)#int gi0/1
- R-100(config-if)#shutdown
- %HSRP-6-STATECHANGE: GigabitEthernet0/1 Grp 1 state Active -> Init
- %LINK-5-CHANGED: Interface GigabitEthernet0/1, changed state to administratively down
- %LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/1, changed state to down
- 00:19:08: %OSPF-5-ADJCHG: Process 100, Nbr 192.168.10.200 on GigabitEthernet0/1 from FULL to DOWN, Neighbor Down: Interface down or detached
Lihat di console R-200 notifikasi dari standby ke active
- %HSRP-6-STATECHANGE: GigabitEthernet0/1 Grp 1 state Standby -> Active
- 00:19:40: %OSPF-5-ADJCHG: Process 100, Nbr 192.168.10.100 on GigabitEthernet0/1 from FULL to DOWN, Neighbor Down: Dead timer expired
- 00:19:40: %OSPF-5-ADJCHG: Process 100, Nbr 192.168.10.100 on GigabitEthernet0/1 from FULL to DOWN, Neighbor Down: Interface down or detached
Hasil ping di PC pun sempat RTO sebentar lalu reply kembali
- Reply from 172.16.10.2: bytes=32 time=0ms TTL=126
- Reply from 172.16.10.2: bytes=32 time=0ms TTL=126
- Reply from 172.16.10.2: bytes=32 time=0ms TTL=126
- Request timed out.
- Reply from 172.16.10.2: bytes=32 time=1ms TTL=126
- Reply from 172.16.10.2: bytes=32 time=1ms TTL=126
- Reply from 172.16.10.2: bytes=32 time=1ms TTL=126
- R-100(config-if)#no shutdown
- %LINK-5-CHANGED: Interface GigabitEthernet0/1, changed state to up
- %LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/1, changed state to up
- %HSRP-6-STATECHANGE: GigabitEthernet0/1 Grp 1 state Standby -> Active
sekian dan selamat mencoba ^^
Tidak ada komentar:
Write komentar