Click to See Complete Forum and Search --> : iptables boot


orangganjil
11-15-2001, 10:09 PM
I wrote an iptables rules script that I want to run at bootup, as well as a bootup script. I've placed the bootup script (which runs the rules script) in /etc/rc.d/init.d but it won't run at bootup. How do I get this script to load at bootup?

-orangganjil

mychl
11-16-2001, 03:44 PM
you have to go into your rcX.d directory. X will prolly be 2,3 or 4... someone lese will prolly know better.

Make a symlink to your script in the init.d directory. Put an Syynameoflink, where yy is a number, the order of all the links in that particular directory.

EX S11network would be a link to /etc/rc.d/init.d/network script, and is the 11th thing loaded in that run level.

HTH

orangganjil
11-18-2001, 03:04 PM
Thanks. It worked.

-orangganjil

orangganjil
11-18-2001, 10:00 PM
I take that back (not the thank you). That didn't seem to work. I made a symlink in the rc3.d, rc4.d, and rc6.d directories (not at the same time) and it didn't work. I'm not sure what the deal is. Please help!

-orangganjil

mychl
11-19-2001, 04:35 PM
Are the scripts executable?

Can you type its name and have it run?

./iptables

./nameofscript

if you get permission denied even as root, then the scripts don't have the right properties to be executable, not sure how to change that though, I forget.

Let me know about that stuff, and maybe someone else knows anything...

orangganjil
11-20-2001, 02:20 AM
Yeah, it is executable. If I type ./myiptables (which is the name of the script) it works just fine. I can't get it to run at bootup, though.

-orangganjil

The King Ant
11-20-2001, 03:08 PM
You probably want to just call the script from /etc/rc.d/rc.local, instead of using init.d