Hot Downloads

Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC: diff between ip route,ip default-gateway

diff between ip route,ip default-gateway 12 years 8 months ago #10792

hi all,

Can any one explain what is the difference between ip route,
ip default-gateway,ip default-network commands.


tahnks :D

Please Log in to join the conversation.

Re: diff between ip route,ip default-gateway 12 years 8 months ago #10797

  • Chris
  • Chris's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 1447
  • Karma: 8
  • Thank you received: 13
Gangadar,

The 'ip default-gateway' command is used to enter your router's default gateway, just as you would do on your normal Windows machine. This command does not differ from your everyday 'gateway' used in all devices required to access hosts outside the local network.

On the other side, the 'ip route' command is available to help us create 'static' routes. In other words, we can tell the router which 'gateway' it must use in order to reach specific networks.

The 'ip route' command can also be used to define a default gateway using the following command:
ip route 0.0.0.0 0.0.0.0 <next hop ip address>

But the main use of this command is to provide routes to other networks which cannot be reached via the 'default gateway'.

I hope that helps clear things up for you.

Cheers,

Please Log in to join the conversation.

Chris Partsenidis.
Founder & Editor-in-Chief
www.Firewall.cx

Re: diff between ip route,ip default-gateway 12 years 8 months ago #10807

  • jwj
  • jwj's Avatar
  • Offline
  • Senior Member
  • Senior Member
  • Posts: 350
  • Thank you received: 0
Here's a couple of interesting things I learned too. One was a few months ago, trying to get a Catalyst 4500 to work with the ip default-gateway command. I configured the switch exactly as I thought it need to, but it would not connect to it's uplink. Finally, after a bit of reading, I found out that the default-gateway command only works on layer 3 switches and routers with the "no ip routing" command. Another thing is the default network command. I've never seen it used, so I decided to check Cisco's site for an explanation of it. Apparently it's (almost) the same thing as doing ip route 0.0.0.0 0.0.0.0 (next hop ip). Here's the difference:

If you use both the ip default-network and ip route 0.0.0.0 0.0.0.0 commands to configure candidate default networks, and the network used by the ip default-network command is known statically, the network defined with the ip default-network command takes precedence and is chosen for the gateway of last resort. Otherwise if the network used by the ip default-network command is derived by a routing protocol, the ip route 0.0.0.0 0.0.0.0 command, which has a lower administrative distance, takes precedence and is chosen for the gateway of last resort.


So in short, if you have ip routing enable, use either ip default-network or ip route 0.0.0.0 0.0.0.0. If you do not have ip routing enable or are working on a pure switch, use ip default-gateway. Interesting stuff.

Edit: Oh yeah, and another difference is how routing protocols treat either command. It's detailed in the below link.
Source: http://www.cisco.com/warp/public/105/default.html#ipnetwork

Please Log in to join the conversation.

-Jeremy-

Default Gateway 12 years 8 months ago #10816

Good information there jwj! Thanks.

Please Log in to join the conversation.

Re: diff between ip route,ip default-gateway 12 years 8 months ago #10826

thanks chris,JWJ............... :D

Please Log in to join the conversation.

Re: diff between ip route,ip default-gateway 7 years 3 months ago #36564

Thanka Man..............

Please Log in to join the conversation.

  • Page:
  • 1
Time to create page: 0.161 seconds

CCENT/CCNA

Cisco Routers

  • SSL WebVPN
  • Securing Routers
  • Policy Based Routing
  • Router on-a-Stick

VPN Security

  • Understand DMVPN
  • GRE/IPSec Configuration
  • Site-to-Site IPSec VPN
  • IPSec Modes

Cisco Help

  • VPN Client Windows 8
  • VPN Client Windows 7
  • CCP Display Problem
  • Cisco Support App.

Windows 2012

  • New Features
  • Licensing
  • Hyper-V / VDI
  • Install Hyper-V

Linux

  • File Permissions
  • Webmin
  • Groups - Users
  • Samba Setup