Pada lab sebelumnya kita telah belajar tentang salah satu attribute di BGP, yaitu origin. Selanjutnya pada lab ini kita akan belajar atribut lain yang dimiliki oleh BGP, yaitu Community.
Ada beberapa tipe yang dimiliki oleh attribute community ini, kita akan mempelajari tipe-tipe yang dimiliki oleh attribute community ini menggunakan contoh kasus. Berikut topologi yang akan kita gunakan pada lab ini
Gambar 1 Topologi jaringan BGP |
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 l0 R1(config-if)#ip add 1.1.1.1 255.255.255.255 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)#net 1.1.1.1 mask 255.255.255.255
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)#int e0/2 R2(config-if)#no sh R2(config-if)#ip add 24.24.24.2 255.255.255.0 R2(config-if)#int l0 R2(config-if)#ip add 2.2.2.2 255.255.255.255 R2(config-if)#router bgp 2 R2(config-router)#bgp confederation identifier 123 R2(config-router)#bgp confederation peer 1 R2(config-router)#bgp confederation peer 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 R2(config-router)#neighbor 24.24.24.4 remote-as 4 R2(config-router)#net 2.2.2.2 mask 255.255.255.255
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 l0 R3(config-if)#ip add 3.3.3.3 255.255.255.255 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)#network 3.3.3.3 mask 255.255.255.255
Sekarang kita coba lihat tabel routing di seluruh routerR4(config)#int e0/0 R4(config-if)#no sh R4(config-if)#ip add 24.24.24.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 24.24.24.2 remote-as 123 R4(config-router)#net 4.4.4.4 mask 255.255.255.255
R1(config-router)#do sh ip ro 1.0.0.0/32 is subnetted, 1 subnets C 1.1.1.1 is directly connected, Loopback0 2.0.0.0/32 is subnetted, 1 subnets B 2.2.2.2 [200/0] via 12.12.12.2, 00:01:47 3.0.0.0/32 is subnetted, 1 subnets B 3.3.3.3 [200/0] via 12.12.12.2, 00:02:23 4.0.0.0/32 is subnetted, 1 subnets B 4.4.4.4 [200/0] via 12.12.12.2, 00:02:23 12.0.0.0/8 is variably subnetted, 2 subnets, 2 masks C 12.12.12.0/24 is directly connected, Ethernet0/0
R2(config-router)#do sh ip ro 1.0.0.0/32 is subnetted, 1 subnets B 1.1.1.1 [200/0] via 12.12.12.1, 00:02:10 2.0.0.0/32 is subnetted, 1 subnets C 2.2.2.2 is directly connected, Loopback0 3.0.0.0/32 is subnetted, 1 subnets B 3.3.3.3 [200/0] via 23.23.23.3, 00:02:46 4.0.0.0/32 is subnetted, 1 subnets B 4.4.4.4 [20/0] via 24.24.24.4, 00:02:46 12.0.0.0/8 is variably subnetted, 2 subnets, 2 masks C 12.12.12.0/24 is directly connected, Ethernet0/0 23.0.0.0/8 is variably subnetted, 2 subnets, 2 masks C 23.23.23.0/24 is directly connected, Ethernet0/1 24.0.0.0/8 is variably subnetted, 2 subnets, 2 masks C 24.24.24.0/24 is directly connected, Ethernet0/2
R3(config-router)#do sh ip ro 1.0.0.0/32 is subnetted, 1 subnets B 1.1.1.1 [200/0] via 23.23.23.2, 00:02:03 2.0.0.0/32 is subnetted, 1 subnets B 2.2.2.2 [200/0] via 23.23.23.2, 00:02:32 3.0.0.0/32 is subnetted, 1 subnets C 3.3.3.3 is directly connected, Loopback0 4.0.0.0/32 is subnetted, 1 subnets B 4.4.4.4 [200/0] via 23.23.23.2, 00:03:08 23.0.0.0/8 is variably subnetted, 2 subnets, 2 masks C 23.23.23.0/24 is directly connected, Ethernet0/0
R4(config-router)#do sh ip ro 1.0.0.0/32 is subnetted, 1 subnets B 1.1.1.1 [20/0] via 24.24.24.2, 00:02:23 2.0.0.0/32 is subnetted, 1 subnets B 2.2.2.2 [20/0] via 24.24.24.2, 00:02:52 3.0.0.0/32 is subnetted, 1 subnets B 3.3.3.3 [20/0] via 24.24.24.2, 00:03:28 4.0.0.0/32 is subnetted, 1 subnets C 4.4.4.4 is directly connected, Loopback0 24.0.0.0/8 is variably subnetted, 2 subnets, 2 masks C 24.24.24.0/24 is directly connected, Ethernet0/0
Perhatikan bahwa seluruh router sudah punya tabel routing yang lengkap. Sekarang kita mulai belajar tentang community. Tipe community yang akan kita pelajari pertama adalah community no-export, yang artinya network tidak akan di advertise ke external AS. Kita akan coba konfig community no export di R1
R1(config)#access-list 1 permit host 1.1.1.1R1(config)#route-map NO-EXPORT permit 10 R1(config-route-map)#match ip address 1 R1(config-route-map)#set community no-export R1(config-route-map)#route-map NO-EXPORT permit 20 R1(config-route-map)#router bgp 1 R1(config-router)#neighbor 12.12.12.2 route-map NO-EXPORT out R1(config-router)#neighbor 12.12.12.2 send-community
Kita perlu membuat dua route-map, yaitu dengan sequence 10 dan 20. route-map dengan sequence 10 kita gunakan untuk set community network 1.1.1.1, sedangkan sequence 20 digunakan untuk mengizinkan semua network kecuali 1.1.1.1
R2(config-router)#do sh ip bgp 1.1.1.1 BGP routing table entry for 1.1.1.1/32, version 6 Paths: (1 available, best #1, table default, not advertised to EBGP peer) Advertised to update-groups: 4 (1) 12.12.12.1 from 12.12.12.1 (1.1.1.1) Origin IGP, metric 0, localpref 100, valid, confed-external, best Community: no-export
Perhatikan bahwa community untuk network 1.1.1.1 sudah no export, sekarang kita coba lihat tabel routing di R3 dan R4
R3(config-router)#do sh ip ro1.0.0.0/32 is subnetted, 1 subnets B 1.1.1.1 [200/0] via 23.23.23.2, 00:08:27 2.0.0.0/32 is subnetted, 1 subnets B 2.2.2.2 [200/0] via 23.23.23.2, 00:08:56 3.0.0.0/32 is subnetted, 1 subnets C 3.3.3.3 is directly connected, Loopback0 4.0.0.0/32 is subnetted, 1 subnets B 4.4.4.4 [200/0] via 23.23.23.2, 00:09:32 23.0.0.0/8 is variably subnetted, 2 subnets, 2 masks C 23.23.23.0/24 is directly connected, Ethernet0/0
R4(config-router)#do sh ip ro 2.0.0.0/32 is subnetted, 1 subnets B 2.2.2.2 [20/0] via 24.24.24.2, 00:06:46 3.0.0.0/32 is subnetted, 1 subnets B 3.3.3.3 [20/0] via 24.24.24.2, 00:07:22 4.0.0.0/32 is subnetted, 1 subnets C 4.4.4.4 is directly connected, Loopback0 24.0.0.0/8 is variably subnetted, 2 subnets, 2 masks C 24.24.24.0/24 is directly connected, Ethernet0/0
Perhatikan bahwa R3 masih punya informasi tentang 1.1.1.1, namun tidak demikian dengan R4. Hal ini dikarenakan R3 masih berada di AS yang sama dengan R2, sedangkan R4 sudah berada di AS yang berbeda dengan R2
Tidak ada komentar:
Posting Komentar
Komentar