Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
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.
I suppose you mean /etc/rc.d/ but that's exactly the tricky thing, I don't have that dir. I do have rc0.d up to rc6.d so I still do not know which one I should have.
I installed iptables using apt-get, maybe that does matter?
The number X stands for different runlevels. You should put your script in init.d and then make a symlink to the rcX.d for which runlevel you want your script to run at.
EDIT: via apt-get? I thought iptables came with Debian by default. Anyway, it should not matter. As long as you can handle iptables you will be fine making your own script.
If you are having troubles remembering everything you can always check the man pages. if you do not want to write your own iptables script you can google for some examples.
FYI, in debian all the startup scripts are located in /etc/init.d. The directories /etc/rc?.d are runlevel directories which contain symlinks to the scripts in /etc/init.d. The symlink will cause the script to start or stop depending on weather the symlink starts with an S or a K, e.g.
/etc/rc3.d/S20guarddog -> ../init.d/guarddog
The above symlink would cause guarddog to start when you enter runlevel 3 (/sbin/init 3.)
/etc/rc0.d/K20guarddog -> ../init.d/guarddog
If you do a shutdown the above symlink would cause guarddog to stop, the K stands for kill.
If you have an iptables script you really want to use, go ahead and install guarddog then put your iptables script here:
/etc/rc.firewall
Make sure it's executable. Then guarddog will start your script instead of its own.
Why you must use a firewall for the normal pc the firewall is unuseful try to close the service by #.
If you are sure to use the firewall in slackware you must created one file "rc.firewall" chmod 755 in /etc/rc.d/ and here u can put all rules.
ByE
to save your current rules to disk, then at boot simply execute
Code:
iptables-restore < /path/to/save
That way, if you make any adjustments to your filtering rules, you simply execute iptables-save again to update your saved ruleset, and the new rules will be loaded at next boot.
Originally posted by DarkNeo Why you must use a firewall for the normal pc the firewall is unuseful
Yeah, sure...you can't be serious, right?
Quote:
Originally posted by freakin'me If I put that script in init.d, how does iptables know that it is intended for iptables?
When the computer enters one of the runlevels which correspond to a certain rcX.d, it will read, line by line, and execute the scripts having an 'S' at the beginning of their name. And while the script contains commands that invoke /sbin/iptables, it's all taken care of.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.