LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 01-26-2005, 07:29 PM   #1
Baco
LQ Newbie
 
Registered: May 2004
Location: Portugal
Distribution: Gentoo
Posts: 21

Rep: Reputation: 15
NAT problem


I have a machine running linux and another one running windows (2003 server), at 1st it was the windows machine that was directly connected to the internet and it was doing the NAT, tho I decided to change this and I had to configure the linux to do NAT.
Almost everything seems to work fine tho with torrents for exemple I can't get remote connections. I do upload tho something is not working properly.

This was the rules I had made:
Code:
#modprobe ipt_MASQERADE;
#iptables -F; iptables -t nat -F; iptables -t mangle -F;
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE;
echo 1 > /proc/sys/net/ipv4/ip_forward;
#iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT;
#iptables -A INPUT -m state --state NEW -i ! eth0 -j ACCEPT;
#iptables -P INPUT DROP;
The lines with a # have been entered only once the others have to be entered once per reboot.

If any1 could help would be nice.

Soz about my english

[EDIT]
I found out that the 1st line aint working:
Code:
FATAL: Module ipt_MASQERADE not found.
another piece of info that might help:
Code:
# iptables -t nat -L
Chain PREROUTING (policy ACCEPT)
target     prot opt source               destination         

Chain POSTROUTING (policy ACCEPT)
target     prot opt source               destination         
MASQUERADE  all  --  anywhere             anywhere            

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination
Don't know if this is why tho imo the problem are the packages that are not being modified as they should...but tbh I have no ideia how to do it.
[/EDIT]

Last edited by Baco; 01-26-2005 at 07:48 PM.
 
Old 01-26-2005, 07:47 PM   #2
Chowroc
Member
 
Registered: Dec 2004
Posts: 145

Rep: Reputation: 15
not ipt_MASQERADE but ipt_MASQUERADE

I think modules: ip_conntrack and ip_conntrack_ftp is needed for "-m state --state"
 
Old 01-26-2005, 07:48 PM   #3
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,699

Rep: Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895
Is this a spelling error or the exact command?
modprobe ipt_MASQERADE
If so then it should be
modprobe ipt_MASQuERADE

I see in the iptables rule it is spelled correctly.

The /proc is a virtual file system that only exists in RAM and is generated at boot time. You can edit the /etc/sysctl.conf file to automatically change the ip_forward to a 1 at boot.

Unless you save any new rules the old or default rules will be loaded at boot time. The following command will save your iptables rules.
service iptables save

Last edited by michaelk; 01-26-2005 at 07:49 PM.
 
Old 01-26-2005, 07:54 PM   #4
Baco
LQ Newbie
 
Registered: May 2004
Location: Portugal
Distribution: Gentoo
Posts: 21

Original Poster
Rep: Reputation: 15
ip_conntrack is installed ip_conntrack_ftp is not tho I don't get any msg about that.
anyway thx for the tip on the ipt_MASQUERADE tho it haven't changed much.

Last edited by Baco; 01-26-2005 at 07:57 PM.
 
Old 01-26-2005, 08:22 PM   #5
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,699

Rep: Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895
You probably need to add a rule to accept bittorrent.

iptables -I INPUT -p tcp --destination-port 6881:6889 -j ACCEPT

http://dessent.net/btfaq/

Do you have any problems with the windows machine accessing the internet?
 
Old 01-26-2005, 08:38 PM   #6
Baco
LQ Newbie
 
Registered: May 2004
Location: Portugal
Distribution: Gentoo
Posts: 21

Original Poster
Rep: Reputation: 15
Till now everything seems to work fine, but to be honest besides POP/SMTP acess and of course acess be web I haven't tried out much services.....I have played counter strike and I still have good pings
I'll had that and see if it works.

Btw thanks to all those who replyed
 
Old 01-26-2005, 08:55 PM   #7
Baco
LQ Newbie
 
Registered: May 2004
Location: Portugal
Distribution: Gentoo
Posts: 21

Original Poster
Rep: Reputation: 15
If u visit this page it will tell u ur IP address and ur external IP address in case u r using nat
http://www.u.arizona.edu/~trw/games/nat_or_not.php
I got this:
Code:
initializing... initializing... 
Your local IP address is  192.168.0.2
Your global IP address is 84.90.xx.xx ( u don't have to know it :p )
It would appear that your machine does use NAT.
Your machine has an IP address of 192.168.0.2,
but your browser connected to this page from 84.90.xx.xx!
You are in the private range: 192.168.0.0 - 192.168.255.255 (192.168/16 prefix)
 
Old 01-28-2005, 03:11 PM   #8
Baco
LQ Newbie
 
Registered: May 2004
Location: Portugal
Distribution: Gentoo
Posts: 21

Original Poster
Rep: Reputation: 15
I solved the problem!
Thx for all the help
 
  


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
NAT problem akmon Linux - Networking 1 11-10-2005 11:00 AM
Susefirewall2 Nat Problem / nat 1:1 trubi Linux - Distributions 0 07-20-2004 05:50 AM
NAT problem Obscure Linux - Networking 1 03-05-2004 07:06 AM
What's the difference between Linux-NAT and Sygate-NAT? yuzuohong Linux - Networking 0 08-07-2002 04:07 AM
RH 7.3 NAT problem guanyu Linux - Networking 13 07-02-2002 05:52 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 02:25 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