cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
11723
Views
21
Helpful
6
Replies

distance command under BGP process

Sandeep Verma
Level 1
Level 1

Hi,

 Can someone explain me how does the command 

distance 200 10.0.0.1 0.0.0.0 DEFAULT

under a BGP process executes.

 

On this router default route is learnt through ospf .

10.0.0.1 is BGP neighbor ip address

DEFAULT is standard access-list with permit 0.0.0.0 statement.

==========================================================

 

The ospf default route is preferred over the default route of BGP neighbor in this scnario.

 

However i want to know how this command executes.

 

Thanks

 

 

2 Accepted Solutions

Accepted Solutions

Dragan Ilic
Level 4
Level 4

Basically that command tells you this:

"set distance 200 from neighbor 10.0.0.1 for receiving routes matching ACL DEFAULT".

 

HTH,

Dragan

HTH,
Dragan

View solution in original post

Ruben Cocheno
Spotlight
Spotlight

If you receive that route via eBGP (AD 20) the router will change to 200 if it learned via neighbour 10.0.0.1 giving preference to OSPF AD 120. Resuming the RIB will have the OSPF route

Tag me to follow up.
Please mark it as Helpful and/or Solution Accepted if that is the case. Thanks for making Engineering easy again.
Connect with me for more on Linkedin https://www.linkedin.com/in/rubencocheno/

View solution in original post

6 Replies 6

Dragan Ilic
Level 4
Level 4

Basically that command tells you this:

"set distance 200 from neighbor 10.0.0.1 for receiving routes matching ACL DEFAULT".

 

HTH,

Dragan

HTH,
Dragan

Thanks .......

Ruben Cocheno
Spotlight
Spotlight

If you receive that route via eBGP (AD 20) the router will change to 200 if it learned via neighbour 10.0.0.1 giving preference to OSPF AD 120. Resuming the RIB will have the OSPF route

Tag me to follow up.
Please mark it as Helpful and/or Solution Accepted if that is the case. Thanks for making Engineering easy again.
Connect with me for more on Linkedin https://www.linkedin.com/in/rubencocheno/

Not sure if the statement is correct ? When the router learns from both bgp distance 200 and ospf with AD 120 for same the same network then ospf path will be preferred and would be in the RIB.

Sandeep Verma
Level 1
Level 1

Thanks .....

fawzy.ali941
Level 1
Level 1

I have two routers 

R1 ------ R2 

and configure eBGP between them and use OSPF as an underlay routing protocol, the BGP peer will be on the loopback IP address, and we redistribute the OSPF route into BGP so the router will receive the route via the BGP and the OSPF since the peer is eBGP with the AD of 20 the route will be installed as BGP route and the session will be reset, to solve this issue we can change the AD of the peer IP only and keep the reminder route as it is the configuration will be as below: 

On R1
------
router bgp 100

neighbor 2.2.2.2 remote-as 200
neighbor 2.2.2.2 ebgp-multihop 255
distance 200 2.2.2.2 0.0.0.0 10

The syntax here is as follows:
* AD to set on prefixes matching
* Neighbor IP of BGP peer(s)
* Wild card to match one or more peers
* Access-list for the prefixes to be modified

!
access-list 10 permit 2.2.2.0 0.0.0.255

On R2
------
router bgp 200
neighbor 1.1.1.1 remote-as 100
neighbor 1.1.1.1 ebgp-multihop 255
neighbor 1.1.1.1 update-source Loopback0
distance 200 1.1.1.1 0.0.0.0 10
!
access-list 10 permit 1.1.1.0 0.0.0.255

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: