Fedora Linux Support Community & Resources Center

Go Back   FedoraForum.org > Fedora 19/20 > Security and Privacy
FedoraForum Search

Forgot Password? Join Us!

Security and Privacy Sadly, malware, spyware, hackers and privacy threats abound in today's world. Let's be paranoid and secure our penguins, and slam the doors on privacy exploits.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 22nd February 2008, 09:50 AM
mattywix Offline
Registered User
 
Join Date: Dec 2007
Posts: 110
/etc/sysconfig/iptables how to set -t nat -A POSTROUTING ?

Hi
How can I add the following in /etc/sysconfig/iptables ? The format of the file doesnt seem to allow this...
/sbin/iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
echo "1"> /proc/sys/net/ipv4/ip_forward
__________________
Mattywix

"For once you have tasted flight you will walk the earth with your eyes turned skywards, for there you have been and there you will long to return." - Leonardo da Vinci speaks of his joy at experiencing Linux
Reply With Quote
  #2  
Old 23rd February 2008, 02:11 AM
nucleo Offline
Registered User
 
Join Date: Jan 2008
Posts: 101
Hi
Code:
service iptables save
saves the output of iptables-save to /etc/sysconfig/iptables
Quote:
net.ipv4.ip_forward = 1
in the file /etc/sysctl.conf enables forwarding
Reply With Quote
  #3  
Old 20th April 2012, 10:02 AM
joseCuervo Offline
Registered User
 
Join Date: Apr 2012
Location: Seoul, Korea
Posts: 1
linuxfirefox
Re: /etc/sysconfig/iptables how to set -t nat -A POSTROUTING ?

My laptop is on the LAN (with address of 192.168.0.2) and it can ping 192.168.0.1 but it cannot ping www.google.com
I want to use p1p1 (a.k.a. eth1) as 192.168.0.1 and route everything from 192.168.0.2 through eth0 to access internet but cannot figure out how to add simple NAT commands to iptables script ...

====================================

on Fedora release 16 (Verne)................ there is no "service iptables save" command (the original post is old from 2008)

Code:
[root@ezcorean sysconfig]# service iptables save
Redirecting to /bin/systemctl  save iptables.service
Unknown operation save
[root@ezcorean sysconfig]#
I have enabled

Code:
# Controls IP packet forwarding
net.ipv4.ip_forward = 1
in /etc/sysctl.conf

however, I still do not know how to add the rule
Code:
-t nat -A POSTROUTING -o eth0 -j MASQUERADE
to /etc/sysconfig/iptables

If I do so, /var/log/messages says:

"Line 13 seems to have a -t table option." and it fails to start iptables.

However, if I run
Code:
/sbin/iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
I can access the internet from my laptop as described above.

I suppose I should just add
Code:
/sbin/iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
to /etc/rc.local ??

Last edited by joseCuervo; 20th April 2012 at 10:26 AM.
Reply With Quote
Reply

Tags
nat, postrouting, set

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
/etc/sysconfig/iptables being overwritten bart3005 Using Fedora 0 5th June 2008 02:43 PM
Why can't I see my PCMCIA in /etc/sysconfig/ ramow Hardware & Laptops 0 12th June 2007 06:29 AM
/etc/sysconfig/pm isn't working high Hardware & Laptops 2 2nd August 2006 09:37 PM
/etc/sysconfig/harddisks on FC5? Hesse EOL (End Of Life) Versions 5 7th June 2006 08:57 AM
about prerouting and postrouting veeraafed Servers & Networking 1 18th May 2005 09:22 PM


Current GMT-time: 09:09 (Friday, 31-10-2014)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat
Saint-Laurent Photos - Hoofddorp - Schoten Instagram Photos