default gateway command

Unanswered Question
May 13th, 2008
User Badges:

Hi

I am just trying to learn about cisco routers and i came across th ip default-gateway command used at the global configuration mode

What is that command used for

I know on pcs we set the default gateway address for the router

please inform me

  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 4.7 (3 ratings)
Loading.
bvsnarayana03 Tue, 05/13/2008 - 23:11
User Badges:
  • Silver, 250 points or more

Its very much similar to the default-gateway on pc. Infact this command is used on network devices which doesnt support routing or if routing is disabled. Mostly L2 switches have this command pointing to the router which wil then route the traffic to required destinations.

mahesh18 Sun, 05/18/2008 - 13:45
User Badges:

hi

i have switch 3560

when i do sh ip route it shows

sh ip route

Default gateway is 182.22.77.254


Host Gateway Last Use Total Uses Interface

ICMP redirect cache is empty


but this is layer 3 switch??????????


Jon Marshall Sun, 05/18/2008 - 13:48
User Badges:
  • Super Blue, 32500 points or more
  • Hall of Fame,

    Founding Member

  • Cisco Designated VIP,

    2017 LAN, WAN

Mahesh


You need to enable "ip routing" on the switch. See other thread.


If you do not enable ip routing then the 3560 will just be a L2 switch and it will need a default-gateway.


If you enable ip routing then it can now be a L3 switch and you would replace your default-gateway with a default route.


Jon

mahesh18 Sun, 05/18/2008 - 13:51
User Badges:

hi jon

so on thAT 3560 SWITCH i have no ip routing

configured thats why i had default gateway

right?

Jon Marshall Sun, 05/18/2008 - 13:52
User Badges:
  • Super Blue, 32500 points or more
  • Hall of Fame,

    Founding Member

  • Cisco Designated VIP,

    2017 LAN, WAN

Mahesh


It sounds like it.


Jon

joseph.derrick Wed, 05/28/2008 - 21:32
User Badges:


Hi Mamesh,


The command "ip default-gateway" is used if routing is disabled on a device. For example, this is used for managing the device remotely. Since it has a default-gateway just like computers, this simply mean that it can communicate in the network.


On the other hand, if routing is enable, you don't need the command "ip default-gateway". You can use the command "ip route x.x.x.x y.y.y.y" instead to let your device communicate with other devices on the network.


Thanks,


Deejay

Actions

This Discussion