08-20-2010 08:44 AM - last edited on 01-03-2023 02:34 AM by Translator
I am looking for some clarification as I keep second guessing myself.
Do these two commands do the same thing?
the IP Address for the interface
gi0/0 is 10.60.1.225
ip route 0.0.0.0 0.0.0.0 gi0/0
ip default-gateway 10.60.1.225
Now if they are not the same what is the difference?
If they are the same would there be any reason to have them both in the config at the same time?
Now which of these two command are a better practice? and why? and for the one that is not best practice why is it not?
ip route 0.0.0.0 0.0.0.0 10.60.1.225
or
ip route 0.0.0.0 0.0.0.0 gi0/0
I looked up these commands on the command lookup tool and it helped but I am looking for a little more real world detail.
Thanks,
Mike
Solved! Go to Solution.
08-20-2010 08:49 AM - last edited on 01-03-2023 02:37 AM by Translator
Hi Mike,
ip default-gateway
is used when the device doesn't support L3 routing. ip route is used to configure static route for the devices support L3 routing.
ip route 0.0.0.0 0.0.0.0 10.60.1.225
follows the best practice. If you use interface as the next-hop, the devices will send out ARP all unknown destination, which will decrease the device performance.
HTH,
Lei Tian
08-20-2010 08:51 AM - last edited on 01-03-2023 02:40 AM by Translator
There is a difference between these two commands :-
ip route 0.0.0.0 0.0.0.0 10.2.x.x -->
this will forward packets to the next hop with ip address 10.2.x.x ( L 3 at osi ).
where as
ip route 0.0.0.0 0.0.0.0 g0/1 -->
this will assume that all other destination are directly connected to me via interface g0/1 and will look for an ARP for every destination at comes in 0.0.0.0 0.0.0.0 , now for it to work the upstream device needs to give its proxy arp for every destination and then route the packet itself.
it is better to use
ip route 0.0.0.0 0.0.0.0 10.2.x.x
as this will not collect a lot of arp entries on the device compared to other option.
Please comment if there is a better explanation for this.
thanks
manish
08-20-2010 09:05 AM - last edited on 01-03-2023 02:45 AM by Translator
Hi Mike,
Thanks for the rateing.
No, there is no need to have both configured.
default-gateway
should only be used when
ip routoing
is disabled.
HTH,
Lei Tian
08-20-2010 09:11 AM - last edited on 01-03-2023 02:48 AM by Translator
I've had them configured both at the time back in the days while upgrading 2500s over a slow speed link.
If you lost the connection while upgrading the IOS, the 2500 would boot with a skinny IOS and this IOS did not support routing but it supported the
default gateway
command so I can get back onto the devices.
With today's routers, it makes no sense to have both.
However, you can choose to use
ip default gateway
on L3 devices if you decide to turn off routing on such device.
Many companies turn off routing on devices that don't need it as a security approach.
Regards,
Edison
08-20-2010 10:12 AM
Hi Mike,
In addition to all the great posts here, let me add a link to a perfect Cisco document that is very relevant to the discussion here:
http://www.cisco.com/en/US/tech/tk365/technologies_tech_note09186a0080094374.shtml
Best regards,
Peter
08-20-2010 08:49 AM - last edited on 01-03-2023 02:37 AM by Translator
Hi Mike,
ip default-gateway
is used when the device doesn't support L3 routing. ip route is used to configure static route for the devices support L3 routing.
ip route 0.0.0.0 0.0.0.0 10.60.1.225
follows the best practice. If you use interface as the next-hop, the devices will send out ARP all unknown destination, which will decrease the device performance.
HTH,
Lei Tian
08-20-2010 08:51 AM - last edited on 01-03-2023 02:40 AM by Translator
There is a difference between these two commands :-
ip route 0.0.0.0 0.0.0.0 10.2.x.x -->
this will forward packets to the next hop with ip address 10.2.x.x ( L 3 at osi ).
where as
ip route 0.0.0.0 0.0.0.0 g0/1 -->
this will assume that all other destination are directly connected to me via interface g0/1 and will look for an ARP for every destination at comes in 0.0.0.0 0.0.0.0 , now for it to work the upstream device needs to give its proxy arp for every destination and then route the packet itself.
it is better to use
ip route 0.0.0.0 0.0.0.0 10.2.x.x
as this will not collect a lot of arp entries on the device compared to other option.
Please comment if there is a better explanation for this.
thanks
manish
08-20-2010 08:59 AM
Thanks for the help.
Would there be any reason to have them both in the config at once?
Mike
08-20-2010 09:05 AM - last edited on 01-03-2023 02:45 AM by Translator
Hi Mike,
Thanks for the rateing.
No, there is no need to have both configured.
default-gateway
should only be used when
ip routoing
is disabled.
HTH,
Lei Tian
08-20-2010 09:11 AM - last edited on 01-03-2023 02:48 AM by Translator
I've had them configured both at the time back in the days while upgrading 2500s over a slow speed link.
If you lost the connection while upgrading the IOS, the 2500 would boot with a skinny IOS and this IOS did not support routing but it supported the
default gateway
command so I can get back onto the devices.
With today's routers, it makes no sense to have both.
However, you can choose to use
ip default gateway
on L3 devices if you decide to turn off routing on such device.
Many companies turn off routing on devices that don't need it as a security approach.
Regards,
Edison
08-20-2010 09:21 AM - last edited on 01-03-2023 02:52 AM by Translator
Thank everyone now let me explain it back and you let me know where I go wrong.
IP default-gateway
is used when L3 routing is not on.
IP route 0.0.0.0 0.0.0.0 gi0/0
is bad because the router will send an ARP request for everything that gets sent to 0.0.0.0 which causes a lot of processing and it will result in a large ARP table
Having both configured helped with older equipment but is not really need now but it will not hurt if both are configured.
Do I have it correct?
Thanks for all your posts.
Mike
08-20-2010 09:48 AM
Yes, your understanding is correct.
08-20-2010 10:12 AM
Hi Mike,
In addition to all the great posts here, let me add a link to a perfect Cisco document that is very relevant to the discussion here:
http://www.cisco.com/en/US/tech/tk365/technologies_tech_note09186a0080094374.shtml
Best regards,
Peter
08-20-2010 10:16 AM
Peter...and all, Thanks for your help I think I have it cemented in my thick head now.....
Peter that was a perfect doc...thanks.
Mike
08-24-2010 02:11 AM
Informative post by Edson and letian
. Thanks
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