Ugrás a fő tartalomra

CCIE SP v5.x Lerning journey #xxxxx2 Understanding and practice BGP and IGP basics

 Hey yo man! Whats UP? Lets talk about IGPs and BGPs (EGPs)!

bgp Memes & GIFs - Imgflip

How my CCIE process is going? I passed (again) the cisco 350-501 SPCORE exam which is the actual written exam for CCIE certification. Last time it was easier than now, maybe I have no MPLS based project at this time. In the other hand I passed the 350-901 which is the DEVCORE exam, now I have 3 NP certification: DevNet, SP, Enterprise. I care about devnet because there is evolving technology part on the lab exam, so it was the part of my preparation.


Actually I prepare myself to the LAB! Rock Yeah!

How Memes Became Weapons in the Culture Wars | WIRED

Understanding BGP is basically an really old topic in Service Provider era. What is BGP? What does it mean that BGP an EGP?  What is IGP? Good stuffs from question to question. Lets start with the first one.

What is BGP?

BGP is an EGP. WHat? Border Gateway Protocol is az Exterior Gateway Protocol which is responsible for the ISP or Telco routing strategy in an Autonomus System... Pfffff Its not easy when you do not understand what is EGP and AS (Autonomus System). Exterior Gateway Protocols like BGP and EIGRP work with special network identity which is AS number. AS number was a 16 bit  length in the old times, now-times there is old fashion AS numbers (16 bit) and the new style (32 bit) AS numbers can be public and private, just like IP addresses. If you'd like to be an ISP you have to assign public AS number from you local RIR (in a case of  Hungary that is RIPE). The technical difference between the old a and new numbering format that is which BGP protocol version and which software implementation you use in your environment.  In the old times,  BGP implementation an ancient IOS (monolithic) can not support automatically the 32 bit ASN. At now time if you'd like to request an AS your RIR you probably will get a 32 bit number (just like in skyblocks).

EGP routers whose use the same ASNs are inter-AS routers in a case of BGP they use iBGP connection. EGP routers whose use the diffrent ASNs are external-AS routers, in a case of BGP they use eBGP connection.

What are the main differences  between the BGPs?

eBGP is used to interconnect routers via BGP whose has different AS numbers. Typically the ISPs should use eBGP to make a public (or private) interconnect between each other.   eBGP routes are basically better that iBGP because the eBGP administrative distance in case of cisco is 20 (other vendor can use their own administrative numbering scheme). eBGP  IP TTL field is 1, which means in the default case of eBGP the directly connected IPs can establish BGP connection. iBGP TTL field is default 255. iBGP has split horizon mechanizm what is responsible for the loop prevention. In the default iBGP in case of chained network the first BGP router can not advertise its own prefix just for the next iBGP router. The 2nd iBGP router do not advertise the route if it heard from a iBGP neighbor.
eBGP router is prepend its own AS number to the ASpath attribute. In a case iBGP the AS number not prepend to the ASpath attribute. Ok lets talk about what is the ASpath or attribute?
BGP has attributes which are help to decide which prefix has better than other. This topic is called BGP best-path selection procedure.

BGP Best Path Selection

This part of topic is even documented better than this blog can so here is an useful link which is help to understand BGP BPS algorithm :

https://www.cisco.com/c/en/us/support/docs/ip/border-gateway-protocol-bgp/13753-25.html

https://datatracker.ietf.org/doc/html/rfc4271

What is IGP?

Interior Gateway Protocols can be used for make the infrastructure routing between iBGP peers, because the iBGP has many limitation of scalability, like split horizon problem. The second popular cause of IGP is that the convergence time. IGP protocols can be converged state faster the BGP protocol. BGP protocol is a TCP based protocol with slow timers,  however IGPs  usually use multicast or L2 CLNS protocols to communicate the routers each other, which mean that can be faster than BGP. The other explanation can be that the routing protocol type, routing protocols can be various based on the routing algorithm and the attributes:

hybrid distance-vector: EIGRP

path-vector: BGP

link-state: OSPF, ISIS

These concepts are very basics, if you do know about them, you have to google it.

The most popular IGPs in the Service Provider Environment are the OSPF and ISIS. I heard about EIGRP use as IGP, but it has a lot of limitation which cause that the two other protocol is better to used.
Both OSPF and IS-IS has LSA or TLV which support MPLS based solutions and these IGPs are ready to make MPLS TE with RSVP and SR too.

There will be more about it in the other post!

Lets make some interesting stuff with LAB.

 I think the best way to learn the basics of BGP to test the eBGP iBGP connection and the limitation of iBGP split horizon.

Lets look at the my LAB topology:

 In the topology the ASN2 and ASN3 routers are IOS-XE routers the all other one is IOS XR

Tasks:

1. Make sure that every Lo0 is available in the AS20, iBGP connection will be established between Lo0.

2. Make eBGP peer connection between AS20 and other ASs  with using loopback0-s IP address.

3. Make all Lo100 accessible in every AS.

 

For the 1. task you have to make the routing in AS20. Probably you are going to use a dynamic routing protocol which can be advertise the loopbacks and the interface connectivity IPs. In this I am going to use OSPF.

Lets make the configuration plan:

1. 

 To make sure that all Lo0 has reachable on the AS20 you have to make all AS20 routers OSPF adjacency.

IP address of the interfaces are pre-configured. 

Configuration template will be the following in the AS20 routers (IOS-XR):

 router ospf $process_id
 router-id $Lo0_IP_address <-should use the Lo0 but not necessarily.
 area 0!<- we are goint to use backbone area to flood all necessarily LSA in the area.
  interface Loopback0 !<- it is necessarily for advertise the Lo0 IP address, you can use passive-interface command to prevent the unnecessarily running OSPF of this interface  
  !
  interface GigabitEthernet0/0/0/x
  !
  interface GigabitEthernet0/0/0/y

# all router neighbor interface should run OSPF.
  !
 !
!

To verify OSPF on the router use the following commands:

show ospf neighbor

show route ospf

ping $Lo0_ipaddress

 

To establish BGP in IOS-XR you need to use the following configuration template

router bgp $ASN
 address-family ipv4 unicast
 !
 neighbor $neighbor1_Lo0_IP
  remote-as $ASN
  update-source Loopback0
  address-family ipv4 unicast
  !
 !
 neighbor $neighbor_Lo0_IP
  remote-as $ASN
  update-source Loopback0
  address-family ipv4 unicast
  !
 ! 

To verfify the BGP connection you should use the following commands:

show bgp su

show bgp

 

You will see that BGP table is empty on all router. Why is it empty? Because:

1. You do not used network statement in address-family ipv4 unicast part.

2. You do not received eBGP advertisement from EBGP peer.


Lets continue the exerices

eBGP connection with Lo0 is a tricky task, because you have to make sure the Lo0 IP address is accessible from the router and you have to care about the eBGP TTL 1.

The solution is going to be the following on IOS-XE routers:


router bgp $ASN
 bgp log-neighbor-changes
 neighbor $neighbor_IP remote-as  $neighbor_ASN
 neighbor
$neighbor_IP ebgp-multihop 2
 neighbor
$neighbor_IP update-source Loopback0
 !
 address-family ipv4
  network $Lo100_IP_address mask $Lo100_network_mask
  neighbor
$neighbor_IP activate
 exit-address-family
!

Beacause the Lo0 is accessible throught other connected interface you have to make route.

ip route $neighbor_IP 255.255.255.255 $neighbor_connected_IP

For the XR based routers you should be use the following template:

 !
!
router bgp $ASN
 address-family ipv4 unicast
 network $Lo100_IP_address $Lo0_network_mask
 !
 neighbor $neighbor_Lo0_IP_ress
  remote-as 
$neighbor_ASN
  ebgp-multihop 2  #EBGP TTL is going to be 2 (calculate it!)
  update-source Loopback0
  address-family ipv4 unicast
   route-policy PASS in
   route-policy PASS out

# In case of ios-XR a route-polic is mandatory be attached to eBGP connection which responsible for the prefix receiving and advertisement too.
  !
 !
!

Beacause the Lo0 is accessible through other connected interface you have to make route too. 

!
router static
 address-family ipv4 unicast
 
$Lo100_IP_address/mask $neighbor_connected_IP
 ! 

It is looks easy, but eBGP ASN can reach each other?

No, because of BGP split horizon loop prevention mechanism, and the other one is:
- there is no valid next-hop in the iBGP table for the Lo100 IPs.

To make accessible the Lo100 IP address to all BGP router you have to use the following command:

next-hop-self 

and 

route-reflector-client

The next-hop-self command is typically used by an eBGP router when advertising a route it learned from its eBGP neighbor to its iBGP peers. Why does it do this? Because if it does not, the next-hop IP will be the IP address of the eBGP peer, which is in another AS, thus its IP address is unknown within the local AS.

 The route reflector allows all IBGP speakers within your autonomous network to learn about the available routes without introducing loops.

Where have been these commands used? Lets see the topology

 To configure these statement you have to configure under the neighbor statement address-family ipv4 unicat section.

router bgp $ASN
 neighbor $neighbor_Lo0_IP_address
 address-family ipv4 unicast
  next-hop-self

router bgp $ASN
 neighbor $neighbor_Lo0_IP_address
 address-family ipv4 unicast
  route-reflector-client


In this case you sould the similar output in the eBGP routers:

 

 Lets close this post but I can write many things about BGP and  IGP, but I do not want waste your and my time so see yo in the next topic!

 

 

Érdekesebb bejegyzések

Hálózat-virtualizáció EPISODE II

 2019 BUÉK..., eltelt egy újabb év, és én már féléve nem jelentkeztem, ezért elnézést kérek minden kedves olvasótól, aki várta ezt a bejegyzést, de a hobbi, munka, család háromszögben nagyon nehéz, optimumot találni, úgy, hogy mind a háromra elegendő idő jusson. Ígérem a pozitív visszacsatolások, amit néhány olvasó adott a blogról, újabb lendületet adnak, és kicsit rendszeresebben fogok jelentkezni valamilyen írással. Előző bejegyzésemet úgy fejeztem be, hogy „Maradjatok velem és megmutatom milyen mély a nyúl ürege” nos, ez nem csak filmes utalás, ugyanis mind a tradicionális és virtuális hálózatok felépítése – hasonlóan a nyúl üregéhez a földben – különböző rétegeken megy keresztül. „Kicsit gondban vagyok, nem tudom, milyen messziről indítsam a téma kifejtését, ezért” vázlatosan összefoglalom a legalapvetőbb elveket és aztán meglátjuk. OSI modell OSI (Open System Interconnection) modellt ISO standardként született meg, hogy a különböző kommunikációs ...

FortiGate - SEC előfizetésen túl

Végre megvan az új NGFW a cégben, megvettétek 3 vagy 5 éves enterprise vagy utp bundle-ben és biztonságban érzitek magatok (Szárazabb, magabiztosabb érzés nem?), hiszen van IPS , webfilter, antivirus stb... security profile, ami megvédhet az ismert támadásokkal szemben. Nyugodtan "hátradőltök" és készítitek az auditokhoz szükséges riportokat a FortiAnalyzerből... biztonságban eltelik az 5 év és "váratlanul ér" előfizetés megújítása, nincs budget, pánikolva néztek valamilyen alternatív alsópolcos megoldást, amit még be tudtok szerezni és kidobnátok a jó hardvert, ami éveken keresztül stabilan szolgált titeket... Ne tegyétek! Mutatom milyen feature-ket használhattok tovább ingyen: Persze az alábbi megoldások nem minden végfelhasználónak jelentenek megoldást a problémákra és kihívásokra, de KKV szektorbnan vagy olyan esetekben, ahol nem szükséges IPS, anitvirus, webfilter, még jól használhatók tovább ezek a hardverek/szoftverek előfizetések nélkül. Fontos, ha egyébként...

CCIE #69065 - SRv6, most már tényleg átállunk IPv6-ra?

Röviden: NEM Hosszabban: Nem egészen, a teljes IPv6 átálláshoz nem elegendő csak a hálózat eszközök (több mint 10 éve meglévő) képességeit kihasználni, hanem ehhez a teljes informatikai iparágnak kellene paradigmaváltáson átmenni, ami azt jelenti, hogy a felhasználói (business és consumer) alkalmazásoknak minden kétséget kizáróan nagy rendelkezésre állással kellene támogatni a TCP/IPv6 stack-et (sok helyen tapasztaltam, hogy még a TCPv4-et sem sikerült minden kétséget kizáróan jól implementálni, de még operációs rendszerek szintjén sem). Viszont a szolgáltatók a publikus IPv4 kifogyást megelőzendő a szolgáltatói környezetet már migrálhatják IPv6-os hálózatra, ami megfordíthatja a korábbi, IPv6 over IPv4 (MPLS vPE6) vagy dual-stack (Internet) architektúrát  akár natív  IPv4 over IPv6 (SRv6) jellegű felállásra. A teljes képhez sok mindent tisztába kellene tenni, de élek az alkotói szabadsággal és úgy vagyok vele, hogy nem célom most itt mindenkit telekommunikációs mérnökké avanz...

Fortinet minősítési rendszer változások - avagy a FortiThanos lecsap

 A Fortinet bizonyos időszakonként megváltoztatja a vizsga rendszerét és minősítési rendszerét...  Amikor 2018-ban elkezdtem foglalkozni a Fortinet Network Security megoldásaival, akkor még "lázasan" NSE4 vizsgára készültem, ami FortiGate alapok mellett néhány advanced témát is érintett.  Ekkor már átesett a Fortinet egy vizsgarendszer átalakításon, és korábban FCNSP (Fortinet Certified Network Security Professional) minősítések lettek NSE4 minősítéssé. Még ebben az időszakban terveztem tovább lépni NSE7 szintre, ami akkor egy vizsgával megléphető volt aztán bummm! Jött a vizsgarendszer átalakítása és a korábban NSE1 - 8 minősítések új rendszerbe kerültek.. Az NSE1 - 3 -ből lett a az FCF ás FCA azaz Foundamental és Associate minősítések (ezek online elvégezhető tanfolyamok és nem proctored vizsgák) NSE4 + NSE5 vagy NSE6-ből lettek az az FCP minősítések (Professional) NSE7 vizsgákból illetve azok kombinációiból lettek az FCSS minősítések (Specialist)  NSE8 pedig FCX a...