Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements
Webcast-Catalyst9k
Silver

Modifying iBGP distance for a Specific Prefix

Hi

I have scenario where I wish bgp backdoor could be used, but it can't in this case.

I have router learning a single prefix via EIGRP and iBGP. I would like it to prefer iBGP, but of course EIGRP wins due to distance (90).

I would like to modify a single prefix learned via iBGP to say 80 for example. So long as it wins over EIGRP.

I've researched few posts, but they point to eBGP. I would imagine the same could be acheived for iBGP. Has anyone done this and is there any other ways it can be acheived other than using ACL with distance command under BGP.

thank you

2 ACCEPTED SOLUTIONS

Accepted Solutions

Hello , First of all it's not

Hello ,

 

First of all it's not recommended to modify the AD of iBGP learned routes as Cisco says:

Caution Changing the administrative distance of BGP internal routes is considered dangerous and is not recommended. One problem that can arise is the accumulation of routing table inconsistencies, which can break routing.

 

Now back to your question it can be done either to iBGP routes or eBGP and this is done via the distance ACL command.

The other thing you could do is going to the EIGRP process and incrementing the distance of that prefix so you do not play with BGP but with EIGRP.

Regards,

 

Remember to rate all of the helpful posts

N

Julio Carvajal
Senior Network Security and Core Specialist
CCIE #42930, 2xCCNP, JNCIP-SEC

You may change the EIGRP AD

You may change the EIGRP AD for the specific prefix, as Julio outlines, it is probably best doing it this way than to play with BGP.

The way you can accomplish that is here:

ibgp&eigrp

R1 is advertising a connected network 1.1.1.0. There is an iBGP peering between R1 and R2. Also an EIGRP neighborship between them both. I want to influence R2's route to 1.1.1.0/24 to prefer iBGP (200) over eigrp (90).

Here is my current config and routes.

router eigrp 10
 network 1.1.1.0 0.0.0.255
 network 10.0.0.1 0.0.0.0
 no auto-summary
!
router bgp 100
 no synchronization
 bgp router-id 10.0.0.1
 bgp log-neighbor-changes
 network 1.1.1.0 mask 255.255.255.0
 neighbor 10.0.0.2 remote-as 100
 no auto-summary
 
Rack1R2
router eigrp 10
 network 10.0.0.2 0.0.0.0
no auto-summary
!
router bgp 100
 no synchronization
 bgp router-id 10.0.0.2
 bgp log-neighbor-changes
 neighbor 10.0.0.1 remote-as 100
 no auto-summary


Rack1R2#show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area 
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route
 
Gateway of last resort is not set

     1.0.0.0/24 is subnetted, 1 subnets
D       1.1.1.0 [90/409600] via 10.0.0.1, 00:06:30, FastEthernet0/0
     10.0.0.0/30 is subnetted, 1 subnets
C       10.0.0.0 is directly connected, FastEthernet0/0
Rack1R2#       
Rack1R2#show ip bgp
BGP table version is 4, local router ID is 10.0.0.2
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
 
   Network          Next Hop            Metric LocPrf Weight Path
r>i1.1.1.0/24       10.0.0.1                 0    100      0 i

Rack1R2#

 

Now to modify the AD for the particular prefix in EIGRP.

 

Rack1R2(config)#router eigrp 10
Rack1R2(config-router)#distance ?
  <1-255>  Administrative distance
  eigrp    IP-EIGRP distance
Rack1R2(config-router)#distance 201 ? -Make it worse that iBGP
  A.B.C.D  IP Source address
Rack1R2(config-router)#distance 201 10.0.0.1 ? - Where you are learning the route from
  A.B.C.D  Wildcard bits
Rack1R2(config-router)#distance 201 10.0.0.1 0.0.0.0 1 - Followed by an ACL to match the prefix

Rack1R2(config)#ip access-list standard 1

Rack1R2(config-std-nacl)#permit 1.1.1.0

Rack1R2(config-std-nacl)#exit
Rack1R2(config)#
 
For me, it took effect immediately, but you may need to clear ip route x.x.x.x (i've experienced this before)

Rack1R2(config)#do show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area 
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route
 
Gateway of last resort is not set

     1.0.0.0/24 is subnetted, 1 subnets
B       1.1.1.0 [200/0] via 10.0.0.1, 00:03:28
     10.0.0.0/30 is subnetted, 1 subnets
C       10.0.0.0 is directly connected, FastEthernet0/0

Now it has changed to prefer the iBGP route. Please take extra caution as doing this even with IGPs generally can cause routing loops.

hth.

Please rate useful posts & remember to mark any solved questions as answered. Thank you.
5 REPLIES

Hello , First of all it's not

Hello ,

 

First of all it's not recommended to modify the AD of iBGP learned routes as Cisco says:

Caution Changing the administrative distance of BGP internal routes is considered dangerous and is not recommended. One problem that can arise is the accumulation of routing table inconsistencies, which can break routing.

 

Now back to your question it can be done either to iBGP routes or eBGP and this is done via the distance ACL command.

The other thing you could do is going to the EIGRP process and incrementing the distance of that prefix so you do not play with BGP but with EIGRP.

Regards,

 

Remember to rate all of the helpful posts

N

Julio Carvajal
Senior Network Security and Core Specialist
CCIE #42930, 2xCCNP, JNCIP-SEC
Silver

Thanks guys, excellent

Thanks guys, excellent response.

I wanted to also share a 'solution' with you, but i've yet to test it though it has worked for me in the past.

We could use an aggregate-address under BGP to split the /24 into 2x /25's, that would also fix it, and no need to touch AD in either BGP or EIGRP.

take care and thanks again !

Ajaz Nawaz

CCIE#15721

 

ok,Thanks for the rating, lol

ok,

Thanks for the rating, lol

 

 

Julio Carvajal
Senior Network Security and Core Specialist
CCIE #42930, 2xCCNP, JNCIP-SEC

Yes, I believe you can do

Yes, I believe you can do this for both EIGRP and BGP, this may actually be a better method - to advertise more specific prefix's along the prefered path.

Please rate useful posts & remember to mark any solved questions as answered. Thank you.

You may change the EIGRP AD

You may change the EIGRP AD for the specific prefix, as Julio outlines, it is probably best doing it this way than to play with BGP.

The way you can accomplish that is here:

ibgp&amp;eigrp

R1 is advertising a connected network 1.1.1.0. There is an iBGP peering between R1 and R2. Also an EIGRP neighborship between them both. I want to influence R2's route to 1.1.1.0/24 to prefer iBGP (200) over eigrp (90).

Here is my current config and routes.

router eigrp 10
 network 1.1.1.0 0.0.0.255
 network 10.0.0.1 0.0.0.0
 no auto-summary
!
router bgp 100
 no synchronization
 bgp router-id 10.0.0.1
 bgp log-neighbor-changes
 network 1.1.1.0 mask 255.255.255.0
 neighbor 10.0.0.2 remote-as 100
 no auto-summary
 
Rack1R2
router eigrp 10
 network 10.0.0.2 0.0.0.0
no auto-summary
!
router bgp 100
 no synchronization
 bgp router-id 10.0.0.2
 bgp log-neighbor-changes
 neighbor 10.0.0.1 remote-as 100
 no auto-summary


Rack1R2#show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area 
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route
 
Gateway of last resort is not set

     1.0.0.0/24 is subnetted, 1 subnets
D       1.1.1.0 [90/409600] via 10.0.0.1, 00:06:30, FastEthernet0/0
     10.0.0.0/30 is subnetted, 1 subnets
C       10.0.0.0 is directly connected, FastEthernet0/0
Rack1R2#       
Rack1R2#show ip bgp
BGP table version is 4, local router ID is 10.0.0.2
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
 
   Network          Next Hop            Metric LocPrf Weight Path
r>i1.1.1.0/24       10.0.0.1                 0    100      0 i

Rack1R2#

 

Now to modify the AD for the particular prefix in EIGRP.

 

Rack1R2(config)#router eigrp 10
Rack1R2(config-router)#distance ?
  <1-255>  Administrative distance
  eigrp    IP-EIGRP distance
Rack1R2(config-router)#distance 201 ? -Make it worse that iBGP
  A.B.C.D  IP Source address
Rack1R2(config-router)#distance 201 10.0.0.1 ? - Where you are learning the route from
  A.B.C.D  Wildcard bits
Rack1R2(config-router)#distance 201 10.0.0.1 0.0.0.0 1 - Followed by an ACL to match the prefix

Rack1R2(config)#ip access-list standard 1

Rack1R2(config-std-nacl)#permit 1.1.1.0

Rack1R2(config-std-nacl)#exit
Rack1R2(config)#
 
For me, it took effect immediately, but you may need to clear ip route x.x.x.x (i've experienced this before)

Rack1R2(config)#do show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area 
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route
 
Gateway of last resort is not set

     1.0.0.0/24 is subnetted, 1 subnets
B       1.1.1.0 [200/0] via 10.0.0.1, 00:03:28
     10.0.0.0/30 is subnetted, 1 subnets
C       10.0.0.0 is directly connected, FastEthernet0/0

Now it has changed to prefer the iBGP route. Please take extra caution as doing this even with IGPs generally can cause routing loops.

hth.

Please rate useful posts & remember to mark any solved questions as answered. Thank you.
1184
Views
0
Helpful
5
Replies
CreatePlease to create content