Routing Confusion

Discussion in 'Cisco' started by Toby, Dec 24, 2004.

  1. Toby

    Toby Guest

    Hi

    I have recently seen in a config the following. (ip addresses changed to
    private range)

    ip route 10.1.16.0 255.255.240.0 FastEthernet0/0 192.168.1.42

    Where the FastEthernet0/0 was configured as 192.168.1.1 255.255.255.0

    What is the purpose of this static route, surly the fastethernet0/0 would
    not be needed as the network 10.1.16.0 would be forwarded to the
    router/frewall (192.168.1.2) without the inclusion of the (FastEthernet0/0)
    part of the statement, as the forwarding part lives on theis interface.

    regards

    Toby
     
    Toby, Dec 24, 2004
    #1
    1. Advertisements

  2. If FastEthernet0/0 goes down, you'll get "No route to host" when you try
    to send to 10.1.16.0/20 addresses. If you leave out the interface in
    the static route, it will look in its routing table to see how to get to
    192.168.1.42, perhaps sending via the default route.

    Also, this gives the route an admin distance 0, because it's a directly
    connected route.
     
    Barry Margolin, Dec 24, 2004
    #2
    1. Advertisements

  3. Hello, Barry!
    You wrote on Fri, 24 Dec 2004 18:00:14 -0500:

    ??>> I have recently seen in a config the following. (ip addresses
    ??>> changed to private range)
    ??>>
    ??>> ip route 10.1.16.0 255.255.240.0 FastEthernet0/0 192.168.1.42
    ??>>
    ??>> Where the FastEthernet0/0 was configured as 192.168.1.1
    ??>> 255.255.255.0
    ??>>
    ??>> What is the purpose of this static route, surly the
    ??>> fastethernet0/0 would not be needed as the network 10.1.16.0
    ??>> would be forwarded to the router/frewall (192.168.1.2) without
    ??>> the inclusion of the (FastEthernet0/0) part of the statement, as
    ??>> the forwarding part lives on theis interface.

    BM> If FastEthernet0/0 goes down, you'll get "No route to host" when
    BM> you try to send to 10.1.16.0/20 addresses. If you leave out the
    BM> interface in the static route, it will look in its routing table
    BM> to see how to get to 192.168.1.42, perhaps sending via the
    BM> default route.

    Not really. In both cases static route will be removed. But there is some
    difference in how it will be done.

    BM> Also, this gives the route an admin distance 0, because it's a
    BM> directly connected route.

    Not at all. It will get admin distance of 1 like any other static route with
    default distance. It doesn't matter if route points to interface of next hop -
    distance is going to be 1.

    With best regards,
    Andrey.
     
    Andrey Tarasov, Dec 24, 2004
    #3
  4. Toby

    olavarrm Guest

    Barry you are right but I would also like to add more to why in some
    cases you would use an interface in a static route vs a next hop.

    1. In some cases you might want to avoid an unnecessary recursive
    lookup. For example if you have a firewall that has an IP address of
    1.1.1.1/24 and you NAT address coming from 1.1.1.1 to address
    2.2.2.0-254 or even 3.3.3.0-254. You could create a static route that
    says "IP route 2.2.2.0 255.255.255.0 1.1.1.1" but if you do this the
    router will need to do a second look up for the interface to use to get
    to 1.1.1.1 (FastEthernet 0/0). If you just created a static route that
    said "IP route 2.2.2.0 255.255.255.0 fastethernet0/0" the router would
    then ARP for address in the range of 2.2.2.0 out FastEthernet0/0 and
    the pix will answer. This avoids a second recursive lookup.

    2. A static route that refers to an interface will automatically be
    included in a routing protocols routing table if it falls within the
    range of the network command. This is true for RIP, OSPF, EIGRP, IGRP.
    If you use the command "IP route 2.2.2.0 255.255.255.0 FastEthernet 0/0
    and your network statement looks like these:

    router Eigrp/Rip/Igrp 1
    network 2.2.2.0

    router Ospf 1
    network 2.2.2.0 0.0.0.0 area 1

    The static route will automatically be added to the routing protocols
    routing table. If the Interface you referred to goes down the route
    will also go away. This avoids you from using the Redistribute static
    command. This allows you to design networks that are more dynamic and
    reflect their actual state.

    2. The admin distance of a static router that refers to an interface is
    0 as apposed to a static route that refers to a next hop is 1.

    -Mike
     
    olavarrm, Dec 26, 2004
    #4
  5. You seem to be explaining the difference between:

    ip route <net> <mask> <interface>
    and
    ip route <net> <mask> <interface> <next-hop>

    which is not what we were discussing. We were comparing

    ip route <net> <mask> <next-hop>
    with
    ip route <net> <mask> <interface> <next-hop>

    The variant without a next-hop should not generally be used on LAN
    interfaces, for the reason you give. The only exception I can think of
    offhand is if there are multiple subnets on that interface, but for some
    reason you haven't assigned a secondary address to the interface.
     
    Barry Margolin, Dec 26, 2004
    #5
  6. Hello, !
    You wrote on 25 Dec 2004 17:16:02 -0800:

    o> 2. A static route that refers to an interface will automatically
    o> be included in a routing protocols routing table if it falls
    o> within the range of the network command. This is true for RIP,
    o> OSPF, EIGRP, IGRP. If you use the command "IP route 2.2.2.0
    o> 255.255.255.0 FastEthernet 0/0 and your network statement looks
    o> like these:

    o> router Eigrp/Rip/Igrp 1
    o> network 2.2.2.0

    o> router Ospf 1
    o> network 2.2.2.0 0.0.0.0 area 1

    o> The static route will automatically be added to the routing
    o> protocols routing table. If the Interface you referred to goes
    o> down the route will also go away. This avoids you from using the
    o> Redistribute static command. This allows you to design networks
    o> that are more dynamic and reflect their actual state.

    It definitely looks like the case for EIGRP but not for OSPF.

    o> 2. The admin distance of a static router that refers to an
    o> interface is 0 as apposed to a static route that refers to a next
    o> hop is 1.

    Do debug ip routing and see for yourself. It's 1, not 0.

    With best regards,
    Andrey.
     
    Andrey Tarasov, Dec 26, 2004
    #6
  7. Toby

    Toby Guest

    Thank you all for contributing to this thread, and hope you are all enjoying
    the Christmas festivities.

    I have not yet been able to re-visit the router in question to check out any
    ideas presented. such as the AD used in the routing table.

    From my recolection though this router is one of a pair to give resilience
    from a customer site to a prividers. and as such uses HSRP on the LAN
    monitoring the WAN links. The Lan feeds several devices in the DMZ in 2
    different ip ranges and a secondary ip address is also used. Also a firewall
    is in use connecting to a couple of non DMZ LAN's. There is a default route
    on this router pointing to the WAN and also iBGP is running to advertise
    into the SP the customers address spaces, but the router does not contain
    the Internet routing table. The static routes to the non DMZ LANs are
    advertised in different ways.

    1 network is set by IP ROUTE 10.1.1.0 255.255.255.0 FastEthernet0/0
    192.168.1.2
    1 network is set by IP ROUTE 11.1.1.0 255.255.255.0 192.168.1.2
    1 network is set by IP ROUTE 12.1.1.0 255.255.255.0 192.168.1.2 tag 100

    These are redistributed via route maps

    1 for static where the tag100 sets a local preference and also also sets up
    a comunity string of sorts. If no tag exists just the comunity string is
    changed.

    2) for connected so that the DMZ LAN addresses are redistributed again
    changing the comunity string.

    So you can see I am still at a loss as to why the differing approaches
    (except the tag, I'm happy with that.).

    For the observant out there the return traffic from the Internet does
    actually only use the one main router as the /24 addresses are actually 2 x
    /25 addresses on the main and 1 x /24 on the standby, but apart from that
    and the local preference used for tagged routes all things are equal.

    Any further ideas, none of my colleagues know. I was given a file for
    standard configurations but this is only any use if you know what you wan't
    to achieve and not the reverse which is what I need..

    Thanks

    Toby
     
    Toby, Dec 26, 2004
    #7
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.