Advertisements
Home

BGP Configuration (Part 2)

2 Comments

Today…we learn about how to change path the packets travel in BGP environment, in IGP such as OSPF…we can modify the metric or even Administrative Distance (AD)

In BGP we call them Path Attributes…

Some say…Path Attributes in BGP is like Metric in IGP Analogy, Some say…Path Attribute is different at all

All we know is…He’s Called THE STIG !!!

The design we throughout the article is like this

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

Initial Config

Hey…in R1 and R2 we use network command, but in R3 we use redistribute connected ?!?

I just want to show you that both command function do the same effect…advertise route

But the difference is..Network command do advertise route that we exactly want to advertise

But in redistribute connected, ALL OF CONNECTED ROUTE will be advertised

So which is better ?! of course network command, redistribute make router do processing alot more

Remember, redistribute command is used when we want to “join” different routing protocols right ?!?

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

BGP Route Change with Path Attibute called “WEIGHT”

See the BGP Theory (warning: in Indonesian Language/Bahasa) for the list of BGP Path Attributes

When we see the picture above, AS 1 want to sent packet to AS 3…It send directly to AS 3 (13.13.13.3 – R3)

But lets change it, we want to sent packet to AS 2 first, and then to AS 3

Explanation:

  • We using route-map for setting weight value
  • Default Weight value is ZERO(0)..just check in show ip bgp, and the weight value is defined on Cisco Router only
  • ALWAYS USE route-map in for weight (because we want to “weighten” the inbound interface which is affecting the outbound connection)
  • And then clear ip bgp peering first to see the effect

Lets trace it

Done…the packet sent to R2 (12.12.12.2) first, and then to AS 3

Note: why do we have to input trace [ip] source [ip] ?!?

Because if we just trace without defining which interface ip we use, default interface to send is physical one first

Lets see…

Now lets check in R3…is there any route to 12.12.12.2 ?!?

Thats why we can’t ping/trace without mentioning the source ip, because when we configure BGP, we not advertising 12.12.12.0 (using network command) to BGP right ?!?

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

BGP Route Change with Path Attibute called “MED”, ” Local Pref”, and AS PATH”

It is the same like weight configuration, just differ in route-map

MED

Local Preference

Explanation:

  • In MED (Multi Exit Discriminator), the lowest one is preferred
  • In Weight and Local Pref, the Heaviest value is preferred

Choosing best route via AS Path

Explanation:

  • AS 1 send packet to AS 3 directly, from AS 1-to-AS 3 (1 -> 3), how do we change it to send via AS 1-to-AS 2-to-AS 3 (1 -> 2 -> 3) ?!?
  • Prepend it !!! (make it longer)…the longer the path, the most unreliable to send packet
  • Lets see the example:

  • from the value ?!? just look at the next hop AS path…after AS 1…to AS 3….isn’t it obvious it will choose the second path ?!?
  • So thats why I’m typing prepend 3 3 3 3 3 (just to make that route longer to read literally, BGP doest read the VALUE of number for AS_PATH selection eventhough the next-hop AS Path is number 3)

Lets check it…

See…the best path to 3.3.3.3 now to R2 then to R3

But we see the 13.13.13.0 and 23.23.23.0 in the show ip bgp 3.3.3.3 also get the same effect, isn’t it dangerous ?!? yes..

Thats why we use another route-map for filtering which AS_PATH get the prepend

now only route 3.3.3.3 that get the prepend effect

Note for BGP MED and Local Pref:

When Local ISP choose the best path/route to another ISP, they use Local Pref

But when Another ISP want to send packet to Local ISP, local ISP can use MED to select which door/route that Allowed for Another ISP

You can say “traffic from Indonesia goes to Singapore first before entering China” (Local Pref, configured in Indonesia)

but traffic from China to Indonesia only accepted if travel to Malaysia first before entering Indonesia” (MED, configured in Indonesia)

we can force to use MED by typing bgp always-compare-med and bgp deterministic-med in router bgp [as] sub-config

Choosing best route via Origin

when the next hop AS Path is same from all direction to destination, BGP choose Origin attribute

Origin means “where this AS Path originally came from

take a look at this pic

ORIGIN X

just look at the origin status code…BGP prefer path from  i-BGP > e-BGP > incomplete

take a look at the new design I draw here…

ORIGIN MAP

R1 want to send packet to 4.4.4.4 in R4

here is the initial configuration (just change the respectives IP in R2, R3, R4)

ORIGIN SHOW IP BGP

from show ip bgp, we know that if R1 want to send packet to 4.4.4.4, He had two options…using AS 2 Route…,or using AS 3 route

which way does R1 take ?!?

now we trace it…

ORIGIN TRACE 1

why R1 choose AS 2 ?!? because of BGP behavior that cannot perform load balancing, the first one that enter R1 routing table…that is the primary route (I’m configuring AS 2 right after AS 1 configuration is done, thats why R1 choose AS 2)

now lets change the BGP Attribute called ORIGIN, lets change AS 2 route become “incomplete” (incomplete means this route came from something others than BGP, such as Redistribution)

ORIGIN CONFIG

Explanation:

  • because AS 2 came from 12.12.12.2 (R2), I use route-map in this neighbor
  • and to forbid anoher network get the “incomplete” status, i’m filtering them using ACL

let see the effect

ORIGIN AFTER CONFIG

done…now R1 route to 4.4.4.4 si via AS 3

remember the rules… i-bgp > e-bgp >incomplete (?)

let see if I change AS 2 path to e-bgp origin

ORIGIN AFTER 2

it still chooes AS 3 over AS 2

BGP Route Selection Process in brief:

1. Weight (Cisco Only)

2. Local Preference

3. AS-Path

4. Origin

5. MED (if all of the above requirement is same value)

next…advanced BGP (Insya Allah)

Advertisements

DHCP Configuration

Leave a comment

Gw lupa….dari awal gw bikin ini blog ga pernah bahas DHCP Config detail…(yang lama ada sih)

wokeh, kali ini kita bahas *buka buku catetan gw dulu*

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

DHCP (Dynamic Host Control Protocol) adalah suatu metode/protocol untuk memberikan IP ke device2 yang terhubung kejaringan

Klo kita setel 1-1 IP ke 100 komputer…ya mabok juga

This is the desain we use throughout the article (sebenernya bisa pake packet tracer, Cuma ada beberapa fitur yang ga bisa dijalanin disana)

Setting PC supaya dapet DHCP

Klo GNS3…kita mesti set dulu di PC nya

Kita verifikasi dengan show interface brief

Look at the Method…it says…DHCP

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

Configuring DHCP on Cisco Router

Penjelasan:

  • Ip dhcp pool LAN_1, create pool dhcp yang bernama LAN_1 (nama bebas), jadi device2 yang minta IP ngambilnya dari “kolam” ini
  • Network 10.10.10.0 255.255.255.0, ip yang dikasi dari pool ini range-nya dari 10.10.10.0 sampai 10.10.10.255
  • Default-router 10.10.10.1, ini adalah default-gateway yang dikasi oleh dhcp pool nya
  • Dns-server 10.10.10.10 10.10.10.20, untuk ngasi IP DNS Server ke device2nya…bisa lebih dari 1 DNS Server (10.10 dan 10.20)
  • Option 150 ip 10.10.10.100, ini fitur yang dipake untuk Cisco IP Phone guna mendapatkan IP CallManager (bisa diatur/auto-assign dari dhcp pool juga)
  • Ip dhcp excluded-address 10.10.10.0 10.10.10.20, ini maksudnya JANGAN memberikan ip dari range 10.10 sampe 10.20 ke device2 yang ada
  • Ip dhcp excluded-address 10.10.10.100, untuk memcegah router memberikan IP spesifik/tertentu kepada router (which is router ga akan ngasi 10.100 ke end devices)

Catatan:

  • DHCP bisa kita create di non-router (contohnya di Windows Server, biasanya untuk menghemat kinerja router…jgn salah…router ngasi DHCP juga termasuk KERJA loh…)
  • Kita bisa men-create lebih dari satu pool DHCP dalam satu router(contohnya untuk sub-interface, int fa0/0.10 dapet ip X.X.X.X dan int fa0/0.20 dapet ip Y.Y.Y.Y)
  • Default-gateway BIASANYA adalah interface si router itu sendiri yang mengarah ke LAN (so pastikan default-router [ip] nya adalah ip router)
  • Dns server kita bisa set lebih dari satu (maksimum kaga tau gw…bisa banyak kok…waktu itu gw set ampe 5 dns server, itu masih bisa nambah)
  • Excluded address bisa kita set berdasarkan range (dari ip 10.0 sampe 10.20 ga bole dikasi ke end devices)
  • Ato kita bisa kasih secara spesifik seperti 10.10.10.100, tapi ya manual…ketik satu2 ip yang ga boleh apa aja (10.20 ga bole, 10.150 ga bole, 10.200 ga bole, dst.)

Let’s see the effect

See…dikasi ip 10.10.10.21, karena dari 0 sampe 20 ga bole dikasi (Cuma kekurangannya adalah default gatewaynya di GNS3 kita harus input manual…klo di PC asli jalan kok)

Verifikasinya bisa kita tampilkan dengan cara show ip dhcp binding

Nah…disitu dijelaskan…mac address aaaa.bbbb.cccc dapet ip X.X.X.X

Lease expiration = ini IP dicabut lagi dari peredaran, dikasi ke alat lain yang membutuhkan. Klo emang ga ada yang request IP, bisa aja dikasi lagi ke end device yang sama

Default expiration time nya adalah 12 jam, bisa dirubah ga ?!? bisa…tambahin aja di (dhcp-config) nya command ini

Artinya…IP ini akan dilepas setelah 2 hari 5 jam…ato mo selamanya ?!? ketik aja lease infinite

Trus bisa ga kita pengen end device dengan mac-address spesifik, selalu dapet IP yang sama ?!? bisa…tenang aja, apa sih yang engga buat lo…hahaha

Contoh mac-address aaaa.bbbb.cccc selalu dapet ip 10.10.10.150

Whoops…ga bisa di pool ini, kita create pool baru de…memang butuh dhcp pool khusus

Jadi…device dengan mac-address aaaa.bbbb.cccc tetep di network 10.10.10.0 kan ?! yoi

Nah…DHCP yang kita bahas tadi kan masih satu LAN dengan PC-PC yang ada…gimana klo beda LAN ?

Gimana klo DHCP_2 yang ngasi IP ?? (see design above)

Cara nya adalah dengan bantuan ip helper-address

Dengan bantuan command ip helper-address, tiap broadcast yang dikirim oleh end devices yang minta ip akan di redirect ke 12.12.12.2 which is interface DHCP_2 yang mengarah ke DHCP_1

Maksudnya tiap broadcast apa?!? remember…itu client default ip nya kan autoconfiguration (ipnya 169.X.X.X) betul ga !?

Mereka minta ip ke server gimana caranya !??! emang tau dia IP server ?!? orang dia-nya aja ga punya IP (at least beda network ama DHCP Server-nya)

Makanya mereka “teriak” dengan ip 255.255.255.255 alias pake ip broadcast, nahhh…defaultnya…broadcast itu ga dikirim keluar dari router

Dengan bantuin ip helper-address…broadcast itu “dibantuin” untuk keluar dari jaringan LAN

Apa aja sih broadcast yang bisa dibantuin selain broadcast minta DHCP ?!?

.

.

.

…gw lupa nyatet yang itu…pernah dijelasin sih….hahaha

en by the way…selain di router, di Multilayer Switch alias Switch layer 3 yang ada fitur routing nya juga bisa kita config DHCP

now…how we configure static DHCP assign kek dibawah ini

static DHCP

di R1

R1-DHCP(config)#ip dhcp pool FOR-PC
R1-DHCP(dhcp-config)#host 192.168.1.100 255.255.255.0
R1-DHCP(dhcp-config)#client-identifier 01cc.0253.1c00.00

mac address R2-PC adalah cc02.531c.0000

kode ethernet adalah 01…so 01+cc02.531c.0000 = 01cc.0253.1c00.00 (geser titik-nya aja…)

di R2

R2-PC(config)#int fa0/0
R2-PC(config-if)#ip address dhcp client-id FastEthernet0/0

R2-PC(config-if)#
*Mar 1 00:12:45.871: %DHCP-6-ADDRESS_ASSIGN: Interface FastEthernet0/0 assigned DHCP address 192.168.1.100, mask 255.255.255.0, hostname R2-PC

Older Entries