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

Changing the admin distance of a single bgp route

DialerString_2
Level 3
Level 3

Hey Guys and Gals,

This has been killing....ugh. How can I change the admin distance of a single BGP route?  I have the below route int my routing table and I want to use EIGRP to get to 10.200.16.0 instead of BGP.  The bpp neighbor are on different AS's.

B       10.200.16.0 [20/0] via 172.12.123.2, 00:03:39

I was trying to use the "distance 200 10.200.16.1 0.0.0.0" command but that doesn't seem to work. I also tried creating a route-map to change the origin to igp and redistribute the route-map out through the bgp neighbor.

route-map bgp, permit, sequence 10
  Match clauses:
  Set clauses:
    origin igp
  Policy routing matches: 0 packets, 0 bytes

Any help is appreciated..

Eric

1 Accepted Solution

Accepted Solutions

Jon Marshall
Hall of Fame
Hall of Fame

DialerString wrote:

Hey Guys and Gals,

This has been killing....ugh. How can I change the admin distance of a single BGP route?  I have the below route int my routing table and I want to use EIGRP to get to 10.200.16.0 instead of BGP.  The bpp neighbor are on different AS's.

B       10.200.16.0 [20/0] via 172.12.123.2, 00:03:39

I was trying to use the "distance 200 10.200.16.1 0.0.0.0" command but that doesn't seem to work. I also tried creating a route-map to change the origin to igp and redistribute the route-map out through the bgp neighbor.

route-map bgp, permit, sequence 10
  Match clauses:
  Set clauses:
    origin igp
  Policy routing matches: 0 packets, 0 bytes

Any help is appreciated..

Eric

Eric

Bit of a weird one this. With BGP the distance command as you applied it should work on a route. However i found that it behaves the same way as the distance command used with an IGP such as EIGRP/OSPF. So try this -

access-list 1 permit 100.200.16.0

router bgp

distance 200 0.0.0.0 1  <-- where the neighbor IP is the EBGP neighbor IP address. The 1 at the end refers to the acl so only that route has it's distance changed.

Jon


Cisco are currently donating money to the Haiti earthquake appeal for every rating so please consider rating all helpful posts.

View solution in original post

6 Replies 6

Jon Marshall
Hall of Fame
Hall of Fame

DialerString wrote:

Hey Guys and Gals,

This has been killing....ugh. How can I change the admin distance of a single BGP route?  I have the below route int my routing table and I want to use EIGRP to get to 10.200.16.0 instead of BGP.  The bpp neighbor are on different AS's.

B       10.200.16.0 [20/0] via 172.12.123.2, 00:03:39

I was trying to use the "distance 200 10.200.16.1 0.0.0.0" command but that doesn't seem to work. I also tried creating a route-map to change the origin to igp and redistribute the route-map out through the bgp neighbor.

route-map bgp, permit, sequence 10
  Match clauses:
  Set clauses:
    origin igp
  Policy routing matches: 0 packets, 0 bytes

Any help is appreciated..

Eric

Eric

Bit of a weird one this. With BGP the distance command as you applied it should work on a route. However i found that it behaves the same way as the distance command used with an IGP such as EIGRP/OSPF. So try this -

access-list 1 permit 100.200.16.0

router bgp

distance 200 0.0.0.0 1  <-- where the neighbor IP is the EBGP neighbor IP address. The 1 at the end refers to the acl so only that route has it's distance changed.

Jon


Cisco are currently donating money to the Haiti earthquake appeal for every rating so please consider rating all helpful posts.

Jon,

I just figured it out and I was sourcing the incoming route wrong. I should have been using this > distance 10 "bgp peer" "access-list".

I didn't read your entire post,  Jon but if I had your hands I'd cut mine off. Thanks again, Jon.

did you try using the BGP back door command,

it would get the BGP learnt route, to be learnt as an iBGP prefix(200), therefore allowing the EIGRP path to be preferred

The solution given by Jon worked very well in my scenario.
I have the scenario with a router receiving the route via EIGRP and via eBGP. In my case I need to redistribute the route received by EIGRP into BGP, because it is a backup solution where the route by EIGRP is prefered over the BGP.

In normal case te route received by eBGP comes with AD=20 and the EIGRP=90. In this case the router never will advertise back the route learned by EIGRP, since it is already receives the route by eBGP with a lower AD. The solution was manipulate the route in the BGP, with AD=200, so in this case always it will prefer the EIGRP since the AD now is lower (90 or 170 < 200).

Thank you very much.

Mirian2000
Level 1
Level 1

This also works for V15.2(4)

For ALL BGP distances on the router:

router BGP 65000 (or whatever number you are running)

distance bgp 190 189 188 

!!(190 is for ebgp; 189 ibgp; 188 local)

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Review Cisco Networking products for a $25 gift card