Default gateway for isolated network

What should the default gateway setting be set to for a simple network of 2 computers and one switch? Basically when there is no gateway (ie. no router, no internet, and no other connections into the switch).

Should it be set to:

  • 0.0.0.0
  • IP address of computer ON network.
  • IP address of computer NOT on network.
  • Something else.

Other notes:

  1. Some applications require 'something' entered. So gateway cannot just be 'blank' or ingored.
  2. Does the particular gateway address used affect the PING time performance between these two machines? (ie. more/less traffic).

You don't have to have a default gateway. If no router exists on your network, you want to NOT specify one.

In the Windows configuration for a network adapter you can leave the default gateway blank.

Linux has no problem if you want to delete the default route, or not specify one.

The default gateway address will only come into play if a system is trying to reach a subnet that's not currently on any network adapter. So if your network adapter is set to 192.168.15.1/255.255.255.0, and you send traffic to 192.168.15.5/255.255.255.0, the default gateway never comes into play. It would only possibly use it you tried to send traffic to something like 192.168.16.1 or something not in that subnet.


What should happen is if a process attempts to send traffic to a network access, and there is no route to it, then it should receive a "No route to host" error. If you don't specify a default gateway at all, it shouldn't even try to send traffic to any IP that's not in the subnet of your network adapter.

If you specify any other IP (including 127.0.0.1), it's going to try to send traffic to that IP if the destination IP is not in the same subnet as your network adapter (and no other interface matches the subnet). Nothing will respond, and the connection will time out. Waiting for the timeout will consume more time than simply not specifying a default gateway and letting the Windows TCP/IP software issue an error to the process trying to make a connection.


Generally speaking, you don't need a default gateway, however, since you seem to "need" it for certain applications, we can provide a "dummy" gateway.

By convention, I usually reserve the IPv4 address ending in ".1" as my gateway. So, let's assume your Computer "A" is 192.168.1.2, and "B" is 192.168.1.3. You can supply 192.168.1.1 as the default gateway. Traffic between the two systems won't be affected because the default gateway only comes into play if you try to reach a computer that's on another network. If that happens in this case, you'll get something like "Gateway failed to respond" as an error.

I'd be interested to know what applications you have that require a default gateway. As @ultrasawblade points out, Windows itself is perfectly happy if you leave the default gateway blank.