cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Announcements
Join Customer Connection to register!
680
Views
0
Helpful
4
Replies

bgp set AD per neighbor command?

distance $AD $neighbor_address $wildcard_mask [$acl_number]

I can't find this command in command reference but it seems like this has existed for a long time. What's the story behind it? I don't get the point of the wildcard mask here.

as1r1(config-router)#distance ?
<1-255> Administrative distance
bgp BGP distance
mbgp MBGP distance

as1r1(config-router)#distance 20 ?
A.B.C.D IP Source address

as1r1(config-router)#distance 20 1.1.1.1 ?
A.B.C.D Wildcard bits

as1r1(config-router)#distance 20 1.1.1.1 255.255.255.255 ?
<1-99> IP Standard access list number
<1300-1999> IP Standard expanded access list number
WORD Standard access-list name
<cr>

1 ACCEPTED SOLUTION

Accepted Solutions

A wildcard is far better suited to matching multiple arbitrary IPs than a subnet mask, that is their main advantage.

See this link, I would point to specific command but it isn't copying into the thread very well  -

http://www.cisco.com/c/en/us/td/docs/ios/iproute_pi/command/reference/iri_book.html

Jon

View solution in original post

4 REPLIES 4
Jon Marshall
Hall of Fame Guru

Firstly 255.255.255.255 is not a wildcard mask.

The command is not related to a specific routing protocol but is in the documentation.

The wildcard mask is used to specify which neighbor IPs to apply the distance command to.

So imagine you have 3 routers in a common subnet eg. 192.168.3.1, 192.168.3.2 and 192.168.3.3 and on the 192.168.3.1 router you wanted to change the distance of any routes received from 192.168.3.2 then the command would be -

"distance <num> 192.168.3.2 0.0.0.0"

if however you wanted to change the distance of routes received from both 192.168.3.2 and 192.168.3.3 then you would change the wildcard to match eg.

"distance <num> 192.168.3.0 0.0.0.3"

which covers both 192.168.3.2 and 192.168.3.3 just as you would use a wildcard in an acl.

Jon

Thanks. Can you point me to the documentation of this command? It does work and I suspect the command is there for some legacy reasons.

imo the address + wildcard is very inefficient here. can totally get rid of the wildcard or use a structure that's more suited for matching multiple arbitrary addresses.

A wildcard is far better suited to matching multiple arbitrary IPs than a subnet mask, that is their main advantage.

See this link, I would point to specific command but it isn't copying into the thread very well  -

http://www.cisco.com/c/en/us/td/docs/ios/iproute_pi/command/reference/iri_book.html

Jon

View solution in original post

An old command indeed.

10.0 This command was introduced.

I was picturing some compound matching structures like route map to match unrelated IPs. A subnet mask would most definitely be inappropriate for this type of use case.

I guess the intention to include mask was to make full use of TCAM.