LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 05-08-2011, 03:20 PM   #1
kiwembe
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 192.168.0.4 which is the eth0 ip but can not ping 192.168.0.1 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 10.10.10.0/24 -o eth0 \
-j SNAT --to 192.168.0.4/24

it did not work

2) iptables -t nat -A POSTROUTING -o eth1 -j SNAT --to 192.168.0.4
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
bhaslinux
Member
 
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
kiwembe
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
1

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 127.0.0.1/8 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 192.168.1.85/24 brd 192.168.1.255 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 192.168.129.132/24 brd 192.168.129.255 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 0.0.0.0 brd 0.0.0.0
ping 4.2.2.2 -I eth0
PING 4.2.2.2 (4.2.2.2) from 192.168.1.85 eth0: 56(84) bytes of data.
64 bytes from 4.2.2.2: icmp_seq=1 ttl=244 time=385 ms
64 bytes from 4.2.2.2: icmp_seq=2 ttl=244 time=281 ms

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

--- 4.2.2.2 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

Thanks
 
  


Reply


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


All times are GMT -5. The time now is 12:38 AM.

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