0

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.

wfaulk
  • 6,878
  • 7
  • 46
  • 75
  • 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 09 '12 at 20:15

2 Answers2

5

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.

EEAA
  • 109,363
  • 18
  • 175
  • 245
0

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 192.168.1.0/24 for example, then any address 192.168.1.1 to 192.168.1.254 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.

Julian
  • 121
  • 5