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 192.168.1.1 mask 255.255.255.0

big thx guys.
jusbugAsked:
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:
Hi,

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


0
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)
0
jusbugAuthor Commented:
i reset every thing to start fresh except ip forwarding is enabled


ifconfig:

eth0      Link encap:Ethernet  HWaddr 00:0C:29:DA:79:54  
          inet addr:192.168.1.128  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::20c:29ff:feda:7954/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          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:192.168.1.129  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::20c:29ff:feda:795e/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          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:127.0.0.1  Mask:255.0.0.0
          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
192.168.1.0     0.0.0.0         255.255.255.0   U         0 0          0 eth0
192.168.1.0     0.0.0.0         255.255.255.0   U         0 0          0 eth1
169.254.0.0     0.0.0.0         255.255.0.0     U         0 0          0 eth1
0.0.0.0         192.168.1.1     0.0.0.0         UG        0 0          0 eth0

0
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 192.168.1.1 ? If not it might mean that you have connectivity issues)

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

0
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
0
jusbugAuthor Commented:
btw i cant ping 192.168.1.1
0
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 192.168.2.0/24 packages.

Siemens
NAT
route add 192.168.2.0/24 192.168.128

The layout should be

                                  192.168.2.1/24 eth1 >
Siemens ---------------------   RHEL -------------------- Switch------- intranet PC's    
192.168.1.1            < 192.168.1.128/24 eth0                                  192.168.2.2-254/24
                                                                                                        DG 192.168.2.1
                                                                                                        DNS 192.168.1.1

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 192.168.1.1 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.

Cheers,
K
0

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:
OOps

route add 192.168.2.0/24 192.168.128

should read

route add 192.168.2.0/24 192.168.1.128
0
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.
0
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.