Linux - NewbieThis 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
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.
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.
if [ -x /usr/sbin/iptables ] ;then
/usr/sbin/iptables -t nat -A POSTROUTING -o pppO -j MASQUERADE
echo "Loading IPTABLES: /usr/sbin/iptables"
fi
or
if [ -f /usr/sbin/iptables ] ;then
/usr/sbin/iptables -t nat -A POSTROUTING -o pppO -j MASQUERADE
echo "Loading IPTABLES: /usr/sbin/iptables"
fi
The only thing different it the -f or -x option .. .I dont understand what the difference these to make. Which one do I have to have to perfomr the function I want correctly?
I got this after I tried doing it and I got a message saying that 1.2.6 might be out dated to the protocol. So I went and upgraded to 1.2.8. now my rc.inet2 section looks like this:
if [ -x /usr/local/sbin/iptables ] ; then
echo "loading iptables: /usr/local/sbin/iptables"
/usr/local/sbin/iptables start -t nat -A POSTROUTING -o pppO -j MASQUERADE
fi
I still dont see anything different in my lsmod read out though. So I really dont know if I acutally did anything or not.
My recommendation would be to get yourself
a full-fledged iptables script, say from http://www.linuxguruz.com/iptables/
or so ... if that line with the postrouting
is all you did you're quite a way away
from a working firewall...
Most firewall scripts will load the required
modules for you.
One tool I quite liked is http://easyfwgen.morizot.net/gen/
You feed it with the information of your
setup, and it generates a firewall script
for you
As you are in Slack you could put a
rc.firewall into /etc/rc.d
and have your rc.local call it.
I got it working. Apperently there was a "." infront of the whole startup line. It just kept screwing it it up. Now, the modules load smothly and so does IP TABLES. The only thing left is to check to make sure that my rc.firewall script is loading and I dont how exaclty to check that. It seems to load fine to me.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.