LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
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 08-26-2008, 06:21 PM   #1
mikanoot
LQ Newbie
 
Registered: Aug 2008
Posts: 4

Rep: Reputation: 0
NAT Troubleshooting


How could I troubleshoot my NAT setup. I have 2 computers.


comp1: 192.168.0.3 (eth1) and dhcp for (eth0)
comp2: 192.168.0.1 (eth0)

I have enabled ip_forwarding and my firewall is as follows.
Code:
iptables -P INPUT DROP
iptables -P FORWARD ACCEPT

iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT

iptables -A INPUT -s 127.0.0.0/8 -d 127.0.0.0/8 -i lo -j ACCEPT
iptables -A INPUT -p tcp --dport 80 -i eth1 -j ACCEPT
iptables -A INPUT -p icmp -j ACCEPT

iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
iptables -A FORWARD -i eth0 -o eth1 -m state --state RELATED,ESTABLISHED -j ACCE
PT
iptables -A FORWARD -i eth1 -o eth0 -j ACCEPT
I stll can not connect from the second computer. I can access my apache webserver from the second computer, but not the internet.
What steps can I take to troubleshoot this if anyone knows.
 
Old 08-26-2008, 06:31 PM   #2
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
This weblog page may help.
http://linuxadministration.wordpress...-masquerading/

Make sure to pay attention to which kernel modules you need loaded. For example, you may need nf_conntrack loaded.
Make sure that ip_forward is enabled. Check that the gateway and resolv.conf values on the second computer are correct.

I noticed a few months back the some of the kernel modules have new names. On the most recent kernels the modules probably begin with nf_.
 
  


Reply



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
Difference between NAT and NO NAT plisken Linux - Networking 1 01-10-2008 11:53 AM
troubleshooting how-to? chilehead Linux - Hardware 2 02-06-2005 04:58 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 02:38 AM
Susefirewall2 Nat Problem / nat 1:1 trubi Linux - Distributions 0 07-20-2004 05:50 AM
What's the difference between Linux-NAT and Sygate-NAT? yuzuohong Linux - Networking 0 08-07-2002 04:07 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:23 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
Open Source Consulting | Domain Registration