BGP Configuration (part 4)


Part 1, Part 2, and Part 3 here

Although there is many bgp keywords/features that i’m not mentioning here, let’s end it with 4 important features left:

  • BGP Confederation
  • BGP Route-Reflector
  • BGP AS Filtering with Regular Expression (Regexp)
  • BGP Community

The Wrap-up after I learn a little about this protocol…

Holy Sh*t…This is the most complex routing protocol I ever learn haha


Route Confederation

Remember when we talk about BGP Full Mesh…lets take a look at topology below

It would be bothersome if we must configure bgp peering one by one right ?

In BGP, one way to avoid this is Route Confederation…we divide one big AS into smaller AS like the topology below

Lets see the configuration on eBGP of AS 1 and AS 2(R5 and R6)


  • In R5:
    • Router bgp [sub-AS number]…we don’t configure main-AS as the number in BGP Confederation
    • Confederation identifier explain the main AS the router resides
    • Confederation peers explain other iBGP sub-AS that directly connected through this sub-AS
    • Dont forget to add each neighbors with their respectives number
    • Add network keyword to ensure ping successful to R6 in AS 2 from AS 1 routers (if you ping without source)
  • In R6:
    • Just common e-BGP peering configuration

After e-BGP peering successful, lets go to other routers


  • In R3:
    • Same confederation identifier, to tell this router that he belongs to AS 1 (main-AS)
    • Confederation peer with sub-AS 5 and sub-AS 12 as his directly connected sub-AS neighbor
    • Dont forget to add each neighbor with their respectives number
    • And also next-hop-self (remember part 2 about BGP rules)
    • And add the network (just like in IGP configuration) to ensure successful communication between routers
  • In R4
    • We only add confederation identifier because R4 achieve confederation peering from R3
    • Dont forget about neighbor and also add network like you’ve done in IGP configuration (if you ping without source)

And so on with R1 and R2, the configuration is roughly the same like R3 and R4


Route Reflector

Another way aside from Route Confederation is Route Reflector

Route Reflector is more processing friendly, because we can choose some routers to mirror their peering to neighbors

For example, in topology below R4 want to achieve route from R3 but we dont want to connect them directly, we can use route-reflector to achieve this

Initial configuration (R1 through R4)

Here’s the initial achieved BGP network in R4 (or R3)

Now we add route-reflector…


  • To achieve route-reflector(mirror)…we need client/mirror to catch
  • So we set neighbor R3 ( and R4 ( to catch each other via route-reflector-client keyword

Now we look at R4

Now R4 (or in R3 respectively) get each other route via mirroring/reflector from R2


BGP Route Filtering (Regular Expression/Regexp)

In the real world…one of most useful of regexp implementation is we must filter which AS that we wish to see, because of many ISP network advertised to our router

Here’s is initial show ip bgp with the respective topology

Imagine there is more network to display when we use show ip bgp

So…we filter using BGP Regular Expression (this feature comes up not only in IP Network…in programming regexp exist too) or just call it Regexp

Example…we want to filter only AS 200 to came up in display

Or we want only AS with the second and third number using 0 (zero) to display

The first one = ^200$

  • The “^” mark is to define..”it start with number on the right after this mark”…
  • The “$” mark is to define..”it end with number on the left before this mark”…
  • So…^200$ means that this regex is filtering AS that start with number 2,0, and then ends with 0

The second one = .00$

  • The “.” Mark is to define…”any number”
  • So…”.00$” means that any AS-path number can be displayed as long as followed by two 0’s behind

There’s many symbol to use…use this as reference


BGP Community

remember BGP Configuration part 2 when we learn about how to change BGP “metric” that called path attribute…

this Community works that way…change path attribute

but…instead of configuring on OUR Router(a.k.a costumer router) solely, we configure it at PE Router (ISP Router)

so…BGP Community works this way: ISP influence costumer router for deciding best path for the route and then reduces costumer configuration on their router

ISP: “hey…i’m tagging network with 12:300 community value…use it accordingly

Costumer: “ok…for the network that come from ISP with community value 12:300…i will use [insert path attributes here]

ISP:”new update…there is a new best route, its value it still the same…use it well

Costumer:”no problem


Costumer:”Dude !!…as long as community value is still the same, just pass it up here..it’s automatically configured on our router

let’s see the example

community 1

we try to influence BGP path decision (example: local-pref) process from R3 (lets say this is ISP) to R1 and R2 (costumer)

community 2

above picture is the initial network advertised to R1 via R3 with default local-pref value (100)

let configure BGP Community on R3 first and then configure on R1 & R2 respectively

community 3


  • send-community keyword is to make this router send community information to this neighbor
  • and then create route-map for each peer (below picture) to set community value and filter which his network get the community with outbound traffic (we want to send the packet right? not receive it)

community 4


  • create route-map to permit which network that get the community tag
  • and set community tag, there is 2 version…Cisco Version and IEEE version
    • if we set, for example, set community 12345…this is Cisco version
    • but if we set, set community [AS:Tag Value]…this is IEEE version
  • to use IEEE version we must use ip bgp-community new-format
  • and then create access-list (below picture) to permit the network that we want to tag with community
  • so, for R1 use community value 100:300 to network
  • but for R2, use community value 100:250 to network
  • the aim is, if R2 want to send packet to, he must not send it directly to R3 (verification at the bottom page)

but hey…above configuration is 100:300 right?? isn’t it should be 12:300??

yes..a typo >_< , initially I want to create AS 100 instead of AS 1

but it doesn’t matter…have s*x…i mean, it still working properly (for now) haha

I honestly dont know why is it working…eventhough the AS is typo

and then…why you use 300 or 250 ?!? that value is just a TAG for community, its free to choose (i think)

now let’s take a look on R1 and R2

community 5


  • create neighbor with route-map that use community with inbound traffic (receive packet)
  • match it with community ACL, ip community-list [number] permit [community value]
  • and if it match, tag it with set local preference [value]
  • if we dont use route-map [name] permit 30, all traffic that don’t match with previous route-map will be dropped
  • and R2 configuration is roughly the same (below picture)

community 6

let’s see the effect:

comm 1

now R1 and R2, based on community value that R3 sent, will react to and route accordingly

let’s trace it…

community 8

see…R2 send packet to is through R1 ( first

but to…send directly


comm 2

and then, there are special values for community attributes

no_export: do not advertise community to outside AS (remember..community is “transitive-optional BGP attributes”, see BGP Theory)

no_advert: do not advertise to any other peers

local_as: do not advertise outside the local confederation sub-AS

example configuration:

comm 3

where is the result/effect of this configuration??

later (or not at all), i’m going crazy with all these configuration (now you ask me to add another-AS to see the result @_@)

let’s take a break…if i have free time (and motivation haha), i will post it

ok…done, i’m back with bahasa Indonesia typing again hahaha

BGP (Border Gateway Protocol)


BGP adalah salah satu routing protocol selain RIP, EIGRP, & OSPF

klo RIP, EIGRP, & OSPF tugas nya menghubungkan router satu dengan router yang lain (Interior Gateway Protocol / IGP)

klo BGP ini EGP (Emang Gua Pikirin *maap* Exterior Gateway Protocol), menghubungkan antar AS

BGP ini tugasnya menghubungkan antar ISP (yang masing2 ISP punya nomor unique sendiri2 yang disebut AS / Autonomous System)

AS = collection of networks under single administration

lalu apa bedanya AS EIGRP dengan AS BGP (ISP) ??? AS EIGRP itu kek OSPF Area…beda antara mereka adalah

  • OSPF
    • Area OSPF beda bisa saling terhubung (asal terhubung ke area 0 atau kondisi lainnya terpenuhi)
    • Update hanya berlangsung dan di proses di Area itu saja (tidak nyebar ke Area lain)
    • Beda Area (Baca: Beda AS)…ga bisa saling terhubung, HARUS PAKE REDISTRIBUTION

EGP sebener nya routing protocol tersendiri yang terpisah dari BGP, cuma EGP uda obsolete(kuno)…akhirnya BGP itu sendirilah yang diafiliasikan dengan EGP

nah…klo AS EIGRP bisa kita set sendiri (toh masih IGP…masi didalam satu ISP), klo AS BGP yang ngatur adalah IANA (ICANN) tepatnya RIR (Regional Internet Registry)

RIR ini adalah anak organisasi IANA yang ngatur alokasi IP (public) dan AS BGP (link IANA vs ICANN)

ada 5 RIR:

  • AfriNIC (African Network Information Centre)
  • APNIC (Asia Pacific Network Information Centre)
  • ARIN (American Registry for Internet Numbers – North America)
  • LACNIC (Latin American and Carribean Network Information Centre)
  • RIPE NCC (Reseaux IP Europeens Network Coordination Centre – Europe, Timur Tengah, Central Asia)

AS BGP itu size nya 16 bit yang berarti dari 1 sampai 65,535, dimana AS 64,512 sampai 65,535 (1023 buah) itu buat private use (mirip ke Private IP)

makanya klo tes ato contoh soal/lab yang menggunakan BGP pasti pake AS yang ga jauh2 dari yang diatas (supaya ga ngambil AS orang/organisasi lain yang Legal)

sekarang sudah ada AS yang 32 bit (yang artinya nomor AS itu bisa ampe 4 milyar, untuk mengatasi depleted AS…kek IP juga yang depleted *facepalm*)

Requirement for Implementing BGP is

  • Public IP address ^_^ (klo ga pake aja NAT)
  • Routing Protocol (bisa statis ato dinamis)

BGP pake TCP port 179 untuk metode pengiriman packet dan triggered update nya

BGP “hold down” timer dikirim tiap 60 detik sekali (istilah di BGP namanya keepalive message)

Any Router that runs BGP is called a BGP speaker.

and Any Router that form BGP neighborship is called BGP Peers.

dibandingkan routing protocol lain, config BGP terhitung paling ribet dan kompleks

klo RIP pake metric nya HOP, IS-IS bandwidth, OSPF cost, EIGRP banyak *wkwkw*

nah klo BGP pake metricnya apa ?? BGP kaga pake metric

BGP itu policy-based routing protocol, dia ngontrol traffic packet berdasarkan attibut2 (bukan metric) yang dia punya

untuk traffic A dia pake attibut X…untuk traffic B dia pake attribut Y..dst

klo IGP router konfig/announce list network-nya (contoh: router rip lalu network x.x.x.x)

klo BGP itu announce network reachability information


(sorry…harusnya ip add dan

baik R1 dan R2 men-define neighbor nya (yang pake BGP tentunya)

lalu memutuskan network2 mana saja yang mau dikasi ke neighbornya itu

When to Use BGP??

  • when multi-homed (see below)
  • Network kita (AS Kita) adalah transit AS (menghubungkan AS satu ke yang lain)
  • Inter-AS policy harus di modifikasi

When Not??

  • Single homed (see below)
  • RAM dan CPU router ga cukup kuat untuk menunjang BGP
  • lo kaga bisa make Route-Filtering dan Route-Mapping…hahah


BGP Connectivity Type

single homed: 1 router kita cuma punya 1 jalan ke ISP

single homing biasanya ga pake BGP…pake static route aja cukup

biasanya klo single homing pake BGP tu buat announce public network nya Company ke ISP dan ISP announce default route ke Client (toh untuk internetan doank kan?!?)

dual homed: kita punya 2 router yang punya jalan ke 1 ISP (atau 1 router tapi punya 2 jalan ke ISP)

biasanya tipe ini pake BGP, dan juga IP SLA untuk “bring-up” backup route ato interface nya

dan juga provide buat load balancing antar interface dengan CEF (Cisco Express Forwarding)

apa itu CEF?? klo dulu router ngirim paket lewat routing table, yang mana perlu RAM dan makan CPU, sekarang dengan CEF…routing process itu melalui Hardware

processing routing lewat hardware lebih cepat dari software

multi homed: 1 router lo ke ISP A, 1 router lagi ke ISP B

lebih flexibel, resilient network…disini juga bisa dimplementasikan BGP

tapi hati2…

klo AS 65500 dapet rute dari ISP A Router D, (klo kita konfig nya ga bener) trus di Advertise ke ISP-B

maka ISP-B bisa saja menganggap rute itu harus lewat AS 65500 (padahal bisa langsung dari ISP B)

alhasil….AS 65500 akan jadi semacam rute transit

nah…salah satu troubleshooting implementasi BGP ya seperti itu…

dual-multi homed: 2 router lo punya link ke masing2 ISP

masalah2 BGP biasanya terdapat di multi-homed dan dual multi-homed (biasanya suboptimal routing)

maksud hati ingin supaya ada rute backup…salah2 konfig, malah rute backup yang ngirimin traffic dari dia ke network kita…repot kan

When BGP is running between routers in different autonomous systems, it is called External BGP (EBGP).

When BGP is running between routers in the same autonomous system, it is called Internal BGP (IBGP).

trus bedanye apee itu be-2?!?!

klo E-BGP itu untuk menghubungkan ISP satu dengan yang lain

klo I-BGP itu seperti contoh dibawah ini:

Customer A (AS 65010) punya dual ISP (1 Main 1 Backup), masing2 ISP kirim default-route nya masing2

nah, taro lah ISP 1 jadi main Route (karena Metric IGP ato karena konfig dari R1&R2)

Customer A ingin kirim traffic ke (di ISP 2 network)

karena ISP 1 jadi main route…it may cause suboptimal route, because to send data into network must travel to ISP 1 first instead of ISP 2 (network kan adanya di ISP 2)

nah, R1 dan R2 memakai BGP internal untuk mereka sendiri guna menentukan best path to destination based on policy yang mereka buat (inget…BGP itu policy based routing)

jadi kek R1 & R2 ngobrol…”yuk..klo kirim data A lewat sini…data B lewat sana

inilah yang dinamakan I-BGP

untuk ngobrol R1 dan R2 dalam menentukan rute keluar pake I-BGLu (ai-biji lu !!…hhahaha)…I-BGP maksudnya

untuk ngobrol R1 dan R2 dengan masing2 ISP disebut E-BGP

makanya…BGP sering juga disebut Path Vector Protocol

dan karena BGP behavior itu policy-based…this protocol cannot perform Load-balancing


BGP Message Type

1. Open Message

didalam nya terdapat beberapa informasi

  • Version number: BGP version
  • AS Number
  • Hold Time: jarak waktu interval antara successive keepalive dan update message dari pengirim (dalam detik)
  • BGP Router ID: 32 bit size, BGP ID ini sama persis kek OSPF Router ID (bahkan proses pemilihannya juga)
  • Optional Parameter: authentication (klo ada, namanya juga optional ^_^ )

2. Keepalive Message

keepalive message ini untuk me-refresh hold time supaya ga expiring (klo expired hold timenya, BGP adjacency nya putus)

3. Update Message

BGP update message hanya punya informasi untuk 1 jalur saja, maksudnya ??

klo IGP kirim update message ke suatu router, isinya adalah jalur2/rute2 yang dia ketahui

klo BGLu *ehm* BGP maksudnya…kirim update message ke suatu router, hanya 1 jalur…lebih dari 1 jalur = lebih dari 1 update message

eh…gw punya update nih…gw tau jalan ke network A” = 1 update message

eh…gw punya update nih…gw tau jalan ke network A, trus ke network B, trus ke network C” = 3 update message

isi dari Update Message:

  • Withdrawn Routes:

    berisi list2 dari Route2 yang dicabut (termasuk IP Prefix nya) dari BGP (jadi kek kasi notifikasi gitu loh)

  • Path attributes:

    isinya “metric2” alias attribute2 dari BGP…kek AS Path, Origin, Local Preference, dll

  • Network-Layer Reachability Information:

    kebalikan dari Withdrawn Route, isinya adalah rute2 yang reachable oleh BGP

4. Notification Message

ini mah klo ada error…hahaha


BGP “Metric” that called Attributes

BGP ga punya metric, cuma karena gw tau lo uda terbiasa ama metric…gw bilang aja ini “seakan2” metric…hahaha

BGP Attribute inilah yang bertugas men-decide mana best path (best route), remember BGP cannot Load Balancing…only 1 path (but can perform load sharing)

Load sharing
is the ability to distribute incoming/outgoing traffic over multiple paths

Load balancing
is the ability to split the load (split packet) toward the same destination (host or IP) over multiple paths.

  • “Well-Known” BGP Attributes (attribut2 BGP yang harus “dikenali” oleh BGP Speaker ketika peering)
    • Mandatory “Well-Known” (attribut2 yang harus appear disetiap update message)
      • Origin = tempat asal dari BGP route…apakah itu rute BGP di-announce oleh IGP router, oleh BGP router yang lain, ato dari redistribusi
      • AS-Path = ini kek ip route…cuma namanya kita ganti jadi AS Route
      • Next-Hop = ip address dari next -hop router
    • Discretionary “Well-Known” (may / may not appear in update message, tapi tetap harus disupport klo di implementasikan ini attribut)
      • Local Preference =rute BGP yang diterima dari BGP neighbor, default value nya adalah 100
      • Aggregation = klo di IGP ini attribute dinamakan “Route Summarization
  • Optional BGP Attribute (atribut2 BGP yang disupport atau tidak disupport oleh BGP Speaker)
    • Transitive (support ato ga support itu BGP Speaker yang receive  update, kalo update message nya contain attribute ini…tetep harus di-pass ke next AS, kali2 aja AS lain tau attribute2 itu buat apa)
      • Aggregator = IP address dan AS number nya si Router yang perform route aggregation
      • Community = isi nya route-tagging…nah lo…
    • Non-Transitive (klo pun ga support, BGP Receiver…ga ada kewajiban untuk ngoper update nya ke AS lain)
      • MED (multi exit discriminator) = attribute ini berguna untuk membedakan/memisahkan multiple entry points yang masuk kedalam satu AS

Next Hop BGP Attibutes


biasanya next-hop emang ip address dari sending router nya


tapi akan bahaya klo switch nya FRAME-RELAY (NBMA)


BGP Path Selection Process (klo ada beberapa path/jalur ke satu tempat yang sama)

  1. Weight (Cisco Propiertary), klo lo konfig BGP…yang pertama diliat adalah Weight untuk menentukan best path (local router akan nentuin mana Weight yang lebih besar untuk best path.., INGET…CISCO ONLY

    weight ini value nya dari 0 – 65535, defaultnya 32768 (dari Router itu sendiri) dan 0 dari dari path lain, weight ini hanya dikonfig di router local dan ga dikasi ke router lainjadi weight ini ibarat kita setting di router, yang mana dari path2 BGP ini yang kita “beratin timbangannya“, untuk dipilih duluan adalah yang paling berat

  2. Local Preference, klo attribute Weight nya sama (Cisco) atau klo vendor lain…ini yang dilihat selanjutnya, para router di AS yang sama akan ngeliat attribute ini

    yang paling tinggi yang dipilih. default value nya adalah 100

  3. Default Route, klo local preference dari beberapa path yang ditawarkan BGP itu sama, di local router akan memilih Default Route
  4. Shortest AS Path, klo ga ada default route, para router akan ngeliat berdasarkan path AS yang paling pendek (kek RIP…yang paling kecil AS hop count nya)
  5. klo masih sama, liat dari Origin of path (yang paling kecil yang dipilih), para router akan memilih best path yang dipilihkan oleh IGP (IGP origin < EGP Origin)
  6. MED (multi exit discriminator), ini tu bisa diibaratkan BGP metric, jika origin sama (tarolah dari 1 EIGRP AS), MED ini di-exchange between AS, yang paling rendah yang dipilih
  7. prefer liat i-BGP daripada e-BGP
  8. prefer shortest Path to closest IGP Neighbor, jadi router milih jalan terdekat ke BGP Speaker (masih dalam IGP yang sama)
  9. prefer oldest route, liat route yang paling lama di routing table (cocok untuk interface BGP yang up down terus2an…alias “flapping”)
  10. prefer lowest BGP Router ID
  11. jika sama BGP Router ID nya, prefer lowest IP address

banyak kan ?!?!?! @_@

dan attribute2 itulah yang kita setting untuk BGP

belum lagi ada regular expression (REGEXP) kek ^, $, [], , (), ., *, +, ? untuk modifikasi Shortest AS Path yang kita mo buat

konfig BGP nya dibagi jadi 4 part…silakan liat di indeks