LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 07-07-2005, 08:26 AM   #1
80mail
LQ Newbie
 
Registered: Jul 2005
Posts: 19

Rep: Reputation: 0
Question How to modify fedora's NAT type?


My OS is fedora3. I use the OS to be a NAT Server. I find the NAT type is symmetric cone. How to modify its NAT type. I want a full cone. Thanks for any idea.


Following is my NAT¡¯s shell script:
Echo "1" > /proc/sys/net/ipv4/ip_forward
modprobe ip_tables
modprobe ip_nat_ftp
modprobe ip_nat_irc
modprobe ip_conntrack
modprobe ip_conntrack_ftp
modprobe ip_conntrack_irc
/sbin/iptables -F
/sbin/iptables -X
/sbin/iptables -Z
/sbin/iptables -F -t nat
/sbin/iptables -X -t nat
/sbin/iptables -Z -t nat
/sbin/iptables -P INPUT DROP
/sbin/iptables -P OUTPUT ACCEPT
/sbin/iptables -P FORWARD ACCEPT
/sbin/iptables -t nat -P PREROUTING ACCEPT
/sbin/iptables -t nat -P POSTROUTING ACCEPT
/sbin/iptables -t nat -P OUTPUT ACCEPT
/sbin/iptables -t nat -A POSTROUTING -o ppp0 -s 192.168.1.0/24 -j MASQUERADE
 
Old 07-07-2005, 08:39 AM   #2
fr_laz
Member
 
Registered: Jan 2005
Location: Cork Ireland
Distribution: Debian
Posts: 384

Rep: Reputation: 32
Hi,

what do you need exactly? If you want that every single host on your LAN has its own public IP, then stop using masquerading and use the following command instead:
iptables -t nat -A POSTROUTING -s $PRIVATE_IP_HOST1 -o ppp0 -j SNAT --to-source $PUBLIC_IP_HOST1

if you want to give access to your internal machines from outside your network, use this:
iptables -t nat -A PREROUTING -d $PUBLIC_IP -i ppp0 -j DNAT --to-dest $PRIVATE_IP

in both the command lines you can add -p tcp/udp options and --dport/sport so as to limit the way the translation is applied (that's policy nat)
you can also use the --to-dest $IP:$PORT so as to do some port redirection.

hope it answers your question!
 
Old 07-07-2005, 08:46 AM   #3
demian
Member
 
Registered: Apr 2001
Location: Bremen, Germany
Distribution: Debian
Posts: 303

Rep: Reputation: 30
netfilter does symmetric NAT. Nothing else. If you want full cone your only option if you want to keep using iptables is to manually set up a translation table with all your internal and external ip addresses.
 
Old 07-07-2005, 09:11 AM   #4
80mail
LQ Newbie
 
Registered: Jul 2005
Posts: 19

Original Poster
Rep: Reputation: 0
Thanks for the replies. I use some P2P communication softs in the LAN. So symmetric nat does not suit my application. Besides setting up a translation table, can I make a real Full cone or Partial/Restricted Cone instead of symmetric cone? thanks for any idea.
 
Old 09-06-2006, 10:28 AM   #5
sanbabba
LQ Newbie
 
Registered: Sep 2006
Posts: 1

Rep: Reputation: 0
Please send me the SYMMETRIC NAT configuration using netfilter

Quote:
Originally Posted by demian
netfilter does symmetric NAT. Nothing else. If you want full cone your only option if you want to keep using iptables is to manually set up a translation table with all your internal and external ip addresses.
Please send me the SYMMETRIC NAT configuration using netfilter
 
Old 11-21-2006, 10:35 AM   #6
Honor
LQ Newbie
 
Registered: Dec 2005
Posts: 15

Rep: Reputation: 0
I use WinSTUN tool to test my Linux NAT Type, but it shows "Port Restricted". What tool do you use to test NAT Type?
 
Old 05-19-2007, 01:22 AM   #7
UhhMaybe
Member
 
Registered: Jul 2004
Location: Salt Lake City, Utah
Distribution: Absolute 12.0 Studio 64 1.3.0
Posts: 470

Rep: Reputation: 30
Cool

http://linux-ip.net/html/nat-stateless.html try this for reading and/or tools and NAT output.This is for general discussion...http://en.wikipedia.org/wiki/Iptables It stongly directs to the advantages of "iptables". http://tldp.org/HOWTO/HOWTO-INDEX/howtos.html for more about iptables, NAT and tracking rules or tracking packets. Good luck.
 
  


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
Fedora's KDE very sluggish for me? DaveGallant Fedora 0 07-16-2004 11:41 AM
How to modify the library path variable?modify the Electronkz Linux - Newbie 1 04-13-2004 06:18 AM
Fedora's Firewall & FTP Moebius01 Fedora 8 03-30-2004 04:09 AM
how to modify a column type in postgrest Bheki Linux - General 3 03-01-2004 03:37 AM
modify file access & modify timestamps i2itstud Linux - General 1 05-20-2003 03:34 AM

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

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