LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 08-02-2006, 05:55 AM   #1
Infernal211283
Member
 
Registered: Nov 2004
Location: Mid. East / Israel
Distribution: Slackware 10.2, Gentoo
Posts: 157

Rep: Reputation: 30
How to stop Iptables service?


I downloaded and compiled iptables from source and it works great, but i'd like to know how do i turn it off if i wish.

make install didn't create any startup scripts in rc.d/.

Thanks.
 
Old 08-02-2006, 06:25 AM   #2
prozac
Member
 
Registered: Oct 2005
Location: Australia
Distribution: slackware 12.1
Posts: 753

Rep: Reputation: 32
you downloaded the iptables from source? you mean you downloaded the iptables source package? why would you go to that length? with Slackware 10.2, you get it by default or if you didn't, you can install it from the cd itself.
AFAIK there is a rc.firewall script in /etc/rc.d/, you just need to make it non-executable.
Code:
chmod 644 /etc/rc.d/rc.firewall
to flush a running iptables rules, you would do a
Code:
iptables -F
basically you can re-write the rc.firewall script such that it switches between start|stop|restart just like in sysv type linuses. Have a look over some redhat system firewall scripts and such. or if you want total, unload the iptables module currently loaded.
 
Old 08-02-2006, 06:51 AM   #3
Infernal211283
Member
 
Registered: Nov 2004
Location: Mid. East / Israel
Distribution: Slackware 10.2, Gentoo
Posts: 157

Original Poster
Rep: Reputation: 30
Thumbs up

I meant i downloaded iptables' source, then compiled it from this source.

Yeah i know there are ready packages but i'm into compiling stuff for now - the best way to learn.

I also wanted the newest iptables (1.3.5) and though i installed slack with iptables it did not create rc.firewall.

I compiled my kernel so iptables is part of it.

I'm currently trying to rewrite some rc script so it will work for iptables... this is my first time i'm doing it, and by reading the ready ones i figured out that stopping iptables is nothing more than:

echo "Stopping iptables..."
iptables -F
iptables -P INPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -P OUTPUT ACCEPT
sleep 1
echo "Done."

Thank you for you reply.
 
Old 08-02-2006, 08:20 AM   #4
evilDagmar
Member
 
Registered: Mar 2005
Location: Right behind you.
Distribution: NBG, then randomed.
Posts: 480

Rep: Reputation: 31
You don't need to sleep() after doing that. :/
 
Old 08-02-2006, 02:49 PM   #5
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,141

Rep: Reputation: 168Reputation: 168
IIRC the '-F' by itself with no table name specified flushes all of the rules from the 'filter' table. If you use other tables in your rules you need to specify them as well. For example when I'm running a test I flush then delete all of my rules with:
Code:
iptables -F
iptables -t nat -F
iptables -X
iptables -t nat -X
 
Old 08-03-2006, 12:35 AM   #6
prozac
Member
 
Registered: Oct 2005
Location: Australia
Distribution: slackware 12.1
Posts: 753

Rep: Reputation: 32
yes, if you have additional queues (or tables) other that the defaults, you will need to flush them also. gilead has given a nice example.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
How do i cleanly stop a service? n0vembr Linux - General 18 07-29-2005 05:11 AM
can't stop service name shown by nmap mrpc_cambodia Red Hat 1 11-15-2004 08:52 AM
service won't stop in RH9 hairydan Red Hat 6 04-09-2004 02:05 PM
service named can't stop... TAAN Linux - Networking 1 09-11-2003 04:43 AM
Mandrake - how to stop a service? taz76 Linux - Security 1 03-13-2003 07:31 AM

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

All times are GMT -5. The time now is 09:06 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