cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
9809
Views
10
Helpful
6
Replies

BGP Routes overriding static route

                   I have a router running bgp.  I am also multihomed.  I want to force a single networks traffic out of one isp. when I enter the command i typed

example  ip route 2.2.2.0 255.255.255.0 4.3.2.1  1.  When I do a trace the traffic is still following bgp's learned route and not that of a default route.  I do know that the metric of the bgp is currently 3.  And that 3 is the result of many different characteristics.  My default route was built and have a metric of 1.  How do I make my static route more attractive than the route for bgp?

6 Replies 6

cadet alain
VIP Alumni
VIP Alumni

Hi,

when a router gets a prefixed advertised by 2 different sources, it will install the one with the lower AD and the default AD of 1 for a static route is always lower than the default BGP AD of either 20 or 200.But don't forget that the router always chooses the longest match route to forward traffic so if you have a longer BGP prefix it will win over the static route.

Can you tell us which destination you want to reach and post the output of sh ip route and sh run |  i ip route

Regards

Alain

Don't forget to rate helpful posts.

Don't forget to rate helpful posts.

Hello and thanks for the reply.  Below is my static route:

ip route 198.105.200.0 255.255.254.0 65.183.164.105

Here is the show ip route:

R01-3N-1001a#show ip route 198.105.200.0

Routing entry for 198.105.200.0/23, supernet

  Known via "static", distance 1, metric 0

  Redistributing via bgp 54840

  Advertised by bgp 54840

  Routing Descriptor Blocks:

  * 65.183.164.105

      Route metric is 0, traffic share count is 1

I am trying to reach 198.105.204.212

R01-3N-1001a#sh run | in ip route

ip route 198.105.200.0 255.255.254.0 65.183.164.105

198.105.200.0/23 [1/0] via 65.183.164.105

B     198.105.202.0/23 [20/3] via 65.46.177.225, 1w3d

B     198.105.204.0/24 [20/3] via 65.46.177.225, 1w3d

B     198.105.205.0/24 [20/3] via 65.46.177.225, 1w3d

B     198.105.206.0/24 [20/3] via 65.46.177.225, 1w3d

B     198.105.208.0/20 [20/3] via 65.46.177.225, 1w1d

B     198.105.221.0/24 [20/0] via 65.183.164.105, 1w1d

B     198.105.222.0/24 [20/0] via 65.183.164.105, 4w1d

B     198.105.223.0/24 [20/0] via 65.183.164.105, 4w1d

B     198.105.224.0/21 [20/0] via 65.183.164.105, 1w3d

B     198.105.232.0/22 [20/0] via 65.183.164.105, 6w1d

B     198.105.236.0/24 [20/0] via 65.183.164.105, 1w4d

B     198.105.240.0/24 [20/0] via 65.183.164.105, 3w6d

B     198.105.241.0/24 [20/0] via 65.183.164.105, 3w6d

B     198.105.242.0/24 [20/0] via 65.183.164.105, 3w6d

B     198.105.243.0/24 [20/0] via 65.183.164.105, 3w6d

B     198.105.244.0/24 [20/0] via 65.183.164.105, 3w6d

B     198.105.245.0/24 [20/3] via 65.46.177.225, 1w4d

B     198.105.246.0/24 [20/3] via 65.46.177.225, 1w4d

B     198.105.247.0/24 [20/3] via 65.46.177.225, 1w4d

B     198.105.248.0/24 [20/3] via 65.46.177.225, 1w4d

198.105.200.0/23 [1/0] via 65.183.164.105

B     198.105.202.0/23 [20/3] via 65.46.177.225, 1w3d

B     198.105.204.0/24 [20/3] via 65.46.177.225, 1w3d

B     198.105.205.0/24 [20/3] via 65.46.177.225, 1w3d

B     198.105.206.0/24 [20/3] via 65.46.177.225, 1w3d

B     198.105.208.0/20 [20/3] via 65.46.177.225, 1w1d

B     198.105.221.0/24 [20/0] via 65.183.164.105, 1w1d

B     198.105.222.0/24 [20/0] via 65.183.164.105, 4w1d

B     198.105.223.0/24 [20/0] via 65.183.164.105, 4w1d

B     198.105.224.0/21 [20/0] via 65.183.164.105, 1w3d

B     198.105.232.0/22 [20/0] via 65.183.164.105, 6w1d

B     198.105.236.0/24 [20/0] via 65.183.164.105, 1w4d

B     198.105.240.0/24 [20/0] via 65.183.164.105, 3w6d

B     198.105.241.0/24 [20/0] via 65.183.164.105, 3w6d

B     198.105.242.0/24 [20/0] via 65.183.164.105, 3w6d

B     198.105.243.0/24 [20/0] via 65.183.164.105, 3w6d

B     198.105.244.0/24 [20/0] via 65.183.164.105, 3w6d

B     198.105.245.0/24 [20/3] via 65.46.177.225, 1w4d

B     198.105.246.0/24 [20/3] via 65.46.177.225, 1w4d

B     198.105.247.0/24 [20/3] via 65.46.177.225, 1w4d

B     198.105.248.0/24 [20/3] via 65.46.177.225, 1w4d

Hi,

you've got a longest match through BGP:

B     198.105.204.0/24 [20/3] via 65.46.177.225, 1w3d

So install a host route : ip route 198.105.204.212 255.255.255.255 65.183.164.105

Regards

Alain

Don't forget to rate helpful posts.

Don't forget to rate helpful posts.

That worked.  I tried both a /24 and it worked.  Thanks again.!

Hi All 

please assist.

Hi,

IMHO, configuring two static routes

ip route 10.87.120.0 255.255.255.0 145.34.130.146

ip route 10.87.120.0 255.255.255.0 145.34.130.90

for the same prefix will cause your router to load-balance.

As per-packet load balancing is always used for packets originated by the router itself, you should see the first traceroute packet replied by the first next-hop, the second packet by the second next-hop, etc.

You can check by

sh ip cef 10.87.120.135

and

sh ip cef 10.87.120.140

issued.

It's strange your IOS is not showing both routes when sh ip route command is issued.

Can you try

sh ip route 10.87.120.135

and

sh ip route 10.87.120.140 ?

Best regards,

Milan