Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 05-08-2011, 03:20 PM   #1
LQ Newbie
Registered: May 2011
Posts: 2

Rep: Reputation: 0
Angry NAT Config on Centos

I have two network interface eth0 and eth1

eth0 is on 192.168.0/24 network connected to the internet eth1 is on 10.10.10/24 network and DHCP for this network the clients connected to this interface can not connect to the internet but they can ping which is the eth0 ip but can not ping cisco router or anything else on 192.168.0/24 I have tried few tricks
but still not working

1) iptables -t nat -A POSTROUTING -s -o eth0 \
-j SNAT --to

it did not work

2) iptables -t nat -A POSTROUTING -o eth1 -j SNAT --to
did not work as well

I real need help on this thanks in advance

Last edited by kiwembe; 05-08-2011 at 04:18 PM.
Old 05-09-2011, 04:37 PM   #2
Registered: Oct 2003
Location: UnitedKingdom
Distribution: Debian Lenny
Posts: 351

Rep: Reputation: 47
cat /proc/sys/net/ipv4/ip_forward ?

iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
Old 05-18-2011, 09:55 AM   #3
LQ Newbie
Registered: May 2011
Posts: 2

Original Poster
Rep: Reputation: 0
Thanks for the reply but still no luck

cat /proc/sys/net/ipv4/ip_forward

ip address show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet scope host lo
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast qlen 1000
link/ether 00:0c:29:14:b8:10 brd ff:ff:ff:ff:ff:ff
inet brd scope global eth0
inet6 fe80::20c:29ff:fe14:b810/64 scope link
valid_lft forever preferred_lft forever
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast qlen 1000
link/ether 00:0c:29:14:b8:1a brd ff:ff:ff:ff:ff:ff
inet brd scope global eth1
inet6 fe80::20c:29ff:fe14:b81a/64 scope link
valid_lft forever preferred_lft forever
4: sit0: <NOARP> mtu 1480 qdisc noop
link/sit brd
ping -I eth0
PING ( from eth0: 56(84) bytes of data.
64 bytes from icmp_seq=1 ttl=244 time=385 ms
64 bytes from icmp_seq=2 ttl=244 time=281 ms

ping -I eth1
PING ( from eth1: 56(84) bytes of data.

--- ping statistics ---
2 packets transmitted, 0 received, 100% packet loss, time 1445ms

I'm using vmware when I eneble NAT on eth0 and DHCP on eth1 everything works

but when I enable Bridge mode on eth0 and DHCP on eth1 that's when things stop working



Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Can I use NAT and some local hosts without NAT on linux box? tkmbe Linux - Networking 1 08-12-2010 03:38 PM
I configure NAT and use "services ..." to save it but when I reboot there is no nat bruack Linux - Software 4 09-01-2004 03:38 AM
Susefirewall2 Nat Problem / nat 1:1 trubi Linux - Distributions 0 07-20-2004 06:50 AM
Config Nat traversal on Mandrake 9.2 superfreeswan why1957 Mandriva 0 02-17-2004 12:08 AM
What's the difference between Linux-NAT and Sygate-NAT? yuzuohong Linux - Networking 0 08-07-2002 05:07 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:42 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration