RE: OSPF and the distance command

From: Russell Kelly \(rukelly\) (rukelly@cisco.com)
Date: Fri Aug 11 2006 - 22:04:04 ART


This looks right - as far as the config goes - one question you have a
neighbor command for r3 on r5 but not for R4 - what is the neigbor
setup like and the interface setup like (is it point-to-point - or non
broadcast?)

Can you send sh ip ospf nei from each and interface configs? -

Below is my config - just to show I works

        187.1.45.0/24
        ------------------R5 - ASBR to EiGRP
R4 ---- |
        |
        ------------------R3 - ASBR to EiGRP
        187.1.134.0/24

From r4 (ignore the 150.1.6.0 route)

R4(config-router)#do sh ip route | incl /21
O E1 150.1.6.0/24 [110/21] via 187.1.45.5, 00:00:53, Serial0/1
O E1 150.1.2.0/24 [110/21] via 187.1.134.3, 00:00:53, Serial0/0.134
                     [110/21] via 187.1.45.5, 00:00:53, Serial0/1
O E1 150.1.10.0/24 [110/21] via 187.1.134.3, 00:00:54, Serial0/0.134
                      [110/21] via 187.1.45.5, 00:00:54, Serial0/1
O E1 150.1.9.0/24 [110/21] via 187.1.134.3, 00:00:54, Serial0/0.134
                     [110/21] via 187.1.45.5, 00:00:54, Serial0/1

R4(config-router)#do sh ip route 150.1.10.0
Routing entry for 150.1.10.0/24
  Known via "ospf 1", distance 110, metric 21
  Tag 90, type extern 1
  Last update from 187.1.45.5 on Serial0/1, 00:01:33 ago
  Routing Descriptor Blocks:
  * 187.1.134.3, from 150.1.3.3, 00:01:33 ago, via Serial0/0.134
      Route metric is 21, traffic share count is 1
    187.1.45.5, from 150.1.5.5, 00:01:33 ago, via Serial0/1
      Route metric is 21, traffic share count is 1

R4(config-router)#do sh ip ospf data ext 150.1.10.0

            OSPF Router with ID (150.1.4.4) (Process ID 1)

                Type-5 AS External Link States

  Routing Bit Set on this LSA
  LS age: 838
  Options: (No TOS-capability, DC)
  LS Type: AS External Link
  Link State ID: 150.1.10.0 (External Network Number )
  Advertising Router: 150.1.3.3
  LS Seq Number: 80000001
  Checksum: 0x2463
  Length: 36
  Network Mask: /24
        Metric Type: 1 (Comparable directly to link state metric)
        TOS: 0
        Metric: 20
        Forward Address: 0.0.0.0
        External Route Tag: 90

  Routing Bit Set on this LSA
  LS age: 838
  Options: (No TOS-capability, DC)
  LS Type: AS External Link
  Link State ID: 150.1.10.0 (External Network Number )
  Advertising Router: 150.1.5.5
  LS Seq Number: 80000001
  Checksum: 0xA79
  Length: 36
  Network Mask: /24
        Metric Type: 1 (Comparable directly to link state metric)
        TOS: 0
        Metric: 20
        Forward Address: 0.0.0.0
        External Route Tag: 90

Config is:

router ospf 1
 router-id 150.1.4.4
 log-adjacency-changes
 area 134 range 187.1.134.0 255.255.255.0
 area 134 virtual-link 150.1.1.1 authentication authentication-key CISCO
 area 134 virtual-link 150.1.3.3 authentication message-digest
authentication-key CISCO
 redistribute connected subnets route-map CONNECTED
 passive-interface default
 no passive-interface Serial0/0.134
 no passive-interface Serial0/1
 network 150.1.4.4 0.0.0.0 area 134
 network 187.1.4.4 0.0.0.0 area 0
 network 187.1.45.4 0.0.0.0 area 45
 network 187.1.134.4 0.0.0.0 area 134
 distance 15 150.1.5.5 0.0.0.0 1
!

Now I configure the following:

R4(config-router)# distan 15 150.1.5.5 0.0.0.0 1

access-list 1 deny 150.1.10.0 0.0.0.255
access-list 1 permit any

Any now -

R4(config-router)#do sh ip route | incl /21
O E1 150.1.6.0/24 [15/21] via 187.1.45.5, 00:00:35, Serial0/1
O E1 150.1.2.0/24 [15/21] via 187.1.45.5, 00:00:35, Serial0/1
O E1 150.1.10.0/24 [110/21] via 187.1.134.3, 00:00:35, Serial0/0.134
                      [110/21] via 187.1.45.5, 00:00:35, Serial0/1
O E1 150.1.9.0/24 [15/21] via 187.1.45.5, 00:00:35, Serial0/1

Standard IP access list 1
    10 deny 150.1.10.0, wildcard bits 0.0.0.255 (2 matches)
    20 permit any (8 matches)

-----Original Message-----
From: sabrina pittarel [mailto:sabri_esame@yahoo.com]
Sent: 12 August 2006 01:38
To: Russell Kelly (rukelly); Michael Stout; ccielab@groupstudy.com
Subject: RE: OSPF and the distance command

OK, this is the current status...

First some info about the network.

In my "real" topology R1 and R2, the ASBRs, are called
R3 and R4 instead, and R3 is instead R5. The ospf area is 345, but
that's the only ospf area I have i.e. it's equivalent to area 0 and I
see the issue also when I'm really using area 0. 345 is not a stub area
of any kind.
i.e the "real" topology is :

   130.1.35.0/24
R3 -------
          |
          R5
          |
R4 -------
    130.1.45.0/24

130.1.78.0 is one of the redistributed networks:

show ip route:
---------------
<snip>
O E2 130.1.78.0/24 [109/20] via 130.1.45.4,
00:00:04, Serial1/1
                      [109/20] via 130.1.35.3, 00:00:04, Serial1/0

sh ip route 130.1.78.0
-------------------------
Routing entry for 130.1.78.0/24
  Known via "ospf 1", distance 109, metric 20
  Tag 345, type extern 2, forward metric 64
  Last update from 130.1.45.4 on Serial1/1, 00:02:47 ago
  Routing Descriptor Blocks:
    130.1.45.4, from 150.1.4.4, 00:02:47 ago, via
Serial1/1
      Route metric is 20, traffic share count is 1
      Route tag 345
  * 130.1.35.3, from 150.1.3.3, 00:02:47 ago, via Serial1/0
      Route metric is 20, traffic share count is 1
      Route tag 335

OSPF topology data base:

Routing Bit Set on this LSA
  LS age: 847
  Options: (No TOS-capability, DC)
  LS Type: AS External Link
  Link State ID: 130.1.78.0 (External Network Number )
  Advertising Router: 150.1.3.3
  LS Seq Number: 8000000D
  Checksum: 0xEFE4
  Length: 36
  Network Mask: /24
        Metric Type: 2 (Larger than any link state
path)
        TOS: 0
        Metric: 20
        Forward Address: 0.0.0.0
        External Route Tag: 335

  Routing Bit Set on this LSA
  LS age: 910
  Options: (No TOS-capability, DC)
  LS Type: AS External Link
  Link State ID: 130.1.78.0 (External Network Number )
  Advertising Router: 150.1.4.4
  LS Seq Number: 8000000D
  Checksum: 0x9731
  Length: 36
  Network Mask: /24
        Metric Type: 2 (Larger than any link state
path)
        TOS: 0
        Metric: 20
        Forward Address: 0.0.0.0
        External Route Tag: 345

And last but not least my config:

router ospf 1
 router-id 150.1.5.5
 log-adjacency-changes
 network 130.1.5.0 0.0.0.255 area 345
 network 130.1.35.0 0.0.0.7 area 345
 network 130.1.45.0 0.0.0.255 area 345
 network 150.1.5.0 0.0.0.255 area 345
 network 192.10.1.0 0.0.0.255 area 345
 neighbor 130.1.35.3
 distance 109 150.1.4.4 0.0.0.0 1
!

show ip access-list 1:
------------------------
Standard IP access list 1
    10 deny 150.1.3.0, wildcard bits 0.0.0.255 (8
matches)
    20 permit any (170 matches)

Sabrina

--- "Russell Kelly (rukelly)" <rukelly@cisco.com>
wrote:

> I have a similar setup and it is working - can you do a sh ip route
> then choose a particular network and do a sh ip route <network> ?
>
>
>
> -----Original Message-----
> From: nobody@groupstudy.com
> [mailto:nobody@groupstudy.com] On Behalf Of
> sabrina pittarel
> Sent: 12 August 2006 01:13
> To: Michael Stout; ccielab@groupstudy.com
> Subject: RE: OSPF and the distance command
>
> Yaah,
> that works, but I'm back at square 0 in terms of
> preventing load
> balancing using distance.
> Maybe ospf doesn't like that 2 neighbors advertising
> the same external
> route have different admin distance.
> I would have expected some problem on internal
> routes, but not on
> external/interarea ones, which behaves in distance
> vector-ish mode.
> Well too bad, it would have been a cool thing.
>
> Sabrina
>
> --- Michael Stout <michaelgstout@hotmail.com> wrote:
>
>
> ---------------------------------
>
> i don't know if the distance command works the way
> you are using it.
> I use it like this.
>
> access-list 1 permit 172.10.22.0 0.0.0.255
> access-list 1 perm
> 172.10.34.0 0.0.0.255
>
> I want to modify the distance for those two routes.
>
> router ospf 1
> distance 88 0.0.0.0 255.255.255.255 1 <-- one is the
> access-list
>
> This method should change your distance to 88.
> Do a clear ip route if you need to, but it will
> probubly change
> immediatly.
>
> debug ip routing to see your routing tables adjust
> to your changes
>
>
>
> Good Luck
>
>
>
>
>
>
>
> ---------------------------------
>
> From: sabrina pittarel <sabri_esame@yahoo.com>
> Reply-To: sabrina pittarel <sabri_esame@yahoo.com>
> To: Michael Stout <michaelgstout@hotmail.com>,
> ccielab@groupstudy.com
> Subject: RE: OSPF and the distance command
> Date: Fri, 11 Aug 2006 16:07:56 -0700 (PDT) Hi
> Michael, I know the
> theory behind the use of the distance command, and I
> know that the
> reason why the ping to R6 and/or R5 loopbacks fails
> because R1 sends the
> echo request to R2 and even if it'll make it all the
> why to R4, R4 it'll
> send it back to R3.
> What puzzles me is why the router doesn't do what
> is supposed to in my
> topology.
> I'm explicitly telling him to set the distance to
> 109 for routes coming
> from a particular route-source. Why the hell is not
> doing it!!
> Sorry. It is driving me crazy.
>
> Sabrina
>
> --- Michael Stout <michaelgstout@hotmail.com> wrote:
>
> > I don't think you network is a good candidate for
> studying distannce.
> >
> > try this
> > r1-----------r2---------r3------r4
> > r1----------r6---------r5-------r4
> > OSPF on top RIP on bottom>
> > redistriburte mutually using default rip metric of
> > 1>
> > from r1 trace to R5 rip>
> > You trace will go r2--r3--r4--r5
> > that is because ospf has a better DISTANCE and r1
> thinks the path to
> > r5 is one hop away if it uses the ospf path but it
> thinks the path to
> > R5 is
> > 2 hops away if it takes the path through r6.
> > You need distance so you use the native protocol
> >
> > Next ad loopbacks to R6 and R5.
> > You will not be able to trace to the loopbacks
> from the ospf network
> > You need to use distance to kill the loop
> >
> >
> >
>
--------------------------------------------------------------------
> >
> > From: sabri_esame@yahoo.com
> > Reply-To: sabri_esame@yahoo.com
> > To: ccielab@groupstudy.com
> > Subject: OSPF and the distance command
> > Date: Fri, 11 Aug 2006 17:50:07 -0400
> > Hi all,
> > I'm trying to understand how ospf behaves in
> relation with the
> > following command:
> >
> > distance <#> <route-source> <wildcard> <acl>
> >
> > I have the following topology:
> >
> > R1 --------
> > |
> > R3
> > |
> > R2 --------
> >
> > R1, R2 and R3 are all in area 0. All routers
> have their loopbacks
> > advertised in area0.
> >
> > R1 and R2 are also ASBRs and can reach the same
> set of external
> > networks.
> >
> > I want to configure R3 in such a way it will
> forward all traffic for
> > external networks to R2.
> > I know I can accomplish that modifying the
> redistribution metrics in
> > R1
> > and R2, but as I said I'm trying to understand
> how the *distance*
> > command behaves.
> >
> > I thought I could solve the problem doing the
> > following:
> >
> > R3
> > ---
> >
> > router ospf #
> > distance 109 <R2 RID> 0.0.0.0 1
> >
> > access-list 1 deny <R1's loopback>
> > access-list 1 permit any
> >
> > but it doesn't work.
> >
> > All external routes are still load balanced
> between R1 and R2 and
> > show
> > up in the routing table with AD 110.
> > The only route with AD = 109 is R2's loopback.
> If I remove the acl
> > from
> > the distance command, i.e.
> >
> > distance 109 <R2 RID> 0.0.0.0
> >
> > also R1's loopback will be shown with distance
> 109 and R2 will be
> > preferred (!!!). All other routes will still be
> load balanced and
> > will have
> > AD 110
> >
> > Only if I shut the link between R1 and R3 I
> finally see these routes
> > with an AD of 109.
> >
> > I really don't understand what is going on, any
> ideas?
> >
>
=== message truncated ===



This archive was generated by hypermail 2.1.4 : Fri Sep 01 2006 - 15:41:57 ART