ip default-gateway on both ends

DowimaDowima Inactive Imported Users Posts: 40 ■■□□□□□□□□
hi all ...... how is bit here :)


Guys i have the following :

[ -- R1 -- ] (.1)
(10.10.12.0/24)
(.2) [ -- R2 -- ]
on R2 there is also 2 loopback addr 10.10.10.10/32 and 20.20.20.20. routers can ping directly connected interfaces.


Now If there is no routing protocols running at both ends. At R1 i configured ip default-gateway 10.10.12.2.
When i ping loopbacks at R2 fails!!! also the gateway of last resort is not set <<--- when checking show ip route

I removed ip default-gateway and replaced it with ip default-network 10.10.12.2.
ping 10.10.10.10 it success but to 20.20.20.20 is not. also gateway of last resort still not set but there is a new route in routing table
Gateway of last resort is not set

10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
S 10.0.0.0/8 [1/0] via 10.10.12.2
C 10.10.12.0/24 is directly connected, Serial0/0

when i use ip route 0.0.0.0 0.0.0.0 10.10.12.2 ..... everything works perfectly.

I think when there is no routing we preferably use ip default-gateway. but on real scenario didn't work at least with me ?
CCIE ,
I'll get you .

Comments

  • DowimaDowima Inactive Imported Users Posts: 40 ■■□□□□□□□□
    also if i configured on both ends a defult gateway point to the other. Will i get a loop ????
    CCIE ,
    I'll get you .
  • networker050184networker050184 Mod Posts: 11,962 Mod
    You have to tell the router how to get to the other network. You can use static routes or use a dynamic routing protocol, but the routers will not "find" remote networks on their own. If you are using static routes you need one on both routers or the traffic will not know how to get back to the source when you ping.
    An expert is a man who has made all the mistakes which can be made.
  • dtlokeedtlokee Member Posts: 2,378 ■■■■□□□□□□
    Dowima wrote:
    hi all ...... how is bit here :)


    Guys i have the following :

    [ -- R1 -- ] (.1)
    (10.10.12.0/24)
    (.2) [ -- R2 -- ]
    on R2 there is also 2 loopback addr 10.10.10.10/32 and 20.20.20.20. routers can ping directly connected interfaces.


    Now If there is no routing protocols running at both ends. At R1 i configured ip default-gateway 10.10.12.2.
    When i ping loopbacks at R2 fails!!! also the gateway of last resort is not set <<--- when checking show ip route

    I removed ip default-gateway and replaced it with ip default-network 10.10.12.2.
    ping 10.10.10.10 it success but to 20.20.20.20 is not. also gateway of last resort still not set but there is a new route in routing table
    Gateway of last resort is not set

    10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
    S 10.0.0.0/8 [1/0] via 10.10.12.2
    C 10.10.12.0/24 is directly connected, Serial0/0

    when i use ip route 0.0.0.0 0.0.0.0 10.10.12.2 ..... everything works perfectly.

    I think when there is no routing we preferably use ip default-gateway. but on real scenario didn't work at least with me ?

    There was a time long, long ago where routers didn't alway route IP, and this was the case for the "ip default-gateway" command. If you have IP routing enabled (ip routing) then use a default route (static or originate it thorough the routing protocol), but if you disable ip routing (no ip routing) then use the "ip default-gateway" command. If you disable IP routing the router will now act as an IP host much like a 2950 switch does.

    Also you should not create default routes between two routers using the other as the next hop. This will lead to a routing loop for anything destination subnets that are not in the routing table.
    The only easy day was yesterday!
  • bighornsheepbighornsheep Member Posts: 1,506
    To complement what others have said, this article may be helpful:

    http://www.cisco.com/warp/public/105/default.html
    dtlokee wrote:
    Also you should not create default routes between two routers using the other as the next hop. This will lead to a routing loop for anything destination subnets that are not in the routing table.

    It seems like in certain cases (depending on routing protocol), you want to use ip default-network, for other cases, you want to use ip route 0.0.0.0 0.0.0.0 Whereas ip default-gateway should only be used with switches unless if you are not routing on the router.

    Cheers.
    Jack of all trades, master of none
  • dtlokeedtlokee Member Posts: 2,378 ■■■■□□□□□□
    To complement what others have said, this article may be helpful:

    http://www.cisco.com/warp/public/105/default.html
    dtlokee wrote:
    Also you should not create default routes between two routers using the other as the next hop. This will lead to a routing loop for anything destination subnets that are not in the routing table.

    It seems like in certain cases (depending on routing protocol), you want to use ip default-network, for other cases, you want to use ip route 0.0.0.0 0.0.0.0 Whereas ip default-gateway should only be used with switches unless if you are not routing on the router.

    Cheers.

    The OP asked about "ip default-gateway" which can be used on a router as long as ip routing is turned off. This is not going to be the case 99.9% of the time, so typically only used on L2 switches. L3 switches with ip routing enables will not use th ip default-gateway command, but rely on a default route (static or dynamic)

    As for the "ip default-network" command, it can be used to originate a default route into IGRP (depricated) and EIGRP, but only if there is a matching route in the ip routing table using an exit interface (AD of 0). Other routing protocols (RIP, OSPF) use the "default-information originate" command to create a default route.
    The only easy day was yesterday!
  • DowimaDowima Inactive Imported Users Posts: 40 ■■□□□□□□□□
    Thanks alot ppl :)

    summary to enabe ip default-gateway :

    no ip routing
    ip default-gateway x.x.x.x

    You can debug for more info with
    debug ip ICMP

    Thanks again for all the above !!!

    :)
    CCIE ,
    I'll get you .
  • networker050184networker050184 Mod Posts: 11,962 Mod
    I wouldn't use the no ip routing. Like dt said you will be routing ip 99.9999999%.
    An expert is a man who has made all the mistakes which can be made.
  • pabloCr84pabloCr84 Member Posts: 13 ■□□□□□□□□□
    Last guy is right. You should not disable ip routing. ip default-gateway is mostly use to load up an IOS image from ROMmon mode so that way you can specify the default-gateway as the ip for the tftp server.
    I would rather use ip default-network without using no ip-routing.
Sign In or Register to comment.