Home

BGP Configuration (part 4)

4 Comments

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)

Explanation:

  • 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

Explanation:

  • 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 3.3.3.3 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…

Explanation:

  • To achieve route-reflector(mirror)…we need client/mirror to catch
  • So we set neighbor R3 (23.23.23.3) and R4 (24.24.24.4) 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 3.3.3.1 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 3.3.3.3..community value it still the same…use it well

Costumer:”no problem

ISP:”guys…there’s…

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

explanation:

  • 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

explanation:

  • 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 3.3.3.1
  • but for R2, use community value 100:250 to network 3.3.3.1
  • the aim is, if R2 want to send packet to 3.3.3.1, 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

explanation:

  • 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 3.3.3.1 and 3.3.3.2 route accordingly

let’s trace it…

community 8

see…R2 send packet to 3.3.3.1 is through R1 (12.12.12.1) first

but to 3.3.3.2…send directly

verification

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 Configuration (Part 3)

4 Comments

Part 1 and Part 2

Let’s learn about another BGP Features like:

  • Local-AS
  • Next-Hop-Self
  • Backdoor
  • Multihoming (Load-Sharing)
  • eBGP Multi-Hop

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

BGP Local-AS

Typically, this feature comes up when ISP A acquisitioning ISP B, but ISP C (or customers from ISP B) doesn’t want to change BGP Peering (change AS again, change neighbor, and so on)

Figure 1. initial network diagram

Figure 2. after acquisition form ISP A

Figure 3. initial BGP network from ISP C point of view

And then…ISP A bought ISP B, therefore all router in ISP B changed into AS 100 (ISP A)…but ISP C doesn’t want to change anything in their routers (too complicated they say…wkwkw)

So…let’s configure like this

Figure 4. local as configuration

ISP B Router says “I am AS 100 now, but…You (ISP C) can still recognize me as AS 200

Let’s see in ISP C

Figure 5. ISP C still recognize ISP B AS 200

See…no problem at all, ISP C still thinks that ISP B is AS 200 (even though ISP A Bought it and change that ISP B AS into AS 100)

If, somehow, somebody with directly above your position as engineer say…”remove those AS 200 from the AS-Path, we don’t need it anymore”

Use this at ISP B… neighbor [ip neighbor] local-as [AS] no-prepend

The result is…for example 2.2.1.0 is via AS 100 only

But if you want to change the AS Path from 100 to 200 only, just add “replace-as” beside no-prepend keyword

neighbor [ip neighbor] local-as [AS] no-prepend replace-as

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

BGP Next-Hop-Self

Figure 6. Example topology

One of the BGP rules is “the next hop is always the IP address of the neighbor specified in the neighbor command

R2 learns 1.1.1.1 via R1 through e-BGP, so next-hop to route to 1.1.1.1 in the R2 perspectives is through 12.12.12.1 (fa0/0 R1)

But when R2 advertise the 1.1.1.1 route to R3, R3 learns that next-hop to 1.1.1.1 is through 12.12.12.1 too (which is incorrect, it should be through 23.23.23.2 fa0/0 R2)

Figure 7. from R3

This is where BGP Next-Hop-Self is useful

We told R2 that he must advertise all route he learn, to neighbor 23.23.23.3 (which is R3) with next-hop directed to himself (R2)

Figure 8. change in R3

Another mention is when configuring BGP in multi-access network such as Ethernet

In topology above, R3 advertise 4.4.4.4 from R4 (let’s say acquired via OSPF) to R1

But, instead of advertising 134.134.134.3 (fa0/0 R3) next-hop to R2, R1 advertise next-hop to 4.4.4.4 is via 134.134.134.4 (fa0/0 R4)

Why ? because it make sense that R1,R3, and R4 is in the same network, same directly connected network, therefore R1 choose to most specific one to route

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

BGP Backdoor


The case is like this, both R1 and R2 run e-BGP to R3, but somehow R1 and R2 run IGP (like OSPF for example)

When R1 want to send packet to 2.2.2.2 (R2), he learn 2 paths

  • Via R2, which is OSPF, with AD 110
  • Via R3, which is BGP, with AD 20 (e-BGP)

The logic is…R1 sent packet via R3…but we don’t want to happen like this way

The solutions are 2 ways:

  • Edit Administrative Distance, which is not recommended
  • Run BGP Backdoor

The initial configuration are like this:

The result of those configurations is

R1 will sent packet to 2.2.2.2 via BGP not directly to R2 because AD difference

Now…lets configure the backdoor command

This means…for network 2.2.2.2..ignore the BGP AD, use the IGP AD

Result:

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

BGP Multihoming

Right now we discuss about Multihoming with different AS (configuring multihoming with same AS is not much difference because common e-BGP configuration)

And also Load-sharing it (BGP can’t perform load balancing but it can perform load sharing)

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

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

(thanks for correction, from Gangga Prima Yousya)

Configure all routers to e-BGP first…don’t forget to advertise 1.1.1.1 on R1 and 4.4.4.4 on R4

Example configuration on R1:

Maximum-path keyword is for load sharing

The result on R1 should be like this

Let’s ping and trace it…

Now we see…even though there are 2 path, R1 BGP only choose the first established one

How can we load-sharing it?!? Here’s the configuration example

Now it can perform Load Sharing

But here is the case I found, if the AS Path taken difference is too far between AS…the traffic load will cause some problem

Let’s see the example

Those configurations is just to simulate congestion that caused by longer AS Path the packet travels

The traffic share is still 1:1, this will cause problem with the packet that take longer path/bandwidth

So let’s configure dmzlink (for load sharing based on bandwidth)

Now the share is 1:10..1 traffic goes to R2 (bandwidth 10000) and 10 traffic goes to R3

Let’s take a look on Router CEF

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

eBGP Multihop

eBGP multihop typically used when, somehow, a Router can’t form eBGP peering by connecting directly

so how we configure then?…look at this topology below

ebgp multihop 1

ebgp multihop 2

why we perform static routing? because initially, eBGP peers must connect directly right?

so…they perform peering via directly connected route in their routing table

that cause us to perform static routing (or via IGP) to make the BGP packet can travel to the other peer…

ebgp multihop 3

just look at above configuration…i’m not even touching R2 (except for ip addressing though…)

the keyword is ebgp-multihop

default “hop” for BGP packet is 1…that means BGP packet TTL (time to live) is only travel to directly connected router only

but if we use multihopping, lets say 2…after 1 hop (to directly connected router), that BGP packet have life to travel “one more time”

therefore, BGP packet from R1 (or R3) can reach each other

if we use ebgp-multihop without mentioning the ttl value…default value is 255 (that BGP packet can hop 255 times)

lets verify…

ebgp multihop 4

Older Entries Newer Entries