BGP Attribute MED


Scenario:

The biggest ISP in the carribean needs your help with BGP. One of the junior BGP network engineers configured some new sites but has trouble influencing traffic patterns. Show him how to configure BGP MED and you’ll have the day off to enjoy the beach and some nice sunshine.

Goal:

  • All IP addresses have been preconfigured for you as specified in the topology picture.
  • Configure IBGP in AS 1.
  • Configure EBGP between AS1 and AS 2.
  • Advertise the 4.4.4.0 /24 network on router Jamaica.
  • Ensure AS 1 will use the link between Cuba and Jamaica for traffic towards network 4.4.4.0 /24. You are only allowed to use the MED (metric) BGP attribute for this.

It took me 1000s of hours reading books and doing labs, making mistakes over and over again until I mastered all the routing protocols for CCNP.

Would you like to be a master of routing too? In a short time without having to read 900 page books or google the answers to your questions and browsing through forums?

I collected all my knowledge and created a single ebook for you that has everything you need to know to become a master of routing.

You will learn all the secrets about BGP attributes and more.

Does this sound interesting to you? Take a look here and let me show you how to Master CCNP ROUTE

IOS:

c3640-jk9o3s-mz.124-16.bin

Topology:

BGP Attribute MED

Video Solution:

Configuration Files

You need to register to download the GNS3 topology file. (Registration is free!)

Once you are logged in you will find the configuration files right here.

Opt In Image
Do you want your CCNA or CCNP Certificate?

The How to Master series helps you to understand complex topics like spanning-tree, VLANs, trunks, OSPF, EIGRP, BGP and more.

Written by RenΓ© Molenaar - CCIE #41726

You May Also Like

About the Author: Rene Molenaar

RenΓ© - CCIE #41726 is the creator of GNS3Vault.com where he shares CCNA, CCNP and CCIE R&S labs. He also blogs about networking on http://networklessons.com

16 Comments

  1. [quote]Suriname should also use the route via Cuba right, so the next-hop-self (for neighbor Suriname) is required on both Cuba and Haiti right ?[/quote]

    That’s correct. In this lab however Suriname doesn’t use Haiti anymore but when it does you need to make sure the next hop is resolvable.

    [quote]But what about the neighbor relationship between Cuba and Haiti – should they be configured as next-hop-self aswell (if not – their routes to AS2 will be invalid without an IGP underneath) ? [/quote]

    Good question. The same thing applies here…router Cuba will have to know about the link between Haiti and Jamaica. Router Haiti will have to know about the link between Cuba and Jamaica.

    You can either advertise those links in a routing protocol or you can use the BGP next-hop-self command. If you use next-hop-self Haiti and Cuba will advertise themselves as the next-hop and not router Jamaica.

    [quote]If I configure Haiti and Cuba as next-hop-self (IE they both announce themselves as the next-hop to each other) – Router Suriname will only get ONE bgp path/route to 4.4.4.0/24 – the one through Cuba (why is that ?!)[/quote]

    That’s strange…even when you reset the BGP neighbors? Check if router Haiti and Cuba both have learned network 4.4.4.0/24 through EBGP and that they have a working IBGP adjacency with router Suriname. They should advertise this network through IBGP.

  2. I simply cannot understand this behavior.

    This is debugs from Suriname:

    [quote]Suriname#
    *Mar 1 00:01:05.555: BGP(0): 192.168.12.2 rcvd UPDATE w/ attr: nexthop 192.168.12.2, origin i, localpref 100, metric 200, path 2
    *Mar 1 00:01:05.559: BGP(0): 192.168.12.2 rcvd 4.4.4.0/24
    *Mar 1 00:01:11.715: BGP(0): Revise route installing 1 of 1 routes for 4.4.4.0/24 -> 192.168.12.2(main) to main IP table
    *Mar 1 00:01:11.735: BGP(0): 192.168.13.3 rcvd UPDATE w/ attr: nexthop 192.168.13.3, origin i, localpref 100, metric 100, path 2
    *Mar 1 00:01:11.735: BGP(0): 192.168.13.3 rcvd 4.4.4.0/24
    *Mar 1 00:01:11.735: BGP(0): Revise route installing 1 of 1 routes for 4.4.4.0/24 -> 192.168.13.3(main) to main IP table
    *Mar 1 00:01:11.735: BGP(0): updgrp 1 – 192.168.12.2 updates replicated for neighbors: 192.168.13.3
    *Mar 1 00:01:11.735: BGP(0): updgrp 1 – 192.168.12.2 updates replicated for neighbors: 192.168.13.3
    *Mar 1 00:01:11.747: BGP(0): [b]192.168.12.2 rcv UPDATE about 4.4.4.0/24 — withdrawn[/b][/quote]

    Why on earth is the route to 4.4.4.0/24 via 192.168.12.2 (metric 200) ‘withdrawn’ ? – it makes perfectly sense that it’s not present in the routning table – but why is it not present in the BGP table ?!? :'(

    [quote]
    Suriname
    Network Next Hop Metric LocPrf Weight Path
    *> 1.1.1.0/24 0.0.0.0 0 32768 i
    *>i4.4.4.0/24 192.168.13.3 100 100 0 2 i

    Cuba
    Network Next Hop Metric LocPrf Weight Path
    *>i1.1.1.0/24 192.168.13.1 0 100 0 i
    *> 4.4.4.0/24 192.168.34.4 100 0 2 i

    Haiti
    Network Next Hop Metric LocPrf Weight Path
    *>i1.1.1.0/24 192.168.12.1 0 100 0 i
    *>i4.4.4.0/24 192.168.23.3 100 100 0 2 i
    * 192.168.24.4 200 0 2 i
    [/quote]

  3. Question πŸ™‚ And this admittedly goes beyond lab – Suriname should also use the route via Cuba right, so the next-hop-self (for neighbour Suriname) is required on both Cuba and Haiti right ?

    But what about the neighbor relationship between Cuba and Haiti – should they be configured as next-hop-self aswell (if not – their routes to AS2 will be invalid without an IGP underneath) ?

    If I configure Haiti and Cuba as next-hop-self (IE they both announce themselves as the next-hop to each other) – Router Suriname will only get ONE bgp path/route to 4.4.4.0/24 – the one through Cuba (why is that ?!)

  4. I just loaded my final configuration and set “next-hop-self” for Cuba and Haiti. This is what happens:

    Router Haiti can get to network 4.4.4.0 through Cuba or Jamaica. You can see this in the BGP table. It installs the route through Cuba because of the MED.

    Router Cuba uses the direct link to get to network 4.4.4.0 through Jamaica.

    BGP will only [b]advertise the best path[/b]. Router Haiti only advertises network 4.4.4.0 with next hop 3.3.3.3. So does router Cuba.

    Router Suriname will end up with a single entry for network 4.4.4.0 / 24 in its routing table.

    1. Rene,

      Another point to this question is that initially

      Haiti will rec’d 2 routes (Jamaica (ebgp) and Cuba (ibgp))
      Cuba will rec’d 2 routes (Jamaica (ebgp) and Haiti (ibgp))

      The reason why Suirname will only have one route via Cuba is because Haiti would no longer be advertising his route for 4.4.4.0/24 thus it is wihdrawed even though he still gets it from Jamaica (remember you cannot control what eBGP tell you) because Cuba is telling him he has a better path. So if you check your BGP table Haiti will also be point to Cuba as his best path.

      Because of all this and split horizon rule, Suriname is left with only one choice and that is to accept routes advertised by Cuba-remember in split horizon, Haiti wouldn’t send to Suriname because his best path is via Cuba (iBGP)

  5. Hi Rene,

    Unsure if it was intentional or not (as a bit of extra troubleshooting), but interface FastEthernet2/0 on Cuba is shutdown in the initial config.

    Took me a while to figure our why I couldn’t get a neightbor relationship πŸ™‚

    Cheers
    PS: Great Labs by the way, helping me a lot

    1. Hi Cullen,

      If there’s a shutdown command, it was by accident πŸ˜€

      Thanks for your comment!

      Rene

  6. What is needed for Suriname to successfully ping 4.4.4.4
    I configured AS1 with EIGRP and used the loopbacks for neighbor statements under bgp
    on Routers Haiti and Cuba I use the network command under BGP 1 for network 192.168.24.0 and 192.168.34.0 and on router Jamaica under BGP I used network statements on 192.168.24.0 and 192.168.34.0

    Is a default route required and if so what router should it be placed on ?

    1. No default route should be required. Did you forget a network statement somewhere? What does Suriname routing table say?

  7. I still do not like the idea of redistribuiting OSPF into BGP. I would rather source the ping simulating a 1.1.1.1 source network.

  8. Hello Rene, Guys

    I have a little problem. Although I finished this LAB and all routers in AS1 are using 192.168.34.4 as next hop to reach 4.4.4.0 network, I can see metric only on router Haiti not on all routers in AS1.

    Haiti#sh ip bgp
    Network Next Hop Metric LocPrf Weight Path
    *>i4.4.4.0/24 192.168.34.4 0 100 0 2 i
    * 192.168.24.4 100 0 2 i

    Suriname#sh ip bgp
    *>i4.4.4.0/24 192.168.34.4 0 100 0 2 i

    Cuba#sh ip bgp
    *> 4.4.4.0/24 192.168.34.4 0 0 2 i

    Do you know what is going on here? Thank you in advance.
    P.S. As always a great LAB πŸ™‚

    1. is there an eBGP session established between router Haiti and Jamaica?

      i ask because it looks like only Cuba has an established eBGP session with Jamaica based on the “sh ip bgp” output.

      my lab output:

      Haiti#sh ip bgp | i 4.4|Net
      Network Next Hop Metric LocPrf Weight Path
      *>i 4.4.4.0/24 192.168.34.4 0 100 0 2 i
      * 192.168.24.4 44444 0 2 i

      Haiti#sh ip bgp summ | b Nei
      Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
      1.1.1.1 4 1 129 131 12 0 0 01:53:21 1
      3.3.3.3 4 1 27 33 12 0 0 00:21:18 2
      192.168.24.4 4 2 39 43 12 0 0 00:20:19 1

      1. Hello, yes you were right. I had only one neighborship between AS1 and AS2. I repeated the whole lab again and now everything is fine. Thank you! πŸ™‚

  9. eBGP session is established between router Haiti and Jamaica
    Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
    192.168.24.2 4 1 36 33 15 0 0 00:09:56 10
    192.168.34.3 4 1 37 53 15 0 0 00:09:56 10

    But

    all routers in AS1 are using 192.168.34.4 as next hop to reach 4.4.4.0 network, I can see metric only on router Haiti not on all routers in AS1.

    Haiti#sh ip bgp 4.4.4.0
    BGP routing table entry for 4.4.4.0/24, version 19
    Paths: (2 available, best #1, table Default-IP-Routing-Table)
    Advertised to update-groups:
    2
    2, (received & used)
    192.168.34.4 (metric 2) from 3.3.3.3 (3.3.3.3)
    Origin IGP, metric 0, localpref 100, valid, internal, best
    2, (received & used)
    192.168.24.4 from 192.168.24.4 (4.4.4.4)
    Origin IGP, metric 200, localpref 100, valid, external

    Cuba#

    *> 4.4.4.0/24 192.168.34.4 0 0 2 i

    Suriname#
    *>i4.4.4.0/24 192.168.34.4 0 100 0 2 i

    Do you know what is going on here?

    1. The route with MED 200 was not your best-path, and BGP only advertises it’s best path, so it follows that other routers in the AS will not see that.

Comments are closed.