1

I have a server with 2 ethernet ports, use one port (eth0) for the private LAN, and a public IP from ISP is on second port (eth1).

I have it working, but I'd like to know the reason why I have to remove the gateway from the private network in order for both private LAN and public network to both work.

Thanks for your help.

3

Typically there can only be at most one default gateway.

A default gateway is a generic route which is used for any IP address not specified elsewhere. As a route it has a form of 0.0.0.0/0.0.0.0.

You have defined the IP address range of your LAN, and for the rest of the Internet you should take the default gateway.

If you define another default gateway on a LAN you are sending Internet packets to a no-exit alley, instead of routing them through the motorway.

Another consideration: If you only have a simple LAN with no Internet access you don't even need a default gateway.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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