2

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?

Warner
  • 23,756
  • 2
  • 59
  • 69
Gopi Krishna
  • 39
  • 4
  • 8

1 Answers1

4

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... :)

rytis
  • 2,382
  • 1
  • 18
  • 13