Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am wondering if a node on a subnet should have its default gateway set to the IP of the router or should it be the IP address of the switch?

In Packet Tracer, I am using the router's address as the default gateway as this is what I have been told. I am just wanting to make sure this is correct.

share|improve this question
The default gateway is what's going to allow the node to get outside of its own subnet. In this case, yes, it's the router's IP. I think what trips up a lot of people that are trying to learn this is the fact that most home routers have a built-in switch and so for a lot of people it's all the same thing which makes it hard to understand that a switch and router actually have two separate functions. – Safado May 9 '12 at 20:15
up vote 5 down vote accepted

Depends if you want that system to be able to communicate outside its subnet. If not, then it doesn't matter what you set the gateway to.

But yes, the default gateway should be set to the router's LAN interface, unless you have an L3 switch with proper routing set up, in which case the default gateway would likely be one of the SVIs on the switch.

With an L2 switch, connected systems don't need to know what the switch's IP is, as it's nearly always used merely for administration purposes.

share|improve this answer
Thanks, thought this was the case just wanted some confirmation. – Melevin Mandana May 9 '12 at 20:16

The default gateway has to be the address of a gateway on the subnet. A gateway is a router.

Its worth thinking about what the default gateway is for. A simple host (end system) doesn't want to think about routing so it differentiates between other systems on its own subnet and everything else. if the subnet is for example, then any address to will be sent locally and everything else will be sent to the default gateway. So the default gateway has to have an address 192.168.1.x and so does our host, or we get a paradox.

The terms "switch" and "router" have got a bit muddled because of L3 switching but gateways are a L3 (IP) thing and the gateway has to be a L3 intermediate system, I call that a router. The router might use L3 switching in its forwarding engine, and it might only have static routes, but its forwarding your packet depending on the packets destination IP address and that makes it a router to me.

If you also have a switch with an IP address, its probably just a managed L2 switch and the IP address is just for switch administation, monitoring, etc.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.