03-17-2016 11:25 AM - edited 03-05-2019 03:35 AM
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 distanceas1r1(config-router)#distance 20 ?
A.B.C.D IP Source addressas1r1(config-router)#distance 20 1.1.1.1 ?
A.B.C.D Wildcard bitsas1r1(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>
Solved! Go to Solution.
03-17-2016 12:45 PM
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
03-17-2016 12:34 PM
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
03-17-2016 12:40 PM
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.
03-17-2016 12:45 PM
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
03-17-2016 12:56 PM
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.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide