Home > BGP Route map and MED – GNS3 Lab

BGP Route map and MED – GNS3 Lab

March 21st, 2012 in Basic Labs Go to comments

In this lab we will learn how to use Route map to set MED attribute to tell which path the neighbor should choose to a specific network.

Topology:

BGP_Route_map_MED_topology.jpg

IOS used in this lab: c3640-jk9s-mz.124-16.bin

Tasks in this lab:

1) Set up basic IBGP & EBGP
2) Advertise loopback 1 & loopback 10 on R1
3) Use route-maps on R2 & R3 to set MED for only 192.168.1.0, verify on R6 and will R6 see network 192.168.10.0?

Basic Configuration – IP Assignments

R1:
interface f0/0
ip address 12.12.12.1 255.255.255.0
no shut
interface f1/0
ip address 13.13.13.1 255.255.255.0
no shut
interface loopback0
ip address 1.1.1.1 255.255.255.255
interface loopback1
ip address 192.168.1.1 255.255.255.0
interface loopback10
ip address 192.168.10.1 255.255.255.0
R4:
interface f1/0
ip address 46.46.46.4 255.255.255.0
no shut
interface s0/0
ip address 24.24.24.4 255.255.255.0
no shut
R2:
interface f0/0
ip address 12.12.12.2 255.255.255.0
no shut
interface s1/0
ip address 24.24.24.2 255.255.255.0
no shut
interface loopback0
ip address 2.2.2.2 255.255.255.255
interface loopback1
ip address 192.168.2.1 255.255.255.0
R5:
interface f1/0
ip address 56.56.56.5 255.255.255.0
no shut
interface s0/0
ip address 35.35.35.5 255.255.255.0
no shut
R3:
interface f0/0
ip address 13.13.13.3 255.255.255.0
no shut
interface s1/0
ip address 35.35.35.3 255.255.255.0
no shut
interface loopback0
ip address 3.3.3.3 255.255.255.255
interface loopback1
ip address 192.168.3.1 255.255.255.0
R6:
interface f0/0
ip address 46.46.46.6 255.255.255.0
no shut
interface f1/0
ip address 56.56.56.6 255.255.255.0
no shut

1) Set up IBGP & EBGP connections

R1:
router bgp 123
neighbor 2.2.2.2 remote-as 123
neighbor 2.2.2.2 update-source loopback0
neighbor 3.3.3.3 remote-as 123
neighbor 3.3.3.3 update-source loopback0
exit
ip route 2.2.2.2 255.255.255.255 12.12.12.2
ip route 3.3.3.3 255.255.255.255 13.13.13.3
—————————————————-
Note: R1 establishes BGP neighbor relationships
with R2 & R3 via their loopback interfaces but R1
does not know how to reach there (and neighbor
relationship can not be established) so the most
simple way is to use a static route.
R4:
router bgp 456
neighbor 24.24.24.2 remote-as 123
neighbor 46.46.46.6 remote-as 456
neighbor 46.46.46.6 next-hop-self
neighbor 56.56.56.5 remote-as 456
——————————————
Note: the “next-hop-self” feature is used
so that networks learned from R2 will be
advertised to R6 with R5’s next-hop IP address. If not
the networks learned from R2 would be marked
as “inaccessible” on R6 (because R4 would advertise with
R2’s IP address but R6 can not reach the next-hop 24.24.24.2)
R2:
router bgp 123
neighbor 1.1.1.1 remote-as 123
neighbor 1.1.1.1 update-source loopback0
neighbor 3.3.3.3 remote-as 123
neighbor 3.3.3.3 update-source loopback0
neighbor 24.24.24.4 remote-as 456
exit
ip route 1.1.1.1 255.255.255.255 12.12.12.1
ip route 3.3.3.3 255.255.255.255 12.12.12.1
R5:
router bgp 456
neighbor 46.46.46.4 remote-as 456
neighbor 56.56.56.6 remote-as 456
neighbor 56.56.56.6 next-hop-self
neighbor 35.35.35.3 remote-as 123
R3:
router bgp 123
neighbor 1.1.1.1 remote-as 123
neighbor 1.1.1.1 update-source loopback0
neighbor 2.2.2.2 remote-as 123
neighbor 2.2.2.2 update-source loopback0
neighbor 35.35.35.5 remote-as 456
exit
ip route 2.2.2.2 255.255.255.255 13.13.13.1
ip route 1.1.1.1 255.255.255.255 13.13.13.1
R6:
router bgp 456
neighbor 46.46.46.4 remote-as 456
neighbor 56.56.56.5 remote-as 456

Note: The use of a loopback interface to define neighbors is common with iBGP, but is not common with eBGP. Normally, you use the loopback interface to make sure that the IP address of the neighbor stays up and is independent of hardware that functions properly. In the case of eBGP, peer routers frequently have direct connection, and loopback does not apply.

2) Advertise networks 192.168.1.0 & 192.168.10.0 on R1:

On R1 we advertise two networks 192.168.1.0/24 & 192.168.10.0/24:

R1:
router bgp 123
network 192.168.1.0 mask 255.255.255.0
network 192.168.10.0 mask 255.255.255.0
————————————————————————
In fact we don’t need the “mask 255.255.255.0” because it is the default mask value for class C IP address.

Now check on both R2 & R3 to see both networks are advertised

BGP_Route_map_MED_R2_init_show_ip_bgp.jpg

BGP_Route_map_MED_R3_init_show_ip_bgp.jpg

Also on EBGP neighbors, these networks are also advertised (you have to wait a moment for BGP updates)

BGP_Route_map_MED_R4_init_show_ip_bgp.jpg

BGP_Route_map_MED_R5_init_show_ip_bgp.jpg

On R6 networks 192.168.1.0 & 192.168.10.0 are learned via both R4 & R5:

BGP_Route_map_MED_R6_init_show_ip_bgp.jpg

Note: the path via R4 (46.46.46.4) are chosen for both networks as the best path because of lower router-ID on R4)

3) Use route-maps on R2 & R3 to set MED for 192.168.1.0 to 150 & 170, respectively:

R2:
router bgp 123
neighbor 24.24.24.4 route-map MED_to_456 out
exit
access-list 1 permit 192.168.1.0 0.0.0.255
route-map MED_to_456 permit 10
match ip address 1
set metric 170
R3:
router bgp 123
neighbor 35.35.35.5 route-map MED_to_456 out
exit
access-list 1 permit 192.168.1.0 0.0.0.255
route-map MED_to_456 permit 10
match ip address 1
set metric 150

Now R6 only receives updates about 192.168.1.0. The metric advertised by R3 is lower so it is chosen as the best path to 192.168.1.0 (marked with “>”).

BGP_Route_map_MED_R6_show_ip_bgp.jpg

Notice that updates for 192.168.10.0 have been filtered out because there is an implicit “deny all” statement at the end of each access-list.

Comments
  1. Amgad
    February 19th, 2017

    Hi Guys i can not find the gns3 labs to download
    any one can help ??

  2. ted
    April 25th, 2017

    hi all
    can anyone tell latest dumps in ccna,where we can find ?? plz tell ??????
    now ccna syallubus changed it is easy or tuf to write?
    how much fee they are charging forccna?
    what are the labs if we attend means ?then we can pass the first attempts????
    i need to pass the exam in the first attempt how ?
    if we donot write ccna exam means what happened ?
    plz give above all questions answers?????
    i am waiting for above all questions answers ,plz give answers above all questions
    plz .plz ,plz ……………………………………………………………………………………. give me information ,and i have a lot of doubts

  3. dani
    August 14th, 2017

    Having read this I thought it was really informative. I appreciate you spending some time and energy to put this short article together. I once again find myself personally spending a significant amount of time both reading and posting comments. But so what, it was still worth it!

    wretye5ryabcd.com

  4. dani
    August 14th, 2017

    I believe you have made some really fascinating points. Not too many others would actually think about this the direction you just did. I am really impressed that there is so much about this subject that has been revealed and you made it so nicely, with so considerably class. Outstanding one, man! Very wonderful things right here.

    wretye5ryabcd.com

  5. Fahad
    July 23rd, 2018

    Hello Hi can any one send me the latest dumps off CCNP router 300-100
    Send me on this email address {email not allowed}

  6. NjivaRaz
    September 27th, 2019

    thx

  1. No trackbacks yet.