Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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 : 115.252.64.187
Subnet :   255.255.255.240
Gateway : 115.252.64.177

eth1 configuration:

ipaddress : 192.168.1.1
subnet : 255.255.255.0
gateway : 192.168.1.1

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

nameserver 202.138.96.2
(preferred DNS Server)
nameserver 202.138.103.2
(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

1 Answer 1

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:

10.0.0.0/8 via 192.168.1.1
192.168.0.0/16 via 192.168.1.1

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

 
discard

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.