Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

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 planning to use a RHEL5 installed computer as a internet connection sharing device.

I have installed 2 LAN cards, eth0 and eth1.

eth0: Internet
eth1: LAN

eth0 configuration as follows ;

Ipaddress :
Subnet :
Gateway :

eth1 configuration:

ipaddress :
subnet :
gateway :

I wrote the following entries in /etc/resolv.conf:

(preferred DNS Server)
(secondary DNS server)

I am confused about which gateway I should use in the above scenario. I am unable to ping to my LAN and am also unable to connect to the Internet. How can I configure this server as my gateway?

share|improve this question

with regards to routing, you want to have a default gateway (in /etc/sysconfig/network) set to your internet gateway.

then create a gateway rule to your local lan (not sure what the topology is so i'd all of them below) on the interface facing the local networks. create a file /etc/sysconfig/network-scripts/route-eth1 with the following: via via

and then tell it to act as a router:

echo '1' > /proc/sys/net/ipv4/ip_forward

(obviously set that in /etc/sysctl.conf so it's permanent between reboots).

Hopefully I haven't forgotten anything... :)

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.