Home

BGP Configuration (part 1)

12 Comments

(article yang lama akan coba gw update disini…dan gw coba jelasin in english…biar gaya)

Today we learn about how to configure basic BGP configuration such as,

  • e-BGP
  • i-BGP (with loopback)
  • BGP Full Mesh
  • peer-group
  • BGP authentication
  • And BGP Summarization

And the topology we use throughout this article is like this

Note: IP Scheme is 192.168.XX.X..where XX is the combined number of routers, such as R2 and R3 would be 192.168.23.2 and 23.3

We use OSPF as IGP (Internal) Protocol in AS 1

I already assume you have good understanding how to configure basic IP Configuration on Cisco Router here…

I’m trying to explain step-by-step…including error, note, important detail that I learn when configuring basic BGP Configuration

================================================

Configuring e-BGP

e-BGP (external BGP) = Connecting different BGP AS (Autonomous System)

We configure R1 and R5

Wait a little longer (10-20s)…BGP Convergence is verrrry slooow

To see list of BGP neighbor, we could use show ip bgp summary

to perform eBGP WITHOUT connecting directly…we must use eBGP-multihop (we’ll talk about it in the next parts)

================================================

Configuring i-BGP

i-BGP (internal BGP) = Connecting BGP within AS

We Configure R1 and R3

If R1 peering within AS (i-BGP), we must check wether route to destination peer is exist within routing table (show ip route)

of course…how would R1 know how to deliver BGP Packet (request for Peering with R3) if He doesnt know where to send the packet ?!? *face palm*

So…one of the differences between e-BGP and i-BGP is i-BGP peering routers are not necessary to be directly connected

Configuring i-BGP with Loopback

The question is…if the physical link down…would it be down too with the BGP Peering right ?!?

There are 2 answers: add another physical link to BGP neighborship table, or (the easiest one)…add loopback IP

Because Loopback Interface is never down (remember…this interface is virtual), Loopback Interface will be down if the Router itself down

As long as the routers know how to send packet to loopback IP (acquired via IGP such as OSPF), the neighborship and peering will be fine

To configure i-BGP with loopback, delete neighborship with physical interface first (no neighbor [physical IP] remote-as [AS Number])

the keyword is update-source [interface]

Lets verify the list of the neighbors

=====================================================

BGP Full Mesh

Now…R1 peering with R5 (e-BGP) and R1 peering with R3 (i-BGP)

The next task is…will R3 reach R5 without extra configuration ?!?

Both R3 and R5 connect to R1. To reach R5 (or R3), R1 must advertise the route to both Routers, lets see if R1 advertise rute 10.10.15.1 to R3 (show ip bgp)

The rules of advertising rute is same like i-BGP peering…He must know the route to it/destination

When we see the configuration above, maybe one or two of us will ask the same question

Why 23.0 use mask…why 34.0 not ?!? the answer is…it doesnt matter, it still same result

If we only advertise network WITHOUT mask…BGP will assume that route is classfull (and 192.168.34.0 is classful right ?!? C Class IP)

Note…if we use network 0.0.0.0 mask 0.0.0.0 (some of you will do it because of laziness…JUST ADD ALL !! haha)

The result is not what you are thinking…the router will advertise DEFAULT ROUTE !!! (just think of it…0.0.0.0 0.0.0.0 is default route right ?!?)

So…the way we handle advertised route in BGP is different than IGP such as OSPF

Now lets see if R3 (also R5 will get the same result) get the advertised route…

Lets ping

Ping to R5 10.10.15.5 success, but will it be the same if R3 ping to one of R5 loopback IP such as 5.5.5.5 ?!?

Why is this happen ?? when R3 ping to 10.10.15.5 which is R5, R1 know where to route the packet (directly connected, exist in R1’s routing table)

But when R3 ping to R5 5.5.5.5 loopback IP, lets see R1 routing table

Now we know the problem (5.5.5.5 doesnt exist in R1’s Routing table)…so what is the solution ?!?

Because R1 doesnt know how to route the packet…we must add static route to R5 loopback ip, then see if that static route exist in routing table, advertise using BGP, check using show ip bgp

Lets check on R3…will it be able to ping loopback ip on R5 ?!?

Unreachable…the packets stop on R2 (23.2) and R4 (34.4)

Why is this happen ?!? because R2 and R4 doesnt know where to route the packets !!! (of course…they doesnt know where the F*** 5.5.5.5 is !!!)

The solution ?!? make R2 (and R4) run BGP too (5.5.5.5 acquired via BGP right ?!?)

To make sure a proper BGP implementation, we must configure all router to run BGP? is it like another route protocol?

yes, just like EIGRP and OSPF, BGP is another type of routing protocol right ?!? but this protocol is more suitable in ISP environment

Note: same config apply ro R4, R3, R1

Let see…

But..there is some question…i-BGP peering doesnt need to be directly connected, but now we connect all of them

Isn’t it waste of energy and time ?!?! yes…this is what we called i-BGP Full Mesh

So…imagine if there is more than 4 router…

The formula is n(n-1)/2..where N = sum of all router

So..if there is 25 router..it would be 600 peerings !!!

To overcome this complicated BGP Behavior…BGP has features called Route-Reflector and Route Confederation (later we’ll configure them)

=========================================

BGP Peer-Group

Imagine you type all this…

To reduce that repetition…BGP has feature called Peer-Group

Let me show you the example

============================================================================

BGP Authentication

Its quite simple (lets keep it simple though wkwkwk)

BGP Default authentication is using MD5

===========================================================================

BGP Summarization

BGP auto-summarization is off by default

BGP Summarize route using aggregate command

Lets advertise loopbacks IP from R5

Lets see on R1

dont worry about 5.0.0.0 below 3.3.3.3, I’m advertised static route into BGP remember…thats why that network exist

To reduce routing table and bgp “show ip bgp” table, on R5 we must use route aggregation

Lets see the effect on R1

Whoops…nothing change…except there is “*> “…a blank network

So…we must add a little command here (summary-only)

And the effect…

Yuppp…it works…

See the last line…S 5.0.0.0 [1/0]…its static (S)…not BGP (B), why ?!? because Static Route AD (Administrative Distance) is better than BGP

So…can it be pinged ?!?…yes, sure it can

Thats all folks for today…part 2 coming soon (BGP Route Modification with Path Attributes) insya Allah

FHRP Configuration

2 Comments

Untuk teori ada disini

I assume you all already configure basic ip addressing and I use EIGRP Routing Protocol as default scheme for R2, R3, and R4

And PC (yah…anggeplah router itu PC), cara jadiin router jadi PC seperti dibawah ini:

No ip routing untuk menonaktifkan fitur routing, ip default-gateway ya buat gateway, notice ip gatewaynya 123.123.123.123 (ip virtual nih)

Nah…sekarang kita coba ping dari PC

Klo kita liat…PC ngirim packet lewat 123.123.123.2 alias lewat R2, yuk kita matiin int R2 yang ke PC…masih mau ga ke 4.4.4.4 lewat R3 (123.123.123.3)

Nope….

Sekarang saatnya kita konfig FHRP….first, we configure HSRP (Hot Standby Redudancy Protocol)

Penjelasan:

  • Keyword untuk HSRP adalah “standby
  • Standby [nomor group] ip [ip virtual yang disepakati], untuk nentuin nomor group HSRP dan IP virtual yang sama2 dipake oleh R2 dan R3
  • Nah, si R2 dan R3 sepakat pake “ip bersama” yaitu 123.123.123.123 (harus satu subnet juga yah)
  • Itu nomor group ama IP harus sama yaks…
  • Karena R2 nyala duluan HSRP nya, dia yang akan jadi main route nya (makanya tulisannya Standby -> Active), si R3 jadi backup (Standby)

Nyok kita test ping…(idupin lagi int fa0/0 di R2)

Trus tes ping ke virtual IP nya, jalan ga

Wokeh…ping ke 4.4.4.4 masih lewat R2, sekarang kita shutdown di R2 fa0/0, liat di R3 trus tes ping lagi

Wokeh…jadi active nih bocah

Nah…sekarang lewat 123.123.123.3 (R3), jadi…PC kirim ke gatewaynya dia yang 123.123.123.123 dimana IP itu dipakai oleh R2 dan R3, nah…IP virtual itu di “terjemahkan” ke IP fisiknya R3 (karena R2 nya matek)

Trus coba yuk…kita nyalain lagi fa0/0 di R2

Lah…kok jadi Standby si R2, gw maunya si R2 yang jadi main route lagi…

Caranya dengan keyword “priority” dan “preempt

Penjelasan:

  • Keyword “preempt” digunakan untuk klo prioritas Active Router nya lebih kecil dari dia, maka status Active nya akan diambil alih (default priority = 100)
  • Priority 110, supaya lebih besar dari router sebelah yang default (priority 100)

Sekarang kita tes…shut, trus no shut di R2 Fa0/0

See…dari Listen langsung jadi Active lagi

Trus gimana klo ini R2 nyala-mati-nyala-mati terus ?!?!…masa gonta-ganti terus…makan CPU dong ?!?

Ho oh, makanya kita pake IP SLA…alias track

Yang ini contoh sederhana…

Penjelasan:

  • Kita bikin track dengan nomor 1 untuk nge-track si R2 tentang reachability nya
  • Lalu implement di interface dengan decrement 20, maksudnya !?
  • prioritasnya kan 110 tuh tadi, klo mati (reachability nya down)…prioritas dikurangin 20 (decrement), alias jadi tinggal 90
  • so…otomatis si R3 yang standby, ga mungkin lagi si R2 jadi active walaupun dia idup lagi

nyok kita cek di R2…

Noh kan….jadi Standby…

Coba kita cek pake show standby brief

Priority nya = 90, kalah sama R3 yang default (100)

Contoh IP SLA beneran…apus dulu track nya

Noh…jadi active lagi pas kita cabut track nya…

Nyok…matiin lagi interface fa0/0 di R2

Bedanya track doang ama IP SLA adalah ada notifikasinya klo IP SLA (tracking-5-state: 1 rtr 1 state Down->Up)

Dan HSRP juga support authentikasi kok…

Ini konfig lengkapnya si R2 (R3 Cuma ga ada keyword priority, preempt, sama track)

Untuk lebih jelas tentang status HSRP…kita bisa pake show standby (without brief)

Penjelasan:

  • Kita bisa liat bahwa Fa0/0 di R2 masuk dalam HSRP group 1
  • Statusnya Active (Main Route)
  • Virtual IP nya 123.123.123.123
  • MAC address nya ada rumusnya, yaitu ACXX…dimana XX itu nomor HSRP nya (dalam hal ini kita pake HSRPv1), HSRP yang baru pake FXXX

  • Default hello timer (nge-cek router sebelah masi idup ga) adalah 3 detik, dan hold time (nunggu si active jadi standby /standby jadi active) adalah 10 detik, bisa kita rubah timer nya

  • Authentikasi juga bisa kita rubah, mo plain text ato md5
  • Delay untuk preempt default minimum 1 detik dan untuk reload 1 detik, bisa kita rubah juga nih

  • Active Router is Local maksudnya adalah si R2 sendiri yang Active
  • Standby Router HARUSNYA si R3 (Cuma R3 nya uda gw acak2 pake VRRP)

================================================================

Move on ke VRRP (Virtual Redudancy Routing Protocol)

Yang beda Cuma di sini (kita reset dulu konfig di fa0/0 R3, bosen R2 mulu)

Bedanya dimana ?!? di keyword “vrrp” nya doang…dan klo lo notice…virtual IP nya ip fisik si R3 sendiri

Karena VRRP memang men-support untuk pake physical IP, dan klo lo set priority di router yang jadi Master (klo di HSRP namanya Active) dan IP fisik nya disitu juga, prioritynya jadi ga ngefek

Untuk nge-cek status nya…pake show vrrp brief

Own = Owner (IP VRRP nya punya si R3 Fa0/0 sendiri bukan ??)

Pre = Preempt, VRRP defaultnya on

===================================================

Now to GLBP (Gateway Load Balancing Protocol)

Keywordnya…klo hsrp itu “standby“, vrrp ya “vrrp“, glbp….ya “glbp 1 ip X.X.X.X

Noh liat…klo GLBP, mau R3 mau R2 sama2 Active (load balancing), Cuma siapa yang jadi AVG nya ? (Active Virtual Gateway – main route), sisanya jadi AVF (Active Virtual Forwarder)

Yang “bener2” active ya si R3

Untuk nentuin glbp load-balancingnya pake metode apa…

Bahkan kita bisa batesin untuk maksimum packet threshold nya yang bisa di terima berapa buah (berguna juga untuk pemilihan load-balancing)

Dari 100 packet, jika paket kurang atau lebih dari 90~99, maka status ini router bukan active lagi (if I’m not wrong…based on blog.ine.com for glbp, all routers that weighted value are below configured one is revert to Listen State)

Yaks…kira2 gitulah….

Nanti klo kurang ato ada yang salah pasti gw update…

Older Entries Newer Entries