LAB 11. BGP Dual Homing – ISP sama

 

BGP Dualhoming yaitu Dua Link ke ISP yang sama dengan fitur sebagai berikut
    a. Main-Backup Mode
    b. Load Sharing Mode
Sedangkan BGP multihoming yaitu Dua Link ke ISP yang berbeda dengan fitur :
    a. Main-Backup Mode
    b. Load Sharing Mode


Pertama konfigurasikan dulu ip dan routing bgp
R1:
R1(config)#int g1/0
R1(config-if)#ip add 12.12.12.1 255.255.255.0
R1(config-if)#no shutdown
R1(config)#int g2/0
R1(config-if)#ip add 13.13.13.1 255.255.255.0
R1(config-if)#no shutdown
R1(config)#int loopback 0
R1(config-if)#ip add 1.1.1.1 255.255.255.255
R1(config-if)#router bgp 1
R1(config-router)#neighbor 12.12.12.2 remote-as 23
R1(config-router)#neighbor 13.13.13.3 remote-as 23
R1(config-router)#network 1.1.1.1 mask 255.255.255.255

R2:
R2(config)#int g2/0
R2(config-if)#ip add 12.12.12.2 255.255.255.0
R2(config-if)#no shutdown
R2(config-if)#int f0/0
R2(config-if)#ip add 23.23.23.2 255.255.255.0
R2(config-if)#no shutdown
R2(config-if)#int g1/0
R2(config-if)#ip add 24.24.24.2 255.255.255.0
R2(config-if)#no shutdown
R2(config)#int lo0
R2(config-if)#ip add 2.2.2.2 255.255.255.255
R2(config-if)#router bgp 23
R2(config-router)#neighbor 12.12.12.1 remote-as 1
R2(config-router)#neighbor 23.23.23.3 remote-as 23
R2(config-router)#neighbor 24.24.24.4 remote-as 4
R2(config-router)#network 2.2.2.2 mask 255.255.255.255
R2(config-router)#neighbor 23.23.23.3 next-hop-self

R3:
R3(config)#int g1/0
R3(config-if)#ip add 13.13.13.3 255.255.255.0
R3(config-if)#no shutdown
R3(config)#int f0/0
R3(config-if)#ip add 23.23.23.3 255.255.255.0
R3(config-if)#no shutdown
R3(config-if)#exit
R3(config)#int g2/0
R3(config-if)#ip add 34.34.34.3 255.255.255.0
R3(config-if)#no shutdown
R3(config)#router bgp 23
R3(config-router)#neighbor 13.13.13.1 remote-as 1
R3(config-router)#neighbor 23.23.23.2 remote-as 23
R3(config-router)#neighbor 34.34.34.4 remote-as 4
R3(config-router)#neighbor 23.23.23.2 next-hop-self

R4:
R4(config)#int g1/0
R4(config-if)#ip add 24.24.24.4 255.255.255.0
R4(config-if)#no shutdown
R4(config)#int g2/0
R4(config-if)#ip add 34.34.34.4 255.255.255.0
R4(config-if)#no shutdown
R4(config)#int lo0
R4(config-if)#ip add 4.4.4.4 255.255.255.255
R4(config)#router bgp 4
R4(config-router)#neighbor 24.24.24.2 remote-as 23
R4(config-router)#neighbor 34.34.34.3 remote-as 23s
R4(config-router)#network 4.4.4.4 mask 255.255.255.255

Kita cek terlebih dahulu
R1:
R1(config)#do show ip bgp
Network Next Hop Metric LocPrf Weight Path
*> 1.1.1.1/32 0.0.0.0 0 32768 i
* 2.2.2.2/32 13.13.13.3 0 23 i
*> 12.12.12.2 0 0 23 i
* 4.4.4.4/32 13.13.13.3 0 23 4 i
*> 12.12.12.2 0 23 4 i

Kesimpulannya, walaupun sudah menggunakan 2 link, namun tetap saja hanya 1 link yang digunakan. Sekarang kita akan shutdown port int s0/0 (12.12.12.1/24) sehingga paket tidak lagi melalui R2.

R1:
R1(config)#int g1/0
R1(config-if)#shutdown

R1:
R1(config)#do sh ip bgp
Network Next Hop Metric LocPrf Weight Path
*> 1.1.1.1/32 0.0.0.0 0 32768 i
*> 4.4.4.4/32 13.13.13.3 0 23 4 i

R1:
R1(config)#do show ip route bgp
4.0.0.0/32 is subnetted, 1 subnets
B 4.4.4.4 [20/0] via 13.13.13.3, 00:06:47

Oke. Saat ini linknya sudah berpindah melalui R3. Kemudian, kita tes kembali dengan cara kita no shutdown pada port yang menuju ke R2.

R1:
R1(config)#int g1/0
R1(config-if)#no sh

R1:
R1(config)#do sh ip bgp
BGP table version is 5, local router ID is 1.1.1.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
*> 1.1.1.1/32 0.0.0.0 0 32768 i
* 4.4.4.4/32 12.12.12.2 0 23 4 i
*> 13.13.13.3 0 23 4 i

R1#sh ip route bgp
4.0.0.0/32 is subnetted, 1 subnets
B 4.4.4.4 [20/0] via 13.13.13.3, 00:32:17

Ternyata hasilnya menarik, tidak mau otomatis pindah ke R2 lagi. Agar memastikan link ke R2 menjadi main link, maka kita konfigurasikan attribute weight.

R1:
R1(config)#route-map WEIGHT
R1(config-route-map)#set weight 100
R1(config-route-map)#exit
R1(config)#router bgp 1
R1(config-router)#neighbor 12.12.12.2 route-map WEIGHT in
R1(config-router)#exit
R1(config)#do clear ip bgp *

R1:
R1(config)#do sh ip bgp
BGP table version is 3, local router ID is 1.1.1.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
*> 1.1.1.1/32 0.0.0.0 0 32768 i
*> 4.4.4.4/32 12.12.12.2 100 23 4 i
* 13.13.13.3 0 23 4 i

R1#sh ip route bgp
4.0.0.0/32 is subnetted, 1 subnets
B 4.4.4.4 [20/0] via 12.12.12.2, 00:02:16

Terlihat sekarang linknya melalui R2 kembali. Kemudian kita tes lagi shutdown interface ke R2.

R1:
R1(config)#int g1/0
R1(config-if)#shutdown

R1(config)#do sh ip bgp
BGP table version is 4, local router ID is 1.1.1.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
*> 1.1.1.1/32 0.0.0.0 0 32768 i
*> 4.4.4.4/32 13.13.13.3 0 23 4 i

R1(config)#do sh ip route bgp
4.0.0.0/32 is subnetted, 1 subnets
B 4.4.4.4 [20/0] via 12.12.12.2, 00:00:07

Oke sekarang jalur kembali menggunakan main linknya kembali yakni melalui R2. Selain untuk mengatur trafik keluar, kita juga bisa mengatur trafik yang dating dengan menggunakan (MED).

Kita konfigurasikan di R1.
R1:
R1(config)#router bgp 1
R1(config-router)#ip access-list standard LAN
R1(config-std-nacl)#permit 1.1.1.1
!
R1(config-std-nacl)#route-map R2MED permit 10
R1(config-route-map)#match ip address LAN
R1(config-route-map)#set metric 110
!
R1(config)#router bgp 1
R1(config-router)#neighbor 12.12.12.2 route-map R2MED out
R1(config-router)#neighbor 13.13.13.3 route-map R3MED out

Kita cek/verifikasi
R3:
R3#sh ip route 1.1.1.1
Routing entry for 1.1.1.1/32
Known via "bgp 23", distance 20, metric 100
Tag 1, type external
Last update from 13.13.13.1 00:00:10 ago
Routing Descriptor Blocks:
* 13.13.13.1, from 13.13.13.1, 00:00:10 ago
Route metric is 100, traffic share count is 1
AS Hops 1
Route tag 1

R2:
R2(config)#do show ip bgp 1.1.1.1
BGP routing table entry for 1.1.1.1/32, version 23
Paths: (2 available, best #1, table Default-IP-Routing-Table)
Advertised to update-groups:
3
1
23.23.23.3 from 23.23.23.3 (34.34.34.3)
Origin IGP, metric 100, localpref 100, valid, internal, best
1
12.12.12.1 from 12.12.12.1 (1.1.1.1)
Origin IGP, metric 110, localpref 100, valid, external

R2(config)#do show ip bgp
BGP table version is 24, local router ID is 2.2.2.2
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
*>i1.1.1.1/32 23.23.23.3 100 100 0 1 i
* 12.12.12.1 110 0 1 i
*> 2.2.2.2/32 0.0.0.0 0 32768 i
* i4.4.4.4/32 23.23.23.3 0 100 0 4 i
*> 24.24.24.4 0 0 4 i

R2#traceroute 1.1.1.1 source 2.2.2.2
Type escape sequence to abort.
Tracing the route to 1.1.1.1
1 23.23.23.3 20 msec 20 msec 8 msec
2 13.13.13.1 28 msec 24 msec 8 msec

Seperti yang kita lihat diatas, maka dari R2 (AS 23) untuk menuju ke R1 (AS 1) akan melalui R3 terlebih dahulu.
Selain kita menggunakan attribute MED, kita juga bisa menggunakan attribute AS-Path. Terlebih dahulu kita hapus konfigurasi MED sebelumnya.

R1:
R1(config)#router bgp 1
R1(config-router)#no neighbor 12.12.12.2 route-map R2MED out
R1(config-router)#no neighbor 13.13.13.3 route-map R3MED out

Kita konfigurasikan AS-Path
R1:
R1(config)#router bgp 1
R1(config-router)#neighbor 12.12.12.2 route-map AS-PREPEND out
R1(config-router)#route-map AS-PREPEND
R1(config-route-map)#set as-path prepend 1 1 1
R1(config-route-map)#do clear ip bgp *

Kemudian kita verifikasi
R2:
R2#sh ip bgp
BGP table version is 29, local router ID is 2.2.2.2
Status codes: s suppressed, d damped, h history, * valid, > best, i – internal, r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
*>i1.1.1.1/32 23.23.23.3 0 100 0 1 i
* 12.12.12.1 0 0 1 1 1 1 i
*> 2.2.2.2/32 0.0.0.0 0 32768 i
* i4.4.4.4/32 23.23.23.3 0 100 0 4 i
*> 24.24.24.4 0 0 4 i

R2#sh ip route bgp
1.0.0.0/32 is subnetted, 1 subnets
B 1.1.1.1 [200/0] via 23.23.23.3, 00:05:20
4.0.0.0/32 is subnetted, 1 subnets
B 4.4.4.4 [20/0] via 24.24.24.4, 02:23:15

R2#traceroute 1.1.1.1 source 2.2.2.2
Tracing the route to 1.1.1.1
1 23.23.23.3 20 msec 20 msec 24 msec
2 13.13.13.1 20 msec 24 msec 12 msec

R3:
R3#sh ip bgp
BGP table version is 18, local router ID is 34.34.34.3
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal, r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
*> 1.1.1.1/32 13.13.13.1 0 0 1 i
*>i2.2.2.2/32 23.23.23.2 0 100 0 i
* i4.4.4.4/32 23.23.23.2 0 100 0 4 i
*> 34.34.34.4 0 0 4 i

R4:
R4#sh ip bgp
BGP table version is 13, local router ID is 4.4.4.4
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal, r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
* 1.1.1.1/32 34.34.34.3 0 23 1 i
*> 24.24.24.2 0 23 1 i
* 2.2.2.2/32 34.34.34.3 0 23 i
*> 24.24.24.2 0 0 23 i
*> 4.4.4.4/32 0.0.0.0 0 32768 i

R4#trace 1.1.1.1 source 4.4.4.4
Type escape sequence to abort.
Tracing the route to 1.1.1.1
1 24.24.24.2 8 msec 24 msec 20 msec
2 23.23.23.3 16 msec 20 msec 20 msec
3 13.13.13.1 44 msec 48 msec 32 msec

Sekarang, kita berlanjut ke lab berikutnya yaitu Load Sharing. Terlebih dahulu kita hapus konfigurasi AS-Path dan Weight sebelumnya, BGP secara default hanya akan menggunakan 1 jalur saja. Untuk dapat menggunakan lebih dari satu jalru kita perlu setting maximum path terlebih dahulu.

R1:
R1(config)#router bgp 1
R1(config-router)#no neighbor 12.12.12.2 route-map AS-PREPEND out
R1(config-router)#no neighbor 12.12.12.2 route-map WEIGHT in
R1(config-router)#maximum-paths ?
<1-32> Number of paths
ibgp iBGP-multipath
R1(config-router)#maximum-paths 2
R1(config-router)#do clear ip bgp * soft

R1:
R1(config)#do show ip bgp
BGP table version is 6, local router ID is 1.1.1.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal, r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
*> 1.1.1.1/32 0.0.0.0 0 32768 i
* 2.2.2.2/32 13.13.13.3 0 23 i
*> 12.12.12.2 0 0 23 i
* 4.4.4.4/32 13.13.13.3 0 23 4 i
*> 12.12.12.2 0 23 4 i

Tanda Best (>) nya hanya menunjuk ke jalur R3 saja.
R1:
R1(config)#do show ip route bgp
2.0.0.0/32 is subnetted, 1 subnets
B 2.2.2.2 [20/0] via 13.13.13.3, 00:04:47
[20/0] via 12.12.12.2, 00:23:23
4.0.0.0/32 is subnetted, 1 subnets
B 4.4.4.4 [20/0] via 13.13.13.3, 00:04:47
[20/0] via 12.12.12.2, 00:23:23

Ketika kita menampilkan show ip route, hanya menunjuk ke satu jalur saja.

R1(config)#do show ip route 4.4.4.4
Routing entry for 4.4.4.4/32
Known via "bgp 1", distance 20, metric 0
Tag 23, type external
Last update from 13.13.13.3 00:05:53 ago
Routing Descriptor Blocks:
13.13.13.3, from 13.13.13.3, 00:05:53 ago
Route metric is 0, traffic share count is 1
AS Hops 2
Route tag 23
* 12.12.12.2, from 12.12.12.2, 00:24:29 ago
Route metric is 0, traffic share count is 1
AS Hops 2
Route tag 23

Kita lakukan traceroute agar tahu kedua jalurnya bisa digunakan bersamaan.

R1#traceroute 4.4.4.4 source 1.1.1.1
Type escape sequence to abort.
Tracing the route to 4.4.4.4
1 12.12.12.2 28 msec
13.13.13.3 20 msec
12.12.12.2 20 msec
2 34.34.34.4 40 msec
24.24.24.4 36 msec
34.34.34.4 32 msec

Akhirnya berhasil.
BGP Attribute :
▪ Weight (highest)
▪ Local-Preference (highest)
▪ Locally Originated
▪ AS-Path (shortest)
▪ Origin (IGP>EGP>?)
▪ MED (lowest)





Komentar