Posted by: Barly Wicaksono | 3 April, 2012

Routing BGP (Internal BGP) di Juniper

Basic Knowledge

Peer ASs establish links through an external peer BGP session. As a result, all route advertisement between the external peers takes place by means of the EBGP mode of information exchange. To propagate the routes through the AS and advertise them to internal peers, BGP uses IBGP. To advertise the routes to a different peer AS, BGP again uses EBGP.

BGP uses two primary modes of information exchange, internal BGP (IBGP) and external BGP (EBGP), to communicate with internal and external peers, respectively.

To avoid routing loops, IBGP does not advertise routes learned from an internal BGP peer to other internal BGP peers. For this reason, BGP cannot propagate routes throughout an AS by passing them from one router to another. To achieve an IBGP full mesh, you configure a direct peering session every host to every other host within the network. These sessions are configured on every router within the network, as type internal.

As a network grows, the full mesh requirement becomes increasingly difficult to manage. In a network with 1000 routers, the addition of a single router requires that all the routers in the network be modified to account for the new addition. To combat these scaling problems, BGP uses route reflection and BGP confederations. (Sumber)

iBGP

iBGP

.

Konfigurasi Router

- Logical Router Jakarta -
set logical-routers Jakarta interfaces em0 unit 0 vlan-id 20
set logical-routers Jakarta interfaces em0 unit 0 family inet address 12.12.12.1/24
set logical-routers Jakarta interfaces lo0 unit 1 family inet address 1.1.1.1/32

- Logical Router Cirebon -
set logical-routers Cirebon interfaces em1 unit 0 vlan-id 20
set logical-routers Cirebon interfaces em1 unit 0 family inet address 12.12.12.2/24
set logical-routers Cirebon interfaces em1 unit 1 vlan-id 30
set logical-routers Cirebon interfaces em1 unit 1 family inet address 23.23.23.1/24
set logical-routers Cirebon interfaces lo0 unit 0 family inet address 2.2.2.2/32

- Logical Router Semarang -
set logical-routers Semarang interfaces em2 unit 0 vlan-id 30
set logical-routers Semarang interfaces em2 unit 0 family inet address 23.23.23.2/24
set logical-routers Semarang interfaces lo0 unit 2 family inet address 3.3.3.3/32
---------------------------------------------------------------------------------------

Konfigurasi diatas adalah penambahan router dan juga setting ip address point-to-point antar router dan juga penambahan vlan masing-masing subnet. Sebelum konfigurasi BGP diaktifkan, maka kita harus menggunakan IGP sebagai “detector loopback” pada router. Hal ini dilakukan karena BGP bersifat Path Vector. Kemudian saat ini kita konfigurasi protokol IGP yang berfungsi sebagai jembatan komunikasi hingga loopback, seperti berikut :

- Logical Router Jakarta -
set logical-routers Jakarta protocols ospf area 0.0.0.0 interface lo0.1 passive
set logical-routers Jakarta protocols ospf area 0.0.0.0 interface em0.0

- Logical Router Cirebon -
set logical-routers Cirebon protocols ospf area 0.0.0.0 interface lo0.0 passive
set logical-routers Cirebon protocols ospf area 0.0.0.0 interface em1.0
set logical-routers Cirebon protocols ospf area 0.0.0.0 interface em1.1

- Logical Router Semarang -
set logical-routers Semarang protocols ospf area 0.0.0.0 interface lo0.2 passive
set logical-routers Semarang protocols ospf area 0.0.0.0 interface em2.0
---------------------------------------------------------------------------------------

Mari kita cek protokol OSPFnya, apakah sudah jalan semua atau belum. Jika sudah, maka interface loopback milik neighbor akan terdeteksi dengan baik di setiap router.  Seperti dibawah ini :

- Show Route Protocol OSPF -
barly> show route protocol ospf logical-router all

logical-router: Cirebon

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

1.1.1.1/32         *[OSPF/10] 04:07:44, metric 1
                    > to 12.12.12.1 via em1.0
3.3.3.3/32         *[OSPF/10] 04:07:44, metric 1
                    > to 23.23.23.2 via em1.1
224.0.0.5/32       *[OSPF/10] 04:08:38, metric 1
                      MultiRecv
-----

logical-router: Jakarta

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

2.2.2.2/32         *[OSPF/10] 04:07:44, metric 1
                    > to 12.12.12.2 via em0.0
3.3.3.3/32         *[OSPF/10] 04:07:44, metric 2
                    > to 12.12.12.2 via em0.0
23.23.23.0/24      *[OSPF/10] 04:07:44, metric 2
                    > to 12.12.12.2 via em0.0
224.0.0.5/32       *[OSPF/10] 04:08:38, metric 1
                      MultiRecv
-----

logical-router: Semarang

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

1.1.1.1/32         *[OSPF/10] 04:07:44, metric 2
                    > to 23.23.23.1 via em2.0
2.2.2.2/32         *[OSPF/10] 04:07:44, metric 1
                    > to 23.23.23.1 via em2.0
12.12.12.0/24      *[OSPF/10] 04:07:44, metric 2
                    > to 23.23.23.1 via em2.0
224.0.0.5/32       *[OSPF/10] 04:08:38, metric 1
                      MultiRecv
---------------------------------------------------------------------------------------

Jika sudah terdeteksi dengan baik, mari kita konfigurasi protokol BGP (Internal BGP) dengan AS Number 54321. Seperti dibawah ini :

- Logical Router Jakarta -
set logical-routers Jakarta protocols bgp group BEGEPE type internal
set logical-routers Jakarta protocols bgp group BEGEPE local-address 1.1.1.1
set logical-routers Jakarta protocols bgp group BEGEPE neighbor 3.3.3.3
set logical-routers Jakarta protocols bgp group BEGEPE neighbor 2.2.2.2

- Logical Router Cirebon -
set logical-routers Cirebon protocols bgp group BEGEPE type internal
set logical-routers Cirebon protocols bgp group BEGEPE local-address 2.2.2.2
set logical-routers Cirebon protocols bgp group BEGEPE neighbor 1.1.1.1
set logical-routers Cirebon protocols bgp group BEGEPE neighbor 3.3.3.3

- Logical Router Semarang -
set logical-routers Semarang protocols bgp group BEGEPE type internal
set logical-routers Semarang protocols bgp group BEGEPE local-address 3.3.3.3
set logical-routers Semarang protocols bgp group BEGEPE neighbor 2.2.2.2
set logical-routers Semarang protocols bgp group BEGEPE neighbor 1.1.1.1
---------------------------------------------------------------------------------------

Setelah konfigurasi BGP dilakukan, maka berikutnya tinggal kita cek apakah protokol BGP berjalan atau tidak. Seperti dibawah ini :

- Show BGP Summary -
[edit]
barly# run show bgp summary logical-router all

logical-router: Cirebon
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         43         46       0       0       19:41 0/0/0                0/0/0
3.3.3.3         54321         44         45       0       0       19:41 0/0/0                0/0/0
-----

logical-router: Jakarta
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...
2.2.2.2         54321         45         45       0       0       19:41 0/0/0                0/0/0
3.3.3.3         54321         44         47       0       0       19:42 0/0/0                0/0/0
-----

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         46         46       0       0       19:42 0/0/0                0/0/0
2.2.2.2         54321         43         45       0       0       19:41 0/0/0                0/0/0
---------------------------------------------------------------------------------------

Highlight diatas menampilkan bahwa protokol BGP dapat membaca interface loopback milik neighbor lain. Jika anda tidak percaya bahwa BGP reachability berdasar IGP, maka ada baiknya kita coba simulasikan. Kita coba delete salah satu IGP pada router pada topologi, Jakarta misalkan. Seperti dibawah ini :

[edit]
barly# edit logical-routers Jakarta

[edit logical-routers Jakarta]
barly# delete protocols ospf

[edit logical-routers Jakarta]
barly# top

[edit]
barly# commit
---------------------------------------------------------------------------------------

Hasil dari pekerjaan diatas adalah sebagai berikut :

[edit]
barly# run show bgp summary logical-router all

logical-router: Cirebon
Groups: 1 Peers: 2 Down peers: 1
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         56         64       0       1          20 Active
3.3.3.3         54321         61         62       0       0       27:10 0/0/0                0/0/0
-----

logical-router: Jakarta
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...
2.2.2.2         54321         60         62       0       0       27:10 0/0/0                0/0/0
3.3.3.3         54321         59         63       0       0       27:11 0/0/0                0/0/0
-----

logical-router: Semarang
Groups: 1 Peers: 2 Down peers: 1
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         59         63       0       1          11 Active
2.2.2.2         54321         60         62       0       0       27:10 0/0/0                0/0/0
---------------------------------------------------------------------------------------

Terlihat setelah kita delete protokol ospf pada router Jakarta, maka status bgp menjadi “active” (highlight) .
Berikut catatan mengenai konektivitas BGP :

  • Idle, router menolak semua sesi paket yang datang dari lawan
  • Connect, router sedan menunggu tcp session yang akan terjadi
  • Active, router melakukan inisialisasi TCP ke lawan
  • OpenSent, kondisi dimana jika proses connect dan Active sukses
  • Established, kondisi dimana BGP sudah berjalan sebagaimana mestinya, pertukaran pesan keeplive sudah terjadi .

Responses

  1. […] 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 […]


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: