LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 01-25-2005, 02:05 PM   #1
wesleywest
Member
 
Registered: Aug 2004
Posts: 43

Rep: Reputation: 15
[Iptables] Debian sarge, can't run script


After a while using redhat enterprise editon 3 i took a step to debian and i'm loving it from the first moments on.
But i ran into a problem!
in redhad i have a directory /etc/rc.d/init.d/ where i start my firewall with ./iptables start

But whit debian i can't seem to find any scritp of starting or stoping my firewall iptables!
I know it is running cause i can get a list with iptables -L

So what do i do, and where do i store my script so it wil run when i start my iptables or stop it.

ohw yeah i forgot to mention: i run debian sarge!


thnx indvande
 
Old 01-25-2005, 02:17 PM   #2
leonscape
Senior Member
 
Registered: Aug 2003
Location: UK
Distribution: Debian SID / KDE 3.5
Posts: 2,313

Rep: Reputation: 48
Scripts are in /etc/init.d
 
Old 01-25-2005, 02:23 PM   #3
wesleywest
Member
 
Registered: Aug 2004
Posts: 43

Original Poster
Rep: Reputation: 15
Quote:
Originally posted by leonscape
Scripts are in /etc/init.d
yeah i did understand that part, buw how do i start en stop my firewall like in redhat and where is the file that is pointing @ /etc/init.d ?
 
Old 01-25-2005, 02:28 PM   #4
leonscape
Senior Member
 
Registered: Aug 2003
Location: UK
Distribution: Debian SID / KDE 3.5
Posts: 2,313

Rep: Reputation: 48
The runlevel directories are /etc/rc0.d too /etc/rc6.d just check your default runlevel in /etc/inittab and delete or add the symlink to the appropriate directory.
 
Old 01-25-2005, 02:36 PM   #5
wesleywest
Member
 
Registered: Aug 2004
Posts: 43

Original Poster
Rep: Reputation: 15
i just read something from someone else his post, but i don't quite understand it.
could somone clear this a little for me

Code:
Put it in the /etc/init.d/ directory make it executable and then:

    code:

update-rc.d rc.firewall start 20 2 3 4 5 . stop 20 0 1 6 .



Will make the proper links in the /etc/rc?.d directories to start and stop properly on boot or shutdown. Note the . in the line they are important.
especially this line :

update-rc.d rc.firewall start 20 2 3 4 5 . stop 20 0 1 6 .
 
Old 01-25-2005, 02:43 PM   #6
leonscape
Senior Member
 
Registered: Aug 2003
Location: UK
Distribution: Debian SID / KDE 3.5
Posts: 2,313

Rep: Reputation: 48
update-rc.d can be used to set the symlinks for you in the runlevel directories. rc.firewall is his script.

start tells you where you want this script started, followed by the order number ( so It can be run in the correct order amongst other scripts ) followed by the run levels in which the script is to be started.
stop does exactly the same except this time the order and runlevels in which the script is to be stopped. The . is used to mark the end of the run levels.

This command would create these symlinks:

/etc/rc0.d/K20rc.firewall -> ../init.d/rc.firewall
/etc/rc1.d/K20rc.firewall -> ../init.d/rc.firewall
/etc/rc2.d/S20rc.firewall -> ../init.d/rc.firewall
/etc/rc3.d/S20rc.firewall -> ../init.d/rc.firewall
/etc/rc4.d/S20rc.firewall -> ../init.d/rc.firewall
/etc/rc5.d/S20rc.firewall -> ../init.d/rc.firewall
/etc/rc6.d/K20rc.firewall -> ../init.d/rc.firewall

Last edited by leonscape; 01-25-2005 at 02:47 PM.
 
Old 01-25-2005, 02:55 PM   #7
wesleywest
Member
 
Registered: Aug 2004
Posts: 43

Original Poster
Rep: Reputation: 15
so the numbers are runlevel he uses to start en stop the firewall ok ok

but i have just a script like

-p input ACCEPT
enz
enz

and som open port


but no if statements like start en stop in my script ! do i need those ?
 
Old 01-25-2005, 03:03 PM   #8
leonscape
Senior Member
 
Registered: Aug 2003
Location: UK
Distribution: Debian SID / KDE 3.5
Posts: 2,313

Rep: Reputation: 48
At least a way of skipping them for the killing would be useful
Code:
if [[ $1 == start ]]; then
    -p input ACCEPT
    ...
fi
 
  


Reply



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



Similar Threads
Thread Thread Starter Forum Replies Last Post
debian sarge 64bit unable to run debconf linuxmandrake Linux - Software 0 09-22-2005 05:18 PM
Start DHCPd and configure iptables on boot (Debian Sarge) Qis Linux - Networking 6 03-02-2005 05:34 AM
iptables and syslogd on debian sarge partiallynothin Linux - Software 1 02-23-2005 09:26 AM
No ping (in/out) using iptables on Debian sarge-sid bureado Linux - Security 2 02-12-2004 01:07 PM
k3b run problems in debian sarge scottie4442 Linux - Software 4 02-06-2004 02:37 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 10:30 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration