LAB 9. BGP Attribute ( Community LIST )

 LAB 9. BGP Attribute ( Community LIST )

Selain menggunakan teknik sebelumnya, kita juga bisa menggunakan numerik community, terlebih dahulu kita hapus konfig BGP dan EIGRP pada lab sebelumnya.

R1(config)#no router eigrp 10
R2(config)#no router eigrp 10
R1(config)#no router bgp 12
R2(config)#no router bgp 12
R3(config)#no router eigrp 10
R3(config)#no router bgp 3
R4(config)#no router bgp 4

Konfigurasikan BGP pada semua router.
R1:
R1(config)#router bgp 1
R1(config-router)#neighbor 12.12.12.2 remote-as 2
R1(config-router)#exit

R2:
R2(config)#router bgp 2
R2(config-router)#neighbor 12.12.12.1 remote-as 1
R2(config-router)#neighbor 23.23.23.3 remote-as 3
R2(config-router)#neighbor 24.24.24.4 remote-as 4

R3:
R3(config)#router bgp 3
R3(config-router)#neighbor 23.23.23.2 remote-as 2

R4:
R4(config)#router bgp 4
R4(config-router)#neighbor 24.24.24.2 remote-as 2
R4(config-router)#network 4.4.4.4 mask 255.255.255.255
R4(config-router)#exit

Kita cek apakah R2 (ISP 2) mendapatkan prefix dari customer (R4).
R2:
R2(config)#do sh ip bgp
Network Next Hop Metric LocPrf Weight Path
*> 4.4.4.4/32 24.24.24.4 0 0 4 i

Ok sudah ada, sekarang kita lanjut konfigurasi communitynya.
R2:
R2(config)#ip community-list 1 permit 2:24
R2(config)#route-map P
R2(config)#route-map PREPEND permit
R2(config-route-map)#match community 1
R2(config-route-map)#set as prepend 2 2 2 2
R2(config-route-map)#exit
R2(config)#route-map PREPEND permit 20

Kemudian kita terapkan ke R3 (ISP3).
R2:
R2(config)#router bgp 2
R2(config-router)#neighbor 23.23.23.3 route-map PREPEND out
R2(config-router)#exit

Kemudian kita konfigurasi di bagian router customer
R4:
R4(config)#ip prefix-list Loopback permit 4.4.4.4/32
R4(config)#route-map PREPEND_COMMUNITY permit 10
R4(config-route-map)#match ip address prefix-list LOOPBACK
R4(config-route-map)#set community 2:24
R4(config-route-map)#exit
R4(config)#route-map PREPEND_COMMUNITY permit 20
R4(config-route-map)#exit
R4(config)#router bgp 4
R4(config-router)#neighbor 24.24.24.2 route-map PREPEND_COMMUNITY out
R4(config-router)#neighbor 24.24.24.2 send-community
R4(config-router)#exit
R4(config)#do clear ip bgp

Kita verifikasi pada R2.
R2:
R2(config)#do show ip bgp 4.4.4.4
BGP routing table entry for 4.4.4.4/32, version 7
Paths: (1 available, best #1, table Default-IP-Routing-Table)
Flag: 0x820
Advertised to update-groups:
1 2
24.24.24.4 from 24.24.24.4 (4.4.4.4)
Origin IGP, metric 0, localpref 100, valid, external, best
Community: 131096

Untuk nilai communitynya masih menggunakan 32 bit dalam bentuk
decimal. Untuk merubah kedalam 16 bit, kita tulis command dibawah ini.
R2:
R2(config)#ip bgp-community new-format

Kita verifikasi kembali.
R2:
R2(config)#do sh ip bgp 4.4.4.4
BGP routing table entry for 4.4.4.4/32, version 7
Paths: (1 available, best #1, table Default-IP-Routing-Table)
Advertised to update-groups:
1 2
4
24.24.24.4 from 24.24.24.4 (4.4.4.4)
Origin IGP, metric 0, localpref 100, valid, external, best
Community: 2:24

Kita cek pada R3, pastikan network 4.4.4.4 untuk AS-Prependnya sudah ditambahkan.
R3:
R3(config)#do sh ip bgp
BGP table version is 7, local router ID is 33.33.33.33
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.2 0 2 2 2 2 2 4 i

Komentar

Postingan populer dari blog ini

LAB 11. BGP Dual Homing – ISP sama