Konfigurasi HSRP Beserta Penjelasan
HSRP (Hot Standby Router Protokol) adalah sebuah protokol ia berfungsi sebagai jalur redudancy gateway. maksdnya adalah apabila ada 1 LINK yang statusnya 'active' terputus, maka jalur satu lagi yang statusnya 'standby' akan segera 'active' dan akan segera membackup.
HSRP juga milik cisco yang dimana yang bisa menggunakna protokol tersebut ialah hanya vendor cisco saja. akan tetapi masih ada lagi protokol sejenis HSRP yaitu VRRP (Virtual Router Redudancy Protokol) cara kerjanyapun sama, yang membedakan kalo VRRP itu open yang artinya semua vendor bisa menggunakan VRRP.
oke, saya langsung saja ke tahap penjelasan topologinya. dan topologinya seperti ini
dari topologi tersebut saya menggunakan sub interface dikarenakan agar lebih memahami dari cara kerja HSRP itu tersendiri. di sini juga kita bisa melihat pada vlan 10-40 mereka semua memiliki Virtual IP. bisa dibilang Virtual IP itu berfungsi ketika suatu paket melewati gatewaynya, ia se olah-olah melewati Virtual IPnya. secara fisik Virtual IP itu 'tidak ada', akan tetapi secara Logic itu dia 'ada'.
untuk penetuan statusnya 'active' atau 'standby' ia akan memiliki prioritynya. apabila, prioritynya terbesar maka, ia akan menjadi bertindak 'active' dan apabila prioritynya kecil dia akan berintdak 'standby'. priority by default adalah 100 apabila kita tidak assign priortynya. maka, jika prioritynya sama yang statusnya 'active' adalah yang ip fisiknya terbesar.
pastikan setiap interface sudah dipasang IPnya
ISP(config)#do sh ip int br
Interface IP-Address OK? Method Status Protocol
GigabitEthernet0/0 10.1.1.1 YES manual up up
GigabitEthernet0/1 10.1.1.5 YES manual up up
GigabitEthernet0/2 unassigned YES NVRAM administratively down down
Loopback0 1.1.1.1 YES manual up up
Vlan1 unassigned YES NVRAM administratively down down
Router-ISP-1(config-if)#do sh ip int br
Interface IP-Address OK? Method Status Protocol
GigabitEthernet0/0 10.1.1.2 YES manual up up
GigabitEthernet0/1 unassigned YES NVRAM administratively down down
GigabitEthernet0/2 unassigned YES NVRAM administratively down down
Loopback0 3.3.3.3 YES manual up up
Vlan1 unassigned YES NVRAM administratively down down
Router-ISP-2(config)#do sh ip int br
Interface IP-Address OK? Method Status Protocol
GigabitEthernet0/0 10.1.1.6 YES manual up up
GigabitEthernet0/1 unassigned YES NVRAM administratively down down
GigabitEthernet0/2 unassigned YES NVRAM administratively down down
Loopback0 2.2.2.2 YES manual up up
Vlan1 unassigned YES NVRAM administratively down down
langkah pertama pastikan Router-ISP-1 bisa terhubung dengan Router-ISP-2 dengan memasukan routing protokol pada tiap router. disni saya menggunakan routing ospf
Router-ISP-1(config)#router ospf 1
Router-ISP-1(config-router)#network 3.3.3.3 0.0.0.0 area 0
Router-ISP-1(config-router)#network 10.1.1.0 0.0.0.3 area 0
Router-ISP-2(config)#router ospf 1
Router-ISP-2(config-router)#network 2.2.2.2 0.0.0.0 area 0
Router-ISP-2(config-router)#network 10.1.1.4 0.0.0.3 area 0
ISP(config)#router ospf 1
ISP(config-router)#network 1.1.1.1 0.0.0.0 area 0
ISP(config-router)#network 10.1.1.0 0.0.0.3 area 0
ISP(config-router)#network 10.1.1.4 0.0.0.3 area 0
Router_ISP-1(config-router)#do sh 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 not set
1.0.0.0/32 is subnetted, 1 subnets
O 1.1.1.1/32 [110/2] via 10.1.1.1, 00:00:34, GigabitEthernet0/0
2.0.0.0/32 is subnetted, 1 subnets
O 2.2.2.2/32 [110/3] via 10.1.1.1, 00:00:17, GigabitEthernet0/0
3.0.0.0/32 is subnetted, 1 subnets
C 3.3.3.3/32 is directly connected, Loopback0
10.0.0.0/8 is variably subnetted, 3 subnets, 2 masks
C 10.1.1.0/30 is directly connected, GigabitEthernet0/0
L 10.1.1.2/32 is directly connected, GigabitEthernet0/0
O 10.1.1.4/30 [110/2] via 10.1.1.1, 00:00:17, GigabitEthernet0/0
Router-ISP-1(config-router)#do ping 2.2.2.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 2.2.2.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 0/1/3 ms
pastikan juga bahwa Router-ISP-1 bisa terhubung dengan Router_ISP-2.
langkah kedua buat sub-interface pada tiap Router_ISP-1 dan Router_ISP-2.
#Router-ISP-2
Router-ISP-2(config)#int g0/1
Router-ISP-2(config-if)#no sh
%LINK-5-CHANGED: Interface GigabitEthernet0/1, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/1, changed state to up
Router-ISP-2(config-if)#exit
Router-ISP-2(config)#int g0/1.10
Router-ISP-2(config-subif)#
%LINK-5-CHANGED: Interface GigabitEthernet0/1.10, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/1.10, changed state to up
Router-ISP-2(config-subif)#encapsulation dot1Q 10
Router-ISP-2(config-subif)#ip add 192.168.1.3 255.255.255.128
Router-ISP-2(config-subif)#int g0/1.20
%LINK-5-CHANGED: Interface GigabitEthernet0/1.20, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/1.20, changed state to up
Router-ISP-2(config-subif)#encapsulation dot1Q 20
Router-ISP-2(config-subif)#ip add 192.168.1.131 255.255.255.192
Router-ISP-2(config-subif)#int g0/1.30
Router-ISP-2(config-subif)#
%LINK-5-CHANGED: Interface GigabitEthernet0/1.30, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/1.30, changed state to up
Router_ISP-2(config-subif)#encapsulation dot1Q 30
Router_ISP-2(config-subif)#ip add 192.168.1.195 255.255.255.224
Router_ISP-2(config-subif)#int g0/1.40
Router_ISP-2(config-subif)#
%LINK-5-CHANGED: Interface GigabitEthernet0/1.40, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/1.40, changed state to up
Router-ISP-2(config-subif)#encapsulation dot1Q 40
Router-ISP-2(config-subif)#ip add 192.168.1.227 255.255.255.240
#Router_ISP-1
Router-ISP-1(config)#int g0/1
Router-ISP-1(config-if)#no sh
%LINK-5-CHANGED: Interface GigabitEthernet0/1, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/1, changed state to up
Router-ISP-1(config-if)#exit
Router-ISP-1(config)#int g0/1.10
Router-ISP-1(config-subif)#
%LINK-5-CHANGED: Interface GigabitEthernet0/1.10, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/1.10, changed state to up
Router-ISP-1(config-subif)#encapsulation dot1Q 10
Router-ISP-1(config-subif)#ip add 192.168.1.3 255.255.255.128
Router-ISP-1(config-subif)#int g0/1.20
%LINK-5-CHANGED: Interface GigabitEthernet0/1.20, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/1.20, changed state to up
Router-ISP-1(config-subif)#encapsulation dot1Q 20
Router-ISP-1(config-subif)#ip add 192.168.1.131 255.255.255.192
Router-ISP-1(config-subif)#int g0/1.30
Router-ISP-1(config-subif)#
%LINK-5-CHANGED: Interface GigabitEthernet0/1.30, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/1.30, changed state to up
Router-ISP-1(config-subif)#encapsulation dot1Q 30
Router-ISP-1(config-subif)#ip add 192.168.1.195 255.255.255.224
Router-ISP-1(config-subif)#int g0/1.40
Router-ISP-1(config-subif)#
%LINK-5-CHANGED: Interface GigabitEthernet0/1.40, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/1.40, changed state to up
Router-ISP-1(config-subif)#encapsulation dot1Q 40
Router-ISP-1(config-subif)#ip add 192.168.1.227 255.255.255.240
masukan ip pada sub interface pada routing yang sebelumnya telah di buat.
Router-ISP-1(config)#router ospf 1
Router-ISP-1(config-router)#network 192.168.1.0 0.0.0.127 area 0
Router-ISP-1(config-router)#network 192.168.1.128 0.0.0.63 area 0
Router-ISP-1(config-router)#network 192.168.1.192 0.0.0.31 area 0
Router-ISP-1(config-router)#network 192.168.1.224 0.0.0.15 area 0
Router-ISP-2(config)#router ospf 1
Router-ISP-2(config-router)#network 192.168.1.0 0.0.0.127 area 0
Router-ISP-2(config-router)#network 192.168.1.128 0.0.0.63 area 0
Router-ISP-2(config-router)#network 192.168.1.192 0.0.0.31 area 0
Router-ISP-2(config-router)#network 192.168.1.224 0.0.0.15 area 0
langkah selanjutnya adalah membuat vlan 10-40 dan jangan lupa juga arahkan pc pada tiap interface sesuai vlan yang telah dibuat.
SW1(config)#vlan 10
SW1(config-vlan)#name collection-1
SW1(config-vlan)#vlan 20
SW1(config-vlan)#name collection-2
SW1(config-vlan)#vlan 30
SW1(config-vlan)#name banking-1
SW1(config-vlan)#vlan 40
SW1(config-vlan)#name banking-2
SW1(config-vlan)#int f0/2
SW1(config-if)#switchport access vlan 10
SW1(config-if)#exit
SW1(config)#int f0/3
SW1(config-if)#switchport access vlan 20
SW1(config-if)#exit
SW1(config)#int f0/4
SW1(config-if)#switchport access vlan 30
SW1(config-if)#exit
SW1(config)#int f0/5
SW1(config-if)#switchport access vlan 40
SW1(config-vlan)#do sh vlan br
VLAN Name Status Ports
---- -------------------------------- --------- -------------------------------
1 default active Fa0/7, Fa0/8, Fa0/9, Fa0/10
Fa0/11, Fa0/12, Fa0/13, Fa0/14
Fa0/15, Fa0/16, Fa0/17, Fa0/18
Fa0/19, Fa0/20, Fa0/21, Fa0/22
Gig0/1, Gig0/2
10 collection-1 active Fa0/2
20 collection-2 active Fa0/3
30 banking-1 active Fa0/4
40 banking-2 active Fa0/5
1002 fddi-default active
1003 token-ring-default active
1004 fddinet-default active
1005 trnet-default active
aktifkan jalur trunking pada switch bertujuan agar semua vlan di izinkan melewati interface yang menuju ke router. jangan lupa juga arahkan pc pada tiap interface sesuai vlan yang telah dibuat.
SW1(config)#int f0/1
SW1(config-if)#switchport mode trunk
SW1(config-if)#
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to down
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up
SW1(config-if)#exit
SW1(config)#int f0/6
SW1(config-if)#switchport mode trunk
SW1(config-if)#
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/6, changed state to down
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/6, changed state to up
SW1(config-if)#do sh int tr
Port Mode Encapsulation Status Native vlan
Po1 on 802.1q trunking 1
Fa0/1 on 802.1q trunking 1
Fa0/6 on 802.1q trunking 1
Port Vlans allowed on trunk
Po1 1-1005
Fa0/1 1-1005
Fa0/6 1-1005
Port Vlans allowed and active in management domain
Po1 1,10,20,30,40
Fa0/1 1,10,20,30,40
Fa0/6 1,10,20,30,40
Port Vlans in spanning tree forwarding state and not pruned
Po1 1,10,20,30,40
Fa0/1 none
Fa0/6 none
dengan menggunakan perintah "switchport mode trunk" maka, vlan 1-1005 di izinkan melewati jalur Fa0/1 dan Fa0/6.
langkah terakhir adalah mengaktifkan HSRP pada tiap interface yang telah di sesuaikan pada topologi. saya juga akan mencoba pada salah satu sub interface tidak saya kasih prioritynya apa yang akan terjadi ?
#ROUTER-ISP-1
Router-ISP-1(config-subif)#int g0/1.10
Router-ISP-1(config-subif)#standby 10 priority 200
Router-ISP-1(config-subif)#standby 10 ip 192.168.1.1
Router-ISP-1(config-subif)#standby preempt
Router-ISP-1(config-subif)#
00:26:00: %OSPF-5-ADJCHG: Process 1, Nbr 3.3.3.3 on GigabitEthernet0/1.30 from LOADING to FULL, Loading Done
%HSRP-6-STATECHANGE: GigabitEthernet0/1.10 Grp 0 state Speak -> Standby
%HSRP-6-STATECHANGE: GigabitEthernet0/1.10 Grp 0 state Standby -> Active
Router-ISP-1#show standby brief
P indicates configured to preempt.
|
Interface Grp Pri P State Active Standby Virtual IP
Gig 10 200 Active local 192.168.1.3 192.168.1.1
Router-ISP-1#show standby gigabitEthernet 0/1.10
GigabitEthernet0/1.10 - Group 10
State is Active
9 state changes, last state change 00:27:22
Virtual IP address is 192.168.1.1
Active virtual MAC address is 0000.0C07.AC0A
Local virtual MAC address is 0000.0C07.AC0A (v1 default)
Hello time 3 sec, hold time 10 sec
Next hello sent in 0.428 secs
Preemption disabled
Active router is local
Standby router is 192.168.1.3
Priority 200 (configured 200)
Group name is hsrp-Gig-10 (default)
#ROUTER-ISP-2
Router-ISP-2(config-subif)#int g0/1.10
Router-ISP-2(config-subif)#standby 10 priority 99
Router-ISP-2(config-subif)#standby 10 ip 192.168.1.1
Router-ISP-2(config-subif)#standby preempt
%HSRP-6-STATECHANGE: GigabitEthernet0/1.10 Grp 0 state Speak -> Standby
Router-ISP-2#show standby brief
P indicates configured to preempt.
|
Interface Grp Pri P State Active Standby Virtual IP
Gig 10 99 Standby 192.168.1.2 local 192.168.1.1
terlihat bahwa Router-ISP-2 statusnya menjadi 'standby', dikarenakan priorty lebih kecil daripada Router-ISP-1. maka, paket dengan network 192.168.1.0 /25 dia akan memilih jalur Router-ISP-1. yang dimana status dari Router-ISP-1 'active'.
terlihat bahwa paket dari source 192.168.1.5 /25 dengan destination 1.1.1.1 yaitu ip loopback dari internet tersebut. maka, data akan melewati HSRP yang statusnya dimana 'active'. apabila, status yang 'active' itu terputus (karena ada masalah) maka, jalur redudancy yang statusnya 'standby' akan segera membackup.
disini saya juga akan, mencoba mematikan Interface G0/1 pada Router-ISP-1 dengan cara menggunakan perintah 'shutdown'.
%HSRP-6-STATECHANGE: GigabitEthernet0/1.10 Grp 10 state Standby -> Active
Router-ISP-2(config)#do sh standby br
P indicates configured to preempt.
|
Interface Grp Pri P State Active Standby Virtual IP
Gig 10 99 Active local unknown 192.168.1.1
terlihat bahwa Router-ISP-2 statusnya telah menjadi 'active'.
karena kita telah menggunakan perintah 'preempt' maka, apabila jalur Router-ISP-1 sudah aktif kembali. maka, statusnya Router-ISP-2 akan menjadi 'standby' dan Router-ISP-1 akan menjadi 'active' akan paket akan memilih jalur yang statusnya 'active'
Router-ISP-1(config)#int g0/1
Router-ISP-1(config-if)#
%HSRP-6-STATECHANGE: GigabitEthernet0/1.10 Grp 10 state Speak -> Standby
%HSRP-6-STATECHANGE: GigabitEthernet0/1.10 Grp 10 state Standby -> Active
terlihat bahwa Router-ISP-1 statusnya aktif kembali apabila, saya telah membenarkan interface yang sebelumnya bermasalah.
Router-ISP-1(config-if)#do sh standby br
P indicates configured to preempt.
|
Interface Grp Pri P State Active Standby Virtual IP
Gig 10 200 Active local 192.168.1.3 192.168.1.1
lalu bagaimana? apabila prioritynya lupa dimasukan.
tentu saja, by default adalah 100. apabila kedua router sama prioritynya, maka. dia akan memilih ip interface yang terbesar dari kedua router tersebut. disini terlihat bahwa, ip interface pada Router-ISP-2 lebih besar daripada Router-ISP-1. maka dari itu, Router-ISP-2 dia statusnya 'active'.
#Router-ISP-1
Router-ISP-1(config)#int g0/1.20
Router-ISP-1(config-subif)#standby 9 ip 192.168.1.129
%HSRP-6-STATECHANGE: GigabitEthernet0/1.20 Grp 9 state Speak -> Standby
Router-ISP-1(config-subif)#do sh standby br
P indicates configured to preempt.
|
Interface Grp Pri P State Active Standby Virtual IP
Gig 10 200 Active local 192.168.1.3 192.168.1.1
Gig 9 100 Standby 192.168.1.131 local 192.168.1.129
Router-ISP-1#show standby gigabitEthernet 0/1.20
GigabitEthernet0/1.20 - Group 9
State is Standby
3 state changes, last state change 00:31:34
Virtual IP address is 192.168.1.129
Active virtual MAC address is 0000.0C07.AC09
Local virtual MAC address is 0000.0C07.AC09 (v1 default)
Hello time 3 sec, hold time 10 sec
Next hello sent in 2.484 secs
Preemption disabled
Active router is 192.168.1.131
Standby router is local
Priority 100 (default 100)
Group name is hsrp-Gig-9 (default)
#Router-ISP-2
Router-ISP-2(config)#int g0/1.20
Router-ISP-2(config-subif)#standby 9 ip 192.168.1.129
%HSRP-6-STATECHANGE: GigabitEthernet0/1.20 Grp 9 state Speak -> Standby
%HSRP-6-STATECHANGE: GigabitEthernet0/1.20 Grp 9 state Standby -> Active
Router-ISP-2(config-subif)#do sh standby br
P indicates configured to preempt.
|
Interface Grp Pri P State Active Standby Virtual IP
Gig 10 99 Standby 192.168.1.2 local 192.168.1.1
Gig 9 100 Active local 192.168.1.130 192.168.1.129
karena kita telah menggunakan perintah 'preempt' maka, apabila jalur Router-ISP-1 sudah aktif kembali. maka, statusnya Router-ISP-2 akan menjadi 'standby' dan Router-ISP-1 akan menjadi 'active' akan paket akan memilih jalur yang statusnya 'active'
Router-ISP-1(config)#int g0/1
Router-ISP-1(config-if)#
%HSRP-6-STATECHANGE: GigabitEthernet0/1.10 Grp 10 state Speak -> Standby
%HSRP-6-STATECHANGE: GigabitEthernet0/1.10 Grp 10 state Standby -> Active
terlihat bahwa Router-ISP-1 statusnya aktif kembali apabila, saya telah membenarkan interface yang sebelumnya bermasalah.
Router-ISP-1(config-if)#do sh standby br
P indicates configured to preempt.
|
Interface Grp Pri P State Active Standby Virtual IP
Gig 10 200 Active local 192.168.1.3 192.168.1.1
lalu bagaimana? apabila prioritynya lupa dimasukan.
tentu saja, by default adalah 100. apabila kedua router sama prioritynya, maka. dia akan memilih ip interface yang terbesar dari kedua router tersebut. disini terlihat bahwa, ip interface pada Router-ISP-2 lebih besar daripada Router-ISP-1. maka dari itu, Router-ISP-2 dia statusnya 'active'.
#Router-ISP-1
Router-ISP-1(config)#int g0/1.20
Router-ISP-1(config-subif)#standby 9 ip 192.168.1.129
%HSRP-6-STATECHANGE: GigabitEthernet0/1.20 Grp 9 state Speak -> Standby
Router-ISP-1(config-subif)#do sh standby br
P indicates configured to preempt.
|
Interface Grp Pri P State Active Standby Virtual IP
Gig 10 200 Active local 192.168.1.3 192.168.1.1
Gig 9 100 Standby 192.168.1.131 local 192.168.1.129
Router-ISP-1#show standby gigabitEthernet 0/1.20
GigabitEthernet0/1.20 - Group 9
State is Standby
3 state changes, last state change 00:31:34
Virtual IP address is 192.168.1.129
Active virtual MAC address is 0000.0C07.AC09
Local virtual MAC address is 0000.0C07.AC09 (v1 default)
Hello time 3 sec, hold time 10 sec
Next hello sent in 2.484 secs
Preemption disabled
Active router is 192.168.1.131
Standby router is local
Priority 100 (default 100)
Group name is hsrp-Gig-9 (default)
#Router-ISP-2
Router-ISP-2(config)#int g0/1.20
Router-ISP-2(config-subif)#standby 9 ip 192.168.1.129
%HSRP-6-STATECHANGE: GigabitEthernet0/1.20 Grp 9 state Speak -> Standby
%HSRP-6-STATECHANGE: GigabitEthernet0/1.20 Grp 9 state Standby -> Active
P indicates configured to preempt.
|
Interface Grp Pri P State Active Standby Virtual IP
Gig 10 99 Standby 192.168.1.2 local 192.168.1.1
Gig 9 100 Active local 192.168.1.130 192.168.1.129
0 Response to "Konfigurasi HSRP Beserta Penjelasan"
Post a Comment