cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
656
Views
0
Helpful
10
Replies

BGP path selection help on simple lab

Andy White
Level 3
Level 3

Hello,

I have built (too you guys) a very simple BGP lab in GNS3, I'm doing this to understand path selection.  At the moment if host  (172.30.2.11) pings host 2 (192.168.90.11) it goes via R3 to R2, which is right when all the BGP default attributes are the kept.  How would you get the traffic to go via R3 > R1 > R2 instead and visa versa?  

bgp path selection 1.JPG

Thanks

1 Accepted Solution

Accepted Solutions

Yes, you'll need to configure R3 -> R1 to be the preferred path if you're wanting to change the path from the host's perspective. On R3, you'd configure "neighbor weight 110". Take the other neighbor statement off and do a soft clear on the session. You should be able to see in the bgp table that R1 is preferred for all routes that R3 is receiving from it - including the routes from R2. As Harold stated, the default is 0 for weight for incoming routes and 32768 for locally generated routes, so changing it for R2 was still prefering R2 as the path that you wanted to take.

HTH,
John

*** Please rate all useful posts ***

HTH, John *** Please rate all useful posts ***

View solution in original post

10 Replies 10

John Blakley
VIP Alumni
VIP Alumni

Andy,

On R3, you could change local pref or weight to a higher value for R1 instead of R2.

HTH,
John

*** Please rate all useful posts ***

HTH, John *** Please rate all useful posts ***

Is it best to use a route map for this, I'm just trying to work out how I tie it to an interface?

If you're going to use weight, and you want all of you traffic to go a certain path, you can specify the weight directly on the neighbor. If you're going to use local-pref or set weights on specific prefixes, you'd want to use a route map for that.

HTH,
John

*** Please rate all useful posts ***

HTH, John *** Please rate all useful posts ***

Thanks let me try this.  If I had another subnet off R2 and I wanted traffic to each subnet to take separate paths I should just use a route map and prefix list?

Hi,

I must be doing something wrong as the path is still going from R3 > R2 when going to 192.168.90.11

This is wha I did:

R3(config)#router bgp 100                    

R3(config-router)#neighbor 172.12.123.6 weight 110  

R3(config-router)#exit

R3(config)#exit

R3#clear ip bgp * soft   


R3#sh ip bgp 192.168.90.11

BGP routing table entry for 192.168.90.0/24, version 19

Paths: (2 available, best #1, table Default-IP-Routing-Table)

Flag: 0x800

  Advertised to update-groups:

     1        

  200

    172.12.123.6 from 172.12.123.6 (2.2.2.2)

      Origin IGP, metric 0, localpref 100, weight 110, valid, external, best

  200

    172.12.123.2 from 172.12.123.4 (1.1.1.1)

      Origin IGP, metric 0, localpref 100, valid, internal

R3#

Host5#traceroute 192.168.90.11

Type escape sequence to abort.

Tracing the route to 192.168.90.11

  1 172.30.2.1 48 msec 36 msec 20 msec

  2 172.12.123.6 40 msec 36 msec 40 msec

  3 192.168.90.11 40 msec *  24 msec

Host5#

Hi Andy,

The weight is 0 by default. By setting the weight to 110 on neighbor R2, you are effectively preferring it over the other neighbor (R1). You should set the weight on neighbor R1 instead.

Regards

Harold Ritter
Sr Technical Leader
CCIE 4168 (R&S, SP)
harold@cisco.com
México móvil: +52 1 55 8312 4915
Cisco México
Paseo de la Reforma 222
Piso 19
Cuauhtémoc, Juárez
Ciudad de México, 06600
México

Yes, you'll need to configure R3 -> R1 to be the preferred path if you're wanting to change the path from the host's perspective. On R3, you'd configure "neighbor weight 110". Take the other neighbor statement off and do a soft clear on the session. You should be able to see in the bgp table that R1 is preferred for all routes that R3 is receiving from it - including the routes from R2. As Harold stated, the default is 0 for weight for incoming routes and 32768 for locally generated routes, so changing it for R2 was still prefering R2 as the path that you wanted to take.

HTH,
John

*** Please rate all useful posts ***

HTH, John *** Please rate all useful posts ***

Thanks for your elp.

How woud l now use a local pref?  Can you give me an example using the route-map/prefix?

I'm reading about the route reflector, very clever stuff to bend the rules.

Kind Regards

Local pref is set in the route map. If you want to prefer one prefix, you can math with an acl or prefix list.

Ip prefix-list Allow permit 192.168.1.0/24

Route-map Allow permit 10
Match IP address prefix Allow
Set local-pref 200
Route-map Allow permit 20

Under your bgp process you could apply this route map inbound or outbound.

I'm doing this from my phone, so please excuse any syntax errors :)

Sent from Cisco Technical Support iPhone App

HTH, John *** Please rate all useful posts ***

fb_webuser
Level 6
Level 6

Also if you are planning to use local preference with your current topology assuming that R1 and R2 and R3 all are connected to each other and ur trying to reach 192.168.90.0 from R3 - R1 - R2 instead of R3-R2 direct, if you try to change local preference on R3 for 192.168.90.0 subnet while update is hitting R3 from R2 to lower local pref so that R3-R1-R2 would have a higher local pref thus will be chosen as best path then i believe that would be wrong because updates about 192.168.90.0 would be sent from R2 to R1 and stop since there is no Route-Reflector configured.

---

Posted by WebUser Marwan Hassan from Cisco Support Community App

Review Cisco Networking products for a $25 gift card