Setelah mempelajari BGP attribute origin pada postingan sebelmunya, kini kita belajar BGP attribute community.

Ada 4 macam attribute community, yaitu

1. no-export

2. no-advertise

3. internet

4. local-as

Buat topologi seperti di bawah ini

topologi

Di bawah ini konfigurasi tiap routernya

R1

interface Loopback0

 ip address 1.1.1.1 255.255.255.255

!

interface Loopback1

 ip address 11.11.11.11 255.255.255.255

!

interface Serial0/0

 ip address 12.12.12.1 255.255.255.0

 clock rate 2000000

!

router eigrp 1

 network 1.1.1.1 0.0.0.0

 network 12.12.12.1 0.0.0.0

 auto-summary

!

router bgp 111

 no synchronization

 bgp log-neighbor-changes

 network 11.11.11.11 mask 255.255.255.255

 neighbor 2.2.2.2 remote-as 111

 neighbor 2.2.2.2 update-source Loopback0

 neighbor 2.2.2.2 send-community

 neighbor 2.2.2.2 route-map no-export out

 no auto-summary

!

access-list 1 permit 11.11.11.11

!

route-map no-export permit 10

 match ip address 1

 set community no-export


R2

interface Loopback0

 ip address 2.2.2.2 255.255.255.255

!

interface Loopback1

 ip address 22.22.22.22 255.255.255.255

!

interface FastEthernet0/0

 ip address 24.24.24.2 255.255.255.0

 duplex auto

 speed auto

!

interface Serial0/0

 ip address 12.12.12.2 255.255.255.0

 clock rate 2000000

!

interface Serial0/1

 ip address 23.23.23.2 255.255.255.0

 clock rate 2000000

!

router eigrp 1

 network 2.2.2.2 0.0.0.0

 network 12.12.12.2 0.0.0.0

 network 23.23.23.2 0.0.0.0

 auto-summary

!

router bgp 111

 no synchronization

 bgp log-neighbor-changes

 network 22.22.22.22 mask 255.255.255.255

 neighbor 1.1.1.1 remote-as 111

 neighbor 1.1.1.1 update-source Loopback0

 neighbor 1.1.1.1 next-hop-self

 neighbor 3.3.3.3 remote-as 111

 neighbor 3.3.3.3 update-source Loopback0

 neighbor 3.3.3.3 route-reflector-client

 neighbor 3.3.3.3 next-hop-self

 neighbor 24.24.24.4 remote-as 44

 no auto-summary


R3

interface Loopback0

 ip address 3.3.3.3 255.255.255.0

!

interface Loopback1

 ip address 33.33.33.33 255.255.255.255

!

interface Serial0/0

 ip address 23.23.23.3 255.255.255.0

 clock rate 2000000

!

router eigrp 1

 network 3.3.3.3 0.0.0.0

 network 23.23.23.3 0.0.0.0

 auto-summary

!

router bgp 111

 no synchronization

 bgp log-neighbor-changes

 network 33.33.33.33 mask 255.255.255.255

 neighbor 2.2.2.2 remote-as 111

 neighbor 2.2.2.2 update-source Loopback0

 neighbor 2.2.2.2 send-community

 neighbor 2.2.2.2 route-map NO-ADVERTISE out

 no auto-summary

!

access-list 1 permit 33.33.33.33

!

route-map NO-ADVERTISE permit 10

 match ip address 1

 set community no-advertise

R4

interface Loopback0

 ip address 4.4.4.4 255.255.255.255

!

interface FastEthernet0/0

 ip address 24.24.24.4 255.255.255.0

 duplex auto

 speed auto

!

router bgp 44

 no synchronization

 bgp log-neighbor-changes

 network 4.4.4.4 mask 255.255.255.255

 neighbor 24.24.24.2 remote-as 111

 no auto-summary

verifikasi no -export

Pastikan network 11.11.11.11/32 sudah tidak ada di R4

r4 no-export

r3 no-export

r2 no-export

verifikasi no-advertise

Cek bgp route di R1 dan R4 pastikan network 33.33.33.33/32 sudah tidak ada

r1 no-advertise

r4 no-advertise

r2 no-advertise

Lanjut ke community berikutnya yaitu LOCAL-AS di R1 (diadvertise hanya di confederation iBGP saja). Artinya konfigurasi iBGP (R1, R2 dan R3) harus dirubah dari route reflector menjadi confederation.

Hapus konfigurasi router bgp di semua router, lalu ganti yang baru seperi berikut ini.

R1

interface Loopback0

 ip address 1.1.1.1 255.255.255.255

!

interface Loopback1

 ip address 11.11.11.11 255.255.255.255

!

interface Serial0/0

 ip address 12.12.12.1 255.255.255.0

 clock rate 2000000

!

router eigrp 1

 network 1.1.1.1 0.0.0.0

 network 12.12.12.1 0.0.0.0

 auto-summary

!

router bgp 12

 no synchronization

 bgp log-neighbor-changes

 bgp confederation identifier 111

 network 11.11.11.11 mask 255.255.255.255

 network 12.12.12.0 mask 255.255.255.0

 redistribute eigrp 1

 neighbor 12.12.12.2 remote-as 12

 neighbor 12.12.12.2 send-community

 neighbor 12.12.12.2 route-map LOCAL-AS out

 no auto-summary

!

access-list 1 permit 11.11.11.11

access-list 2 permit 11.11.11.11

!

route-map no-export permit 10

 match ip address 1

 set community no-export

!

route-map LOCAL-AS permit 10

 match ip address 2

 set community local-AS

R2

interface Loopback0

 ip address 2.2.2.2 255.255.255.255

!

interface Loopback1

 ip address 22.22.22.22 255.255.255.255

!

interface FastEthernet0/0

 ip address 24.24.24.2 255.255.255.0

 duplex auto

 speed auto

!

interface Serial0/0

 ip address 12.12.12.2 255.255.255.0

 clock rate 2000000

!

interface Serial0/1

 ip address 23.23.23.2 255.255.255.0

 clock rate 2000000

!

router eigrp 1

 network 2.2.2.2 0.0.0.0

 network 12.12.12.2 0.0.0.0

 network 23.23.23.2 0.0.0.0

 auto-summary

!

router bgp 12

 no synchronization

 bgp log-neighbor-changes

 bgp confederation identifier 111

 bgp confederation peers 3

 network 12.12.12.0 mask 255.255.255.0

 network 22.22.22.22 mask 255.255.255.255

 network 23.23.23.0 mask 255.255.255.0

 network 24.24.24.0 mask 255.255.255.0

 redistribute eigrp 1

 neighbor 12.12.12.1 remote-as 12

 neighbor 12.12.12.1 next-hop-self

 neighbor 23.23.23.3 remote-as 3

 neighbor 23.23.23.3 next-hop-self

 neighbor 24.24.24.4 remote-as 44

 no auto-summary

R3

interface Loopback0

 ip address 3.3.3.3 255.255.255.0

!

interface Loopback1

 ip address 33.33.33.33 255.255.255.255

!

interface Serial0/0

 ip address 23.23.23.3 255.255.255.0

 clock rate 2000000

!

router eigrp 1

 network 3.3.3.3 0.0.0.0

 network 23.23.23.3 0.0.0.0

 auto-summary

!

router bgp 3

 no synchronization

 bgp log-neighbor-changes

 bgp confederation identifier 111

 bgp confederation peers 12

 network 23.23.23.0 mask 255.255.255.0

 network 33.33.33.33 mask 255.255.255.255

 redistribute eigrp 1

 neighbor 23.23.23.2 remote-as 12

 no auto-summary

!

access-list 1 permit 33.33.33.33

!

route-map NO-ADVERTISE permit 10

 match ip address 1

 set community no-advertise

Verifikasi

Pastikan di R3 sudah tidak ada network 11.11.11.11/32

r3-local-as

Cek di R2 dengan perintah di bawah ini

r2 local as