LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Eth0 and Eth1 config (https://www.linuxquestions.org/questions/linux-networking-3/eth0-and-eth1-config-311161/)

Bwongar 04-08-2005 01:55 PM

Eth0 and Eth1 config
 
First of all, thanks for even looking. This isn't so much of a problem as a request for confirmation.

The idea is that this 'intranet' box will be accessible internally as well as externally. The in-house DNS server points the URL to 192.168.0.24, but externally the DNS record is an external IP. As you can see this shortcuts directly to the box if you are in-house - seemingly a standard practice.

However, I had a slight problem with my setup. I have not setup more than one interface before so it was all trial and error. My first attempt worked breifly, till I realized that I could not resolve externally:
/etc/network/interfaces
Code:

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth1
iface eth1 inet static
  address *my-ip-here*
  netmask 255.255.255.240
  gateway *my-gateway-here*

auto eth0
iface eth0 inet static
  address 192.168.0.24
  netmask 255.255.255.0
  gateway 192.168.0.1

So I thought, "It has two gateways... maybe it's getting confused." I took out the second gateway (192.168.0.1) and it works! I can resolve externally and internally.

My question: Is this the proper way to have this set up? Thank you.

david_ross 04-09-2005 08:18 AM

Yes that is correct.

By definition you can really only have one "default". Default in this case really means "if all else fails" - ie no other specific route could be matched.


All times are GMT -5. The time now is 01:03 AM.