default gateway command

Unanswered Question
May 13th, 2008


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

I have this problem too.
0 votes
  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 4.7 (3 ratings)
bvsnarayana03 Tue, 05/13/2008 - 23:11

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


i have switch 3560

when i do sh ip route it shows

sh ip route

Default gateway is

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


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.


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

hi jon

so on thAT 3560 SWITCH i have no ip routing

configured thats why i had default gateway


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

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.




This Discussion