rhel gateway, dhcp and NAT

sorry if you find the question boring but i read countless web pages and even here i didn't find a clear answer, i tried many tutorials but still cant even ping clients from server and vice versa.
my question is how to setup a gateway, dhcp and nat server

my system is rhel 5.1 server installed on vmware esxi with 2 physical nic, eth0 for internet and eth1 for internal network
internet connected to siemens router then connected to eth0 nic and then from eth1 to netear switch...
ip of the router is mask

big thx guys.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Kerem ERSOYPresidentCommented:

will you post the output of your ifconfig  and netstat -rn here ?

Kerem ERSOYPresidentCommented:
First of all since this is a gateway you need to enable routing through interfaces with this command:

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

Tm make it permanent add this line to your /etc/sysconfig/network or modify if it exists::

FORWARD_IPV4=true   (it is false by default)
jusbugAuthor Commented:
i reset every thing to start fresh except ip forwarding is enabled


eth0      Link encap:Ethernet  HWaddr 00:0C:29:DA:79:54  
          inet addr:  Bcast:  Mask:
          inet6 addr: fe80::20c:29ff:feda:7954/64 Scope:Link
          RX packets:86 errors:0 dropped:0 overruns:0 frame:0
          TX packets:62 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:10728 (10.4 KiB)  TX bytes:9339 (9.1 KiB)
          Interrupt:59 Base address:0x2024

eth1      Link encap:Ethernet  HWaddr 00:0C:29:DA:79:5E  
          inet addr:  Bcast:  Mask:
          inet6 addr: fe80::20c:29ff:feda:795e/64 Scope:Link
          RX packets:70 errors:0 dropped:0 overruns:0 frame:0
          TX packets:59 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:9789 (9.5 KiB)  TX bytes:9174 (8.9 KiB)
          Interrupt:67 Base address:0x20a4

lo        Link encap:Local Loopback  
          inet addr:  Mask:
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:1962 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1962 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:4073968 (3.8 MiB)  TX bytes:4073968 (3.8 MiB)

netstat -rn:

Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface   U         0 0          0 eth0   U         0 0          0 eth1     U         0 0          0 eth1         UG        0 0          0 eth0

CompTIA Network+

Prepare for the CompTIA Network+ exam by learning how to troubleshoot, configure, and manage both wired and wireless networks.

Kerem ERSOYPresidentCommented:
Ok can you ping the ? If not it might mean that you have connectivity issues)

Your eth1 settings are incorrect !! Both eth0 and eth1 at the same subnet.  ( You need to change eth1 to some different subnet such as In the current configuration it is not possible to route packets between interface since both are at the same subnet.

jusbugAuthor Commented:
i think i got the picture (hopefully)

because both nic were in the same subnet what ever i tried doesn't work, i will do everything over again i'll let you know

big big thanks m8
jusbugAuthor Commented:
btw i cant ping
Kerem ERSOYPresidentCommented:
You're welcome

I guess your siemens does to Intrnatet-to-public address mapping. So you wont need to do NAT at the RHEL gateway. But you need to add extra routing info to Siemens in theis case such as it will know how to toure packages.

route add 192.168.128

The layout should be

                         eth1 >
Siemens ---------------------   RHEL -------------------- Switch------- intranet PC's            < eth0                        

If you want you can run DNS over rhel and assign them addresses too. But if you ned to run DHCP over the RHEL don't forget to bind DHCP only to eth1 and not eth0. Also since all addresses at 192.168.1.x segment are assigned manually yo can safely disable the DHCP server over the Siemens.

If you can't ping try to switch ethernet ports may be you've cabled in eth1 to eth0 and vice versa. If you still can not ping then check your VMWare settings.


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Kerem ERSOYPresidentCommented:

route add 192.168.128

should read

route add
jusbugAuthor Commented:
i find out that the probleme was with vmware, but still not only i learned from the answers but it helped me to figure out where the probleme was.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux Distributions

From novice to tech pro — start learning today.