From: Brian McGahan (bmcgahan@internetworkexpert.com)
Date: Sun Jul 27 2003 - 15:17:13 GMT-3
Jason,
The distance command is taking affect, however the behavior of
the command varies by protocol.
When using the following syntax:
Distance [distance] [neighbor] [wildcard] [access-list]
The [neighbor] address is the address listed in the 'from w.x.y.z' in
the sh ip route 'a.b.c.d' output. An example:
R1--10.0.0.0/8--R2--20.0.0.0/8--R3
R1 and R2 advertise networks 1.1.1.1/32 and 2.2.2.2/32 respectively.
Their router-id's also correspond to this scheme.
R3's output is as follows
R3#sh ip route ospf
1.0.0.0/32 is subnetted, 1 subnets
O 1.1.1.1 [110/12] via 20.0.0.2, 00:01:53, FastEthernet0/13
2.0.0.0/32 is subnetted, 1 subnets
O 2.2.2.2 [110/2] via 20.0.0.2, 00:01:53, FastEthernet0/13
Both 1.1.1.1 and 2.2.2.2 are learned from R2, with a next-hop value of
20.0.0.2. Now let's look at the specifics of each of these routes.
R3#sh ip route 1.1.1.1
Routing entry for 1.1.1.1/32
Known via "ospf 1", distance 110, metric 12, type intra area
Last update from 20.0.0.2 on FastEthernet0/13, 00:02:42 ago
Routing Descriptor Blocks:
* 20.0.0.2, from 1.1.1.1, 00:02:42 ago, via FastEthernet0/13
Route metric is 12, traffic share count is 1
"* 20.0.0.2" means that 20.0.0.2 is the next hop.
"from 1.1.1.1" means that the route was originated by an OSPF router
with RID 1.1.1.1.
R3#sh ip route 2.2.2.2
Routing entry for 2.2.2.2/32
Known via "ospf 1", distance 110, metric 2, type intra area
Last update from 20.0.0.2 on FastEthernet0/13, 00:02:45 ago
Routing Descriptor Blocks:
* 20.0.0.2, from 2.2.2.2, 00:02:45 ago, via FastEthernet0/13
Route metric is 2, traffic share count is 1
"* 20.0.0.2" means that 20.0.0.2 is the next hop.
"from 2.2.2.2" means that the route was originated by an OSPF router
with RID 2.2.2.2.
When using the distance syntax, the neighbor address to be
matched on is the 'from w.x.y.z' address. Let's suppose that we want to
change the distance of routes originated by R2 to 109.
R3(config)#router ospf 1
R3(config-router)#distance 109 2.2.2.2 0.0.0.0 1
R3(config-router)#access-list 1 permit any
R3(config)#end
R3#clear ip route *
R3#sh ip route ospf
1.0.0.0/32 is subnetted, 1 subnets
O 1.1.1.1 [110/12] via 20.0.0.2, 00:00:01, FastEthernet0/13
2.0.0.0/32 is subnetted, 1 subnets
O 2.2.2.2 [109/2] via 20.0.0.2, 00:00:01, FastEthernet0/13
As you can see, 2.2.2.2 now has a distance of 109. Although
both prefixes are learned from 20.0.0.2, only 2.2.2.2 was originated by
2.2.2.2, therefore it is the only prefix affected by the distance
command.
HTH,
Brian McGahan, CCIE #8593
bmcgahan@internetworkexpert.com
> -----Original Message-----
> From: nobody@groupstudy.com [mailto:nobody@groupstudy.com] On Behalf
Of
> Jason Cash
> Sent: Sunday, July 27, 2003 2:02 AM
> To: ccielab@groupstudy.com
> Subject: OSPF Distance not taking effect!
>
> This has got me a bit confused. Switch 2 will always receive routes
from
> R5, modifying cost or link bw is not allowed on any of the OSPF
routers:
>
>
>
> R5 RouterID 136.10.5.5
>
> R6 RotuerID 136.10.6.6
>
>
>
> The solution on Sw2 is:
>
>
>
> router ospf 1
>
> router-id 136.10.20.2
>
> distance 109 136.10.5.5 0.0.0.0 2
>
>
>
> access-list 2 permit any
>
>
>
> As you can see only 1 route is distance correctly, all the others just
> assume the default of 110:
>
>
>
> switch2#si os
>
> 136.10.0.0/16 is variably subnetted, 13 subnets, 5 masks
>
> O E2 136.10.2.0/24 [110/20] via 136.10.56.5, 00:04:39, Vlan56
>
> [110/20] via 136.10.56.6, 00:04:39, Vlan56
>
> O E2 136.10.1.0/24 [110/20] via 136.10.56.5, 00:04:39, Vlan56
>
> [110/20] via 136.10.56.6, 00:04:39, Vlan56
>
> O E2 136.10.12.0/24 [110/20] via 136.10.56.5, 00:04:39, Vlan56
>
> [110/20] via 136.10.56.6, 00:04:39, Vlan56
>
> O E2 136.10.24.0/29 [110/20] via 136.10.56.5, 00:04:39, Vlan56
>
> [110/20] via 136.10.56.6, 00:04:40, Vlan56
>
> O IA 136.10.100.6/32 [109/121] via 136.10.56.5, 00:04:40, Vlan56
>
> O IA 136.10.100.5/32 [109/1] via 136.10.56.5, 00:04:40, Vlan56
>
> O IA 136.10.100.2/32 [109/65] via 136.10.56.5, 00:04:40, Vlan56
>
>
>
This archive was generated by hypermail 2.1.4 : Wed Aug 06 2003 - 06:52:55 GMT-3