Posted by: Barly Wicaksono | 25 January, 2013

Routing BGP (External BGP) di Juniper

Basic Knowledge

Tutorial kali ini, berisi tentang External BGP di Juniper. Biasanya isinya pake bahasa Inggris kan ya?ūüėÄ. Nah sekarang ane bahas pake Bahasa Indonesia deh… Konsep dari BGP external ini adalah menggunakan 2 AS Number yang berbeda (54321 & 12345). Dan menggunakan IGP yang sama pada setiap AS Number yaitu OSPF. Konfigurasi internal BGP berasal dari tutorial sebelumnya :¬†Routing BGP (Internal BGP) di Juniper.
Dengan menambahkan 2 buah router yaitu Surabaya dan Bali. Lebih jelasnya dapat dilihat pada gambar topologi dibawah ini :

EBGP

EBGP

.

Konfigurasi Router

Konfigurasi routing pada iBGP AS 54321 dapat dilihat pada link berikut ini :
https://barliesucks.wordpress.com/2012/04/03/routing-bgp-ibgp-di-juniper/

Setelah kita konfigurasi iBGP AS 54321, maka tugas berikutnya adalah menambahkan konfigurasi routing iBGP untuk AS 12345 yang berisi Router Surabaya & Bali. Konfigurasinya seperti berikut :

- Logical Router Surabaya -
set logical-routers Surabaya interfaces em4 unit 0 vlan-id 30
set logical-routers Surabaya interfaces em4 unit 0 family inet address 34.34.34.2/30
set logical-routers Surabaya interfaces em4 unit 1 vlan-id 40
set logical-routers Surabaya interfaces em4 unit 1 family inet address 192.168.0.1/30
set logical-routers Surabaya interfaces lo0 unit 3 family inet address 4.4.4.4/32
set logical-routers Surabaya protocols bgp group Internal_BGP type internal
set logical-routers Surabaya protocols bgp group Internal_BGP local-address 4.4.4.4
set logical-routers Surabaya protocols bgp group Internal_BGP export IBGP_Export
set logical-routers Surabaya protocols bgp group Internal_BGP export Bocorin_Route
set logical-routers Surabaya protocols bgp group Internal_BGP neighbor 5.5.5.5
set logical-routers Surabaya protocols ospf area 0.0.0.0 interface em4.1
set logical-routers Surabaya protocols ospf area 0.0.0.0 interface lo0.3 passive
set logical-routers Surabaya protocols ospf area 0.0.0.0 interface em4.0
set logical-routers Bali routing-options autonomous-system 12345

- Logical Router Bali -
set logical-routers Bali interfaces em5 unit 0 vlan-id 40
set logical-routers Bali interfaces em5 unit 0 family inet address 192.168.0.2/30
set logical-routers Bali interfaces lo0 unit 4 family inet address 5.5.5.5/32
set logical-routers Bali protocols bgp group Internal_BGP type internal
set logical-routers Bali protocols bgp group Internal_BGP local-address 5.5.5.5
set logical-routers Bali protocols bgp group Internal_BGP neighbor 4.4.4.4
set logical-routers Bali protocols ospf area 0.0.0.0 interface lo0.4 passive
set logical-routers Bali protocols ospf area 0.0.0.0 interface em5.0
set logical-routers Bali routing-options autonomous-system 12345
---------------------------------------------------------------------------------------

Kemudian kita cek protokol BGP pada masing-masing router apakah sudah dapat membaca loopback neighbor router lain atau belum. Perintahnya sebagai berikut :

- Show BGP SUmmary -
[edit]
barly# run show bgp summary logical-router Surabaya
Groups: 1 Peers: 1 Down peers: 0
Table          Tot Paths  Act Paths Suppressed    History Damp State    Pending
inet.0                 0          0          0          0          0          0
Peer               AS      InPkt     OutPkt    OutQ   Flaps Last Up/Dwn State|#Active/Received/Damped...
5.5.5.5         12345        157        162       0       0     1:10:14 0/0/0                0/0/0

[edit]
barly# run show bgp summary logical-router Bali
Groups: 1 Peers: 1 Down peers: 0
Table          Tot Paths  Act Paths Suppressed    History Damp State    Pending
inet.0                 0          0          0          0          0          0
Peer               AS      InPkt     OutPkt    OutQ   Flaps Last Up/Dwn State|#Active/Received/Damped...
4.4.4.4         12345        160        158       0       0     1:10:16 0/0/0                0/0/0
---------------------------------------------------------------------------------------

Highlight diatas membuktikan bahwa Router Surabaya dapat membaca IP Loopback 5.5.5.5 (Bali) dan juga sebaliknya router Bali dapat membaca IP Loopback 4.4.4.4 (Surabaya).
Setelah iBGP masing-masing AS sudah established, kemudian tugas kita adalah melakukan konfigurasi Eksternal BGP untuk membangun hubungan antara router Surabaya & Semarang agar dapat berkomunikasi. Konfigurasinya seperti dibawah ini :

- Logical Router Surabaya -
set logical-routers Surabaya protocols bgp group External_BGP type external
set logical-routers Surabaya protocols bgp group External_BGP peer-as 54321
set logical-routers Surabaya protocols bgp group External_BGP neighbor 34.34.34.1

- Logical Router Semarang -
set logical-routers Semarang protocols bgp group External_BGP type external
set logical-routers Semarang protocols bgp group External_BGP peer-as 12345
set logical-routers Semarang protocols bgp group External_BGP neighbor 34.34.34.2
---------------------------------------------------------------------------------------

Cek BGP Summary (Semarang <> Surabaya) apakah sudah established atau belum. Berikut ini perintahnya :

- Show BGP Summary -
[edit]
barly# run show bgp summary logical-router Semarang
Groups: 1 Peers: 2 Down peers: 0
Table          Tot Paths  Act Paths Suppressed    History Damp State    Pending
inet.0                 0          0          0          0          0          0
Peer               AS      InPkt     OutPkt    OutQ   Flaps Last Up/Dwn State|#Active/Received/Damped...
1.1.1.1         54321        169        176       0       0     1:16:08 0/0/0                0/0/0
2.2.2.2         54321        169        175       0       0     1:16:04 0/0/0                0/0/0

[edit]
barly# run show bgp summary logical-router Surabaya
Groups: 1 Peers: 1 Down peers: 0
Table          Tot Paths  Act Paths Suppressed    History Damp State    Pending
inet.0                 0          0          0          0          0          0
Peer               AS      InPkt     OutPkt    OutQ   Flaps Last Up/Dwn State|#Active/Received/Damped...
5.5.5.5         12345        172        180       0       0     1:16:34 0/0/0                0/0/0
---------------------------------------------------------------------------------------

Dari highlight diatas ternyata BGP masing-masing router masih tidak konek dengan neighbor AS lain , it means you have to think harder bro…ūüėÄ. Apa yang salah coba?, udah rumit begini ternyata masih ada yang salah? -_-“.
Setelah googling ternyata permasalahannya adalah pada BGP external yang tidak dapat mendeteksi ip gateway yang terdapat pada neighbor AS. Agar kita dapat sharing BGP routing table antar AS, maka kita konfigurasikan yang dinamakan “Next Hop Self & Policy Routing”. Berikut konfigurasinya :

 - Logical Router Surabaya -
set logical-routers Surabaya policy-options policy-statement IBGP_Export term NHS from protocol bgp
set logical-routers Surabaya policy-options policy-statement IBGP_Export term NHS from neighbor 34.34.34.1
set logical-routers Surabaya policy-options policy-statement IBGP_Export term NHS then next-hop self
set logical-routers Surabaya policy-options policy-statement direct term 1 from protocol direct
set logical-routers Surabaya policy-options policy-statement direct term 1 then accept
set logical-routers Surabaya policy-options policy-statement export-ospf term 1 from protocol ospf
set logical-routers Surabaya policy-options policy-statement export-ospf term 1 then accept

- Logical Router Semarang -
set logical-routers Semarang policy-options policy-statement IBGP_Export term NHS from protocol bgp
set logical-routers Semarang policy-options policy-statement IBGP_Export term NHS from neighbor 34.34.34.2
set logical-routers Semarang policy-options policy-statement IBGP_Export term NHS then next-hop self
set logical-routers Semarang policy-options policy-statement direct term 1 from protocol direct
set logical-routers Semarang policy-options policy-statement direct term 1 then accept
set logical-routers Semarang policy-options policy-statement export-ospf term 1 from protocol ospf
set logical-routers Semarang policy-options policy-statement export-ospf term 1 then accept
---------------------------------------------------------------------------------------
 

Setelah kita konfigurasi, maka kemudian kita cek apakah BGP Peer masing-masing AS sudah terdeteksi Kita ambil contoh pada router Jakarta dan Bali. Perintahnya sebagai berikut :

- Show Route Protocol BGP -
[edit]
barly# run show route logical-router Jakarta

inet.0: 10 destinations, 10 routes (10 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both

1.1.1.1/32         *[Direct/0] 00:21:31
                    > via lo0.1
2.2.2.2/32         *[OSPF/10] 00:20:40, metric 1
                    > to 12.12.12.2 via em0.0
3.3.3.3/32         *[OSPF/10] 00:20:35, metric 2
                    > to 12.12.12.2 via em0.0
4.4.4.4/32         *[BGP/170] 00:20:22, localpref 100, from 3.3.3.3
                      AS path: 12345 I
                    > to 12.12.12.2 via em0.0
5.5.5.5/32         *[BGP/170] 00:20:22, MED 1, localpref 100, from 3.3.3.3
                      AS path: 12345 I
                    > to 12.12.12.2 via em0.0
12.12.12.0/24      *[Direct/0] 00:21:31
                    > via em0.0
12.12.12.1/32      *[Local/0] 00:21:31
                      Local via em0.0
23.23.23.0/24      *[OSPF/10] 00:20:40, metric 2
                    > to 12.12.12.2 via em0.0
192.168.0.0/30     *[BGP/170] 00:20:22, localpref 100, from 3.3.3.3
                      AS path: 12345 I
                    > to 12.12.12.2 via em0.0
224.0.0.5/32       *[OSPF/10] 00:21:36, metric 1
                      MultiRecv

[edit]
barly# run show route logical-router Bali

inet.0: 10 destinations, 10 routes (10 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both

1.1.1.1/32         *[BGP/170] 00:20:49, MED 2, localpref 100, from 4.4.4.4
                      AS path: 54321 I
                    > to 192.168.0.1 via em5.0
2.2.2.2/32         *[BGP/170] 00:20:49, MED 1, localpref 100, from 4.4.4.4
                      AS path: 54321 I
                    > to 192.168.0.1 via em5.0
3.3.3.3/32         *[BGP/170] 00:20:49, localpref 100, from 4.4.4.4
                      AS path: 54321 I
                    > to 192.168.0.1 via em5.0
4.4.4.4/32         *[OSPF/10] 00:21:09, metric 1
                    > to 192.168.0.1 via em5.0
5.5.5.5/32         *[Direct/0] 00:21:58
                    > via lo0.4
12.12.12.0/24      *[BGP/170] 00:20:49, MED 2, localpref 100, from 4.4.4.4
                      AS path: 54321 I
                    > to 192.168.0.1 via em5.0
23.23.23.0/24      *[BGP/170] 00:20:49, localpref 100, from 4.4.4.4
                      AS path: 54321 I
                    > to 192.168.0.1 via em5.0
192.168.0.0/30     *[Direct/0] 00:21:58
                    > via em5.0
192.168.0.2/32     *[Local/0] 00:21:58
                      Local via em5.0
224.0.0.5/32       *[OSPF/10] 00:22:03, metric 1
                      MultiRecv
---------------------------------------------------------------------------------------

Selesai sudah tutorial ini, ane capek nih… seharian analisa beginian. Selamat menikmati ya…Semoga berguna untuk kita semua. Aamiin.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Categories

%d bloggers like this: