LAB · LAB Mikrotik Series · Mikrotik · Networking · Pesantren Networkers

Lab 42. BGP Community using for Routing Policy

Bismillah

Lab 42 ini kita akan membahas tentang BGP Community lagi. hehehe. kalau kemarin kita membahas tentang community default pada Lab 41. BGP Community No-export maka pada lab ini kita akan membahas tentang BGP community yang akan mengubah routing policy pada router R1 .

Agar dapat langsung paham silahkan perhatikan topologi berikut ini

Selection_237.png

dengan menggunakan topologi diatas kita akan membuat network yang di advertise dari router r1 yaitu 1.1.1.1. dan 11.11.11.11 akan diadvertise seluruhnya ke router R2. tetapi router R4 atau mikrotik-4 hanya akan menerima network 11.11.11.11. dan pada router mikrotik-3 hanya akan menerima network 1.1.1.1. berikut konfigurasi yang yang lakukan

Konfigurasi ip address

IP Address router R1

[admin@R1] > ip address add address=12.12.12.1/24 interface=ether1
[admin@R1] > interface bridge add name=lo   
[admin@R1] > ip address add address=1.1.1.1/32 interface=lo

IP Address router R2

[admin@R2] > ip address add address=12.12.12.2/24 interface=ether1
[admin@R2] > ip address add address=23.23.23.2/24 interface=ether2
[admin@R2] > interface bridge add name=lo
[admin@R2] > ip address add address=2.2.2.2/32 interface=lo  
[admin@R2] > ip address add address=24.24.24.2/24 interface=ether3

Ip address router R3

[admin@R3] > ip address add address=23.23.23.3/24 interface=ether1
[admin@R3] > interface bridge add name=lo
[admin@R3] > ip address add address=3.3.3.3/32 interface=lo

Ip address router R4

[admin@R4] > ip route add dst-address=12.12.12.0/24 gateway=24.24.24.2
[admin@R4] > ip route add dst-address=23.23.23.0/24 gateway=24.24.24.2
[admin@R4] > int bridge add name=lo
[admin@R4] > ip address add address=4.4.4.4 interface=lo

Konfigurasi routing static

routing static router R1

[admin@R1] > ip route add dst-address=23.23.23.0/24 gateway=12.12.12.2
[admin@R1] > ip route add dst-address=24.24.24.0/24 gateway=12.12.12.2

routing static router R2

pada router R2 tidak perlu adanya routing static karena router R2 sudah mengenali network 12.12.12.0/24,  network 23.23.23.0/24 dan network 24.24.24.0/24

routing static router R3

[admin@R3] > ip route add dst-address=12.12.12.0/24 gateway=23.23.23.2
 [admin@R3] > ip route add dst-address=24.24.24.0/24 gateway=23.23.23.2

routing static router R4

[admin@R4] > ip route add dst-address=12.12.12.0/24 gateway=24.24.24.2
[admin@R4] > ip route add dst-address=23.23.23.0/24 gateway=24.24.24.2

Konfigurasi routing BGP

routing BGP router R1

[admin@R1] > routing bgp instance set 0 as=100
[admin@R1] > routing bgp peer add remote-address=12.12.12.2 remote-as=200
[admin@R1] > routing bgp network add network=1.1.1.1

routing BGP router R2

[admin@R2] > routing bgp instance set 0 as=200     
[admin@R2] > routing bgp peer add remote-address=12.12.12.1 remote-as=100
[admin@R2] > routing bgp peer add remote-address=23.23.23.3 remote-as=300
[admin@R2] > routing bgp peer add remote-address=24.24.24.2 remote-as=400

routing BGP router R3

[admin@R3] > routing bgp instance set 0 as=300
 [admin@R3] > routing bgp peer add remote-address=23.23.23.2 remote-as=200
 [admin@R3] > routing bgp network add network=3.3.3.3

routing BGP router R4

 [admin@R4] > routing bgp instance set 0 as=400
 [admin@R4] > routing bgp peer add remote-address=24.24.24.2 remote-as=400
 [admin@R4] > routing bgp network add network=4.4.4.4

Konfigurasi BGP Community

Sebelum masuk ke konfigurasi BGP community maka kita akan melihat table routing router R3 dan router R4 terlebih dahulu.

[admin@R3] > ip route print   
Flags: X - disabled, A - active, D - dynamic, C - connect, S - static, r - rip, b - bgp, o - ospf, m - mme, 
B - blackhole, U - unreachable, P - prohibit 
 #      DST-ADDRESS        PREF-SRC        GATEWAY            DISTANCE
 0 ADb  1.1.1.1/32                         23.23.23.2               20
 1 ADb  2.2.2.2/32                         23.23.23.2               20
 2 ADC  3.3.3.3/32         3.3.3.3         lo                        0
 3 ADb  4.4.4.4/32                         23.23.23.2               20
 4 ADb  11.11.11.11/32                     23.23.23.2               20
 5 A S  12.12.12.0/24                      23.23.23.2                1
 6 ADC  23.23.23.0/24      23.23.23.3      ether1                    0
 7 A S  24.24.24.0/24                      23.23.23.2                1

dari router R4

[admin@R4] > ip route print 
Flags: X - disabled, A - active, D - dynamic, C - connect, S - static, r - rip, b - bgp, o - ospf, m - mme, 
B - blackhole, U - unreachable, P - prohibit 
 #      DST-ADDRESS        PREF-SRC        GATEWAY            DISTANCE
 0 ADb  1.1.1.1/32                         24.24.24.2               20
 1 ADb  2.2.2.2/32                         24.24.24.2               20
 2 ADb  3.3.3.3/32                         24.24.24.2               20
 3 ADC  4.4.4.4/32         4.4.4.4         lo                        0
 4 ADb  11.11.11.11/32                     24.24.24.2               20
 5 A S  12.12.12.0/24                      24.24.24.2                1
 6 A S  23.23.23.0/24                      24.24.24.2                1
 7 ADC  24.24.24.0/24      24.24.24.4      ether1                    0

table routing router R3 dan router R4 sekarang masih lengkap yaitu network 1.1.1.1 dan network 11.11.11.11 masih dapat di reach. sekarang kita akan mengkonfigurasi community dengan no-export yang akan membuat router R2 tidak akan meneruskan advertise network 11.11.11.11 ke router R3 dan juga network 1.1.1.1 ne router R4

[admin@R1] > routing filter add chain=community prefix=1.1.1.1 set-bgp-communities=200:3
[admin@R1] > routing filter add chain=community prefix=11.11.11.11 set-bgp-communities=200:4
[admin@R1] > routing bgp peer add name=peer1 out-filter=community remote-address=12.12.12.2 remote-as=200
[admin@R2] > routing bgp peer add name=peer1 remote-address=12.12.12.1 remote-as=100
[admin@R2] > routing bgp peer add name=peer2 out-filter=ke_AS300 remote-address=23.23.23.3 remote-as=300
[admin@R2] > routing bgp peer add name=peer3 out-filter=ke_AS400 remote-address=24.24.24.4 remote-as=400

berikut hasil table routing pada router R3 dan router R4 setelah konfgurasi community

[admin@R3] > ip route print 
Flags: X - disabled, A - active, D - dynamic, C - connect, S - static, r - rip, b - bgp, o - ospf, m - mme, 
B - blackhole, U - unreachable, P - prohibit 
 #      DST-ADDRESS        PREF-SRC        GATEWAY            DISTANCE
 0 ADb  1.1.1.1/32                         23.23.23.2               20
 1 ADb  2.2.2.2/32                         23.23.23.2               20
 2 ADC  3.3.3.3/32         3.3.3.3         lo                        0
 3 ADb  4.4.4.4/32                         23.23.23.2               20
 4 A S  12.12.12.0/24                      23.23.23.2                1
 5 ADC  23.23.23.0/24      23.23.23.3      ether1                    0
 6 A S  24.24.24.0/24                      23.23.23.2                1
[admin@R4] > ip route print 
Flags: X - disabled, A - active, D - dynamic, C - connect, S - static, r - rip, b - bgp, o - ospf, m - mme, 
B - blackhole, U - unreachable, P - prohibit 
 #      DST-ADDRESS        PREF-SRC        GATEWAY            DISTANCE
 0 ADb  2.2.2.2/32                         24.24.24.2               20
 1 ADb  3.3.3.3/32                         24.24.24.2               20
 2 ADC  4.4.4.4/32         4.4.4.4         lo                        0
 3 ADb  11.11.11.11/32                     24.24.24.2               20
 4 A S  12.12.12.0/24                      24.24.24.2                1
 5 A S  23.23.23.0/24                      24.24.24.2                1
 6 ADC  24.24.24.0/24      24.24.24.4      ether1                    0

Oke, selesai juga routing BGP Community. sekarang router R3 tidak dapat terhubung ke router network 11.11.11.11 sedangkan router R4 tidak dapat terhubung ke network 1.1.1.1

 

 

Satu tanggapan untuk “Lab 42. BGP Community using for Routing Policy

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout /  Ubah )

Foto Google

You are commenting using your Google account. Logout /  Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout /  Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout /  Ubah )

Connecting to %s