LinuxQuestions.org
Visit the LQ Articles and Editorials section
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 05-26-2013, 07:36 AM   #1
OtagoHarbour
Member
 
Registered: Oct 2011
Posts: 291

Rep: Reputation: 3
Do you need to start iptables on Debian


I have just installed Debian 7.0.0 and have used

Code:
sudo iptables-restore <saved.iptables
to reload my old iptables.

My question is, do you acually have to start or enable iptables (as with "ufw enable") or is it always running? I tried

Code:
peter@app-server:~$ sudo iptables -h | grep start
peter@app-server:~$ sudo iptables -h | grep enable
peter@app-server:~$
and, as indicated, I got no results.

Thanks,
Peter.
 
Old 05-26-2013, 08:25 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 27,462
Blog Entries: 54

Rep: Reputation: 2899Reputation: 2899Reputation: 2899Reputation: 2899Reputation: 2899Reputation: 2899Reputation: 2899Reputation: 2899Reputation: 2899Reputation: 2899Reputation: 2899
Moved: This thread is more suitable in the Debian forum (asking how to start the firewall isn't a security issue) and has been moved accordingly to help your thread/question get the exposure it deserves.

Your options are to put a script or line running '/path/to/iptables-restore < /path/to/saved.iptables' in:
- /etc/rc.d/rc.local, or
- /etc/init.d/rcS (not recommended), or
- /etc/network/if-preup.d/ (or /etc/network/if-up.d/) or
- you could create a /etc/init.d/firewall script yourself (and use 'update-rc.d' to enable it), or
- use a front-end application that takes care of things if you like that kind of convenience / hassle.
 
1 members found this post helpful.
Old 05-26-2013, 11:51 AM   #3
OtagoHarbour
Member
 
Registered: Oct 2011
Posts: 291

Original Poster
Rep: Reputation: 3
Quote:
Originally Posted by unSpawn View Post
Moved: This thread is more suitable in the Debian forum (asking how to start the firewall isn't a security issue) and has been moved accordingly to help your thread/question get the exposure it deserves.

Your options are to put a script or line running '/path/to/iptables-restore < /path/to/saved.iptables' in:
- /etc/rc.d/rc.local, or
- /etc/init.d/rcS (not recommended), or
- /etc/network/if-preup.d/ (or /etc/network/if-up.d/) or
- you could create a /etc/init.d/firewall script yourself (and use 'update-rc.d' to enable it), or
- use a front-end application that takes care of things if you like that kind of convenience / hassle.
I could not find /etc/rc.d/rc.local but did find /etc/init.d/rc.local. Should I put '/path/to/iptables-restore < /path/to/saved.iptables' in the latter?

Also, is '/path/to/iptables-restore < /path/to/saved.iptables' sufficient to get my iptables running? Apparently RedHat uses

Code:
sudo iptables start
(which gave the following error message on my Debian system.

Code:
Bad argument `start'
)

Does Debian have an equivalent?

Thanks,
Peter.
 
Old 05-26-2013, 01:02 PM   #4
unSpawn
Moderator
 
Registered: May 2001
Posts: 27,462
Blog Entries: 54

Rep: Reputation: 2899Reputation: 2899Reputation: 2899Reputation: 2899Reputation: 2899Reputation: 2899Reputation: 2899Reputation: 2899Reputation: 2899Reputation: 2899Reputation: 2899
Quote:
Originally Posted by OtagoHarbour View Post
Should I put '/path/to/iptables-restore < /path/to/saved.iptables' in the latter?
Yes, you could.
*Probably superfluous but you should note "/path/to/" indicates you should supply the valid, full path to the files.


Quote:
Originally Posted by OtagoHarbour View Post
Also, is '/path/to/iptables-restore < /path/to/saved.iptables' sufficient to get my iptables running?
That depends: see 'man iptables-restore' for arguments you might want to add. rc.local is basically a shell script too so you can also use conditions or string commands together.


Quote:
Originally Posted by OtagoHarbour View Post
Apparently RedHat uses
Code:
sudo iptables start
(..) Does Debian have an equivalent?
Using an init script instead of rc.local allows you to enter more commands (its just a shell script) and access to "start, stop, status" commands while rc.local will be run only once on boot. The only difference is that you need to create one yourself if the system doesn't provide one and even that isn't a problem as there's plenty of examples in the /etc/rc.d/init.d/ directory.


*Also see:
- http://www.debian.org/doc/manuals/de.../index.en.html
- http://debian-handbook.info/browse/wheezy/
 
1 members found this post helpful.
  


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 to start iptables? contozo Linux - Networking 4 02-25-2013 01:07 AM
How to start application when linux(ubuntu/debian) start ersek Linux - General 4 05-28-2009 12:19 PM
iptables suddenly will not start cylarz Linux - Kernel 2 06-28-2008 11:48 PM
can not start my iptables xudingding Linux - Security 6 10-13-2005 02:30 PM
Start DHCPd and configure iptables on boot (Debian Sarge) Qis Linux - Networking 6 03-02-2005 05:34 AM


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

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration