Jumat, 11 November 2016

Lab 87 - BGP Attribute (Weight)

Pada lab ini kita akan mempelajari salah atribut dalam BGP, yaitu weight. Berikut topologi yang akan kita gunakan pada lab ini
Gambar 1 Topologi jaringan BGP
Skenarionya adalah kita akan konfigurasi IBGP antara R1, R2, dan R3. Kita juga akan konfigurasi EBGP antara R1-R4 dan R3-R4. Oke langsung aja deh
R1(config)#int e0/0
R1(config-if)#no sh R1(config-if)#ip add 12.12.12.1 255.255.255.0 R1(config-if)#int e0/1 R1(config-if)#no sh R1(config-if)#ip add 14.14.14.1 255.255.255.0 R1(config-if)#router bgp 1 R1(config-router)#bgp confederation identifier 123 R1(config-router)#bgp confederation peers 2 R1(config-router)#neighbor 12.12.12.2 remote-as 2 R1(config-router)#neighbor 12.12.12.2 next-hop-self R1(config-router)#neighbor 14.14.14.4 remote-as 4 R1(config-router)#net 12.12.12.0 mask 255.255.255.0
R2(config)#int e0/0 R2(config-if)#no sh R2(config-if)#ip add 12.12.12.2 255.255.255.0 R2(config-if)#int e0/1 R2(config-if)#no sh R2(config-if)#ip add 23.23.23.2 255.255.255.0 R2(config-if)#router bgp 2 R2(config-router)#bgp confederation identifier 123 R2(config-router)#bgp confederation peers 1 3 R2(config-router)#neighbor 12.12.12.1 remote-as 1 R2(config-router)#neighbor 12.12.12.1 next-hop-self R2(config-router)#neighbor 23.23.23.3 remote-as 3 R2(config-router)#neighbor 23.23.23.3 next-hop-self
R3(config)#int e0/0 R3(config-if)#no sh R3(config-if)#ip add 23.23.23.3 255.255.255.0 R3(config-if)#int e0/1 R3(config-if)#no sh R3(config-if)#ip add 34.34.34.3 255.255.255.0 R3(config-if)#router bgp 3 R3(config-router)#bgp confederation identifier 123 R3(config-router)#bgp confederation peers 2 R3(config-router)#neighbor 23.23.23.2 remote-as 2 R3(config-router)#neighbor 23.23.23.2 next-hop-self R3(config-router)#neighbor 34.34.34.4 remote-as 4 R3(config-router)#net 23.23.23.0 mask 255.255.255.0 R3(config-router)#net 34.34.34.0 mask 255.255.255.0
R4(config)#int e0/0 R4(config-if)#no sh R4(config-if)#ip add 14.14.14.4 255.255.255.0 R4(config-if)#int e0/1 R4(config-if)#no sh R4(config-if)#ip add 34.34.34.4 255.255.255.0 R4(config-if)#int l0 R4(config-if)#ip add 4.4.4.4 255.255.255.255 R4(config-if)#router bgp 4 R4(config-router)#neighbor 14.14.14.1 remote-as 123 R4(config-router)#neighbor 34.34.34.3 remote-as 123 R4(config-router)#net 4.4.4.4 mask 255.255.255.255
Oke langsung kita uji ya.. coba lihat tabel routing di R2 & R4 aja deh.. kalo R2 & R4 udah lengkap.. otomatis R1 & R3 juga udah lengkap
R4(config-router)#do sh ip ro
4.0.0.0/32 is subnetted, 1 subnets C 4.4.4.4 is directly connected, Loopback0 12.0.0.0/24 is subnetted, 1 subnets B 12.12.12.0 [20/0] via 14.14.14.1, 00:11:54 14.0.0.0/8 is variably subnetted, 2 subnets, 2 masks C 14.14.14.0/24 is directly connected, Ethernet0/0 23.0.0.0/24 is subnetted, 1 subnets B 23.23.23.0 [20/0] via 14.14.14.1, 00:11:54 34.0.0.0/8 is variably subnetted, 2 subnets, 2 masks C 34.34.34.0/24 is directly connected, Ethernet0/1
R2(config-router)#do sh ip ro 4.0.0.0/32 is subnetted, 1 subnets B 4.4.4.4 [200/0] via 12.12.12.1, 00:11:56 12.0.0.0/8 is variably subnetted, 2 subnets, 2 masks C 12.12.12.0/24 is directly connected, Ethernet0/0 14.0.0.0/24 is subnetted, 1 subnets B 14.14.14.0 [200/0] via 12.12.12.1, 00:11:25 23.0.0.0/8 is variably subnetted, 2 subnets, 2 masks C 23.23.23.0/24 is directly connected, Ethernet0/1 34.0.0.0/24 is subnetted, 1 subnets B 34.34.34.0 [200/0] via 23.23.23.3, 00:11:25
Juozzz.. coba kita ping dari R2 ke Loopback R4 ya..
R2(config-router)#do ping 4.4.4.4 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 4.4.4.4, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 1/2/8 ms
Udah work kan?? juozzz dah.. Oke lanjut kita pelajari tentang atribut weight di BGP.. apa sih weight itu?? weight merupakan atribut yang dapat kita gunakan untuk menentukan jalur terbaik untuk menuju suatu network. atribut ini sifatnya lokal, artinya tidak akan diadvertise ke router lain.

Bingung ya?? langsung aja deh kita konfig,, skenarionya kita pengen agar saat R2 ping ke 4.4.4.4, maka akan dilewatkan jalur via R3. Secara default sih bakal lewat R1, coba deh kita buktikan
R2(config-router)#do trace 4.4.4.4
Type escape sequence to abort. Tracing the route to 4.4.4.4 1 12.12.12.1 [AS 1] 0 msec 0 msec 0 msec 2 14.14.14.4 [AS 1] 0 msec 0 msec 0 msec
Tuh kan.. secara default R1 akan langsung menggunakan jalur via R4. kenapa demikian? bukannya seharusnya jalur via R1 dan R4 sama saja? punya bandwidth yang sama, hop count yang sama.. tapi kenapa milih yang lewat R1?? ini karena R1 punya router-id yang lebih kecil dibanding R4. Nanti di lab selanjutnya kita bahas deh metric BGP secara menyeluruh... untuk saat ini kita fokus di weight aja dulu

Nilai weight secara default adalah 0, dan semakin besar nilai weight, maka akan semakin diutamakan
R2(config-router)#do sh ip bgp
BGP table version is 8, local router ID is 23.23.23.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 * 4.4.4.4/32 23.23.23.3 0 100 0 (3) 4 i *> 12.12.12.1 0 100 0 (1) 4 i r> 12.12.12.0/24 12.12.12.1 0 100 0 (1) i *> 14.14.14.0/24 12.12.12.1 0 100 0 (1) i r> 23.23.23.0/24 23.23.23.3 0 100 0 (3) i *> 34.34.34.0/24 23.23.23.3 0 100 0 (3) i
Coba kita manipulasi deh, agar jalur via R3 lebih diuatamakan
R2(config)#access-list 1 permit 4.4.4.4 R2(config)#route-map WEIGHT permit 10 R2(config-route-map)#match ip address 1 R2(config-route-map)#set weight 200 R2(config-route-map)#route-map WIEGHT permit 20 R2(config-route-map)#router bgp 2 R2(config-router)#neighbor 23.23.23.3 route-map WIEGHT in R2(config-router)#do clear ip bgp *
R2(config-router)#do sh ip bgp BGP table version is 8, local router ID is 23.23.23.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 *> 4.4.4.4/32 23.23.23.3 0 100 200 (3) 4 i * 12.12.12.1 0 100 0 (1) 4 i r> 12.12.12.0/24 12.12.12.1 0 100 0 (1) i *> 14.14.14.0/24 12.12.12.1 0 100 0 (1) i r> 23.23.23.0/24 23.23.23.3 0 100 0 (3) i *> 34.34.34.0/24 23.23.23.3 0 100 0 (3) i
Sip2,, nilai weight untuk jalur via R3 sudah berubah menjadi 200. Sekarang kita coba traceroute lagi ya..
R2(config)#do traceroute 4.4.4.4
Type escape sequence to abort. Tracing the route to 4.4.4.4 1 23.23.23.3 [AS 3] 0 msec 0 msec 0 msec 2 34.34.34.4 [AS 3] 0 msec 4 msec 0 msec
Tuh.. sekarang udah lewat R3 ya...

Like the Post? Do share with your Friends.

Tidak ada komentar:

Posting Komentar

Komentar

FeedBack

Jika Anda merasa terbantu dengan artikel dari Coretan Bocah IT, silahkan berlangganan GRATIS via email. Dengan begitu, Anda akan mendapat kiriman artikel setiap ada artikel baru yang terbit di Coretan Bocah IT

Masukkan Email :

IconIconIconFollow Me on Pinterest