Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
11-11-2005, 06:42 AM
|
#1
|
LQ Newbie
Registered: Jul 2001
Location: Aldershot, UK
Distribution: Fedora Core 4
Posts: 16
Rep:
|
Stupid question about NAT
Hi
I know this is a daft question, but I hope somebody can give me a direct answer.
I have a Fedora Core 4 box that I want to use as a LAN gateway/firewall. I have a cable connection with only a single IP, so I want to NAT all clients behind the single IP.
I have IPTables and understand that ok, but I cant find a straight answer to how I should setup masquerading... the netfilter wesite says do this
# Load the NAT module (this pulls in all the others).
modprobe iptable_nat
# In the NAT table (-t nat), Append a rule (-A) after routing
# (POSTROUTING) for all packets going out ppp0 (-o ppp0) which says to
# MASQUERADE the connection (-j MASQUERADE).
iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE
# Turn on IP forwarding
echo 1 > /proc/sys/net/ipv4/ip_forward
but when I add the iptables line nothing shows up when I "iptables --list" should I see the line there???
Should that work???
Thanks
|
|
|
11-11-2005, 09:14 AM
|
#2
|
Member
Registered: May 2005
Location: Greece
Posts: 441
Rep: 
|
Re: Stupid question about NAT
Quote:
Originally posted by Led*Zep
Hi
I know this is a daft question, but I hope somebody can give me a direct answer.
I have a Fedora Core 4 box that I want to use as a LAN gateway/firewall. I have a cable connection with only a single IP, so I want to NAT all clients behind the single IP.
I have IPTables and understand that ok, but I cant find a straight answer to how I should setup masquerading... the netfilter wesite says do this
# Load the NAT module (this pulls in all the others).
modprobe iptable_nat
# In the NAT table (-t nat), Append a rule (-A) after routing
# (POSTROUTING) for all packets going out ppp0 (-o ppp0) which says to
# MASQUERADE the connection (-j MASQUERADE).
iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE
# Turn on IP forwarding
echo 1 > /proc/sys/net/ipv4/ip_forward
but when I add the iptables line nothing shows up when I "iptables --list" should I see the line there???
Should that work???
Thanks
|
If you don't mention which table then iptables default to "filter" table
So your "iptables --list" is the same as "iptables -t filter --list"
You can see your rule by running "iptables -t nat --list" (you can put "-L" instead of "--list")
|
|
|
11-11-2005, 09:52 AM
|
#3
|
LQ Newbie
Registered: Jul 2001
Location: Aldershot, UK
Distribution: Fedora Core 4
Posts: 16
Original Poster
Rep:
|
Great ta
Yep, I can see it now...
Thanks very much...
|
|
|
All times are GMT -5. The time now is 09:37 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|