command to stop/start firewall

If none of the more specific forums is the right place to ask

command to stop/start firewall

Postby satimis » 2014-03-22 15:36

Hi all,

Debian 7.3 64bit

Is there an easier way to stop/start the default iptables? (I haven't added any rules other than the default)

On searching I found;
HowTo Disable The Iptables Firewall in Linux
http://www.cyberciti.biz/faq/turn-on-tu ... -in-linux/

RE: A note about other Linux distribution
Code: Select all
If you are using other Linux distribution such as Debian / Ubuntu / Suse / Slakcware Linux etc., try the following generic proc


1)
First, run
# iptables-save > /root/firewall.rules

2)
Then run following commands as root
Code: Select all
iptables -F
iptables -X
iptables -t nat -F
iptables -t nat -X
iptables -t mangle -F
iptables -t mangle -X
iptables -P INPUT ACCEPT
iptables -P OUTPUT ACCEPT
iptables -P FORWARD ACCEPT


Or create shell script as advised to stop iptables.

3)
To restore or turn on firewall type the following command:
# iptables-restore < /root/firewall.rules

Advice would be appreciated. Thanks.

Rgds
satimis
satimis
 
Posts: 463
Joined: 2004-09-11 11:50
Location: Hong Kong

Re: command to stop/start firewall

Postby Xiu » 2014-03-22 16:27

Hello satimis,

Maybe I'm missing something. But, why aren't you using UFW (uncomplicated firewall)?

Once installed it's as simple as using root terminal commands "ufw enable" to turn on and "ufw disable" to turn off.
Xiu
 
Posts: 17
Joined: 2014-03-12 13:46

Re: command to stop/start firewall

Postby satimis » 2014-03-22 23:52

Xiu wrote:Hello satimis,

Maybe I'm missing something. But, why aren't you using UFW (uncomplicated firewall)?

Once installed it's as simple as using root terminal commands "ufw enable" to turn on and "ufw disable" to turn off.

Hi Xiu,

I found following link before;
How to start/stop iptables in Ubuntu 12.04?
http://askubuntu.com/questions/161551/h ... untu-12-04
Does it work on Debian 7.3?

Thanks

satimis
satimis
 
Posts: 463
Joined: 2004-09-11 11:50
Location: Hong Kong

Re: command to stop/start firewall

Postby dilberts_left_nut » 2014-03-23 00:05

If you have ufw installed, then yes.

satimis wrote:(I haven't added any rules other than the default)

There are no rules defined by default, so if you haven't added any then there is nothing to stop.
AdrianTM wrote:There's no hacker in my grandma...
User avatar
dilberts_left_nut
 
Posts: 4057
Joined: 2009-10-05 07:54
Location: enzed

Re: command to stop/start firewall

Postby Xiu » 2014-03-23 00:47

A general rule to keep in mind: Ubuntu is compatible with Debian. But, Debian isn't compatible with Ubuntu. However, since Debian is used for Ubuntu's base you'll find answers in Ubuntu forums that may be helpful to use as a guide. To be prudent Debian literature should be the main source to help solve your issues.

I apologize, I have digressed...

Now back to your issue. :) What would you like to accomplish? Those instructions seem to over complicate what you are trying to do.

UFW is the "front-end" for iptables. It has default firewall policies that will meet most normal user needs. If you are trying to get basic firewall protection you can install UFW. Assuming you have sudo privileges on your user account here are the command line instructions.

Install the firewall:

Code: Select all
sudo apt-get install ufw


Once installed, turn it on, type:

Code: Select all
sudo ufw enable


To see the default policies being used..type:

Code: Select all
sudo ufw status verbose


It will automatically turn on upon reboots. To see all the command you can use with ufw, type:

Code: Select all
sudo ufw help
Xiu
 
Posts: 17
Joined: 2014-03-12 13:46

Re: command to stop/start firewall

Postby satimis » 2014-03-23 00:53

dilberts_left_nut wrote:If you have ufw installed, then yes.

Noted

satimis wrote:(I haven't added any rules other than the default)

There are no rules defined by default, so if you haven't added any then there is nothing to stop.

Thanks. It clears my doubt. I was testing pfSense installed on a VM with Debian 7.3 as Host of VirtualBox. pfSense can ping Host but Host unable to ping pfSense. I was thinking whether there is any rule on Iptables stopping it.

satimis
satimis
 
Posts: 463
Joined: 2004-09-11 11:50
Location: Hong Kong


Return to General Questions

Who is online

Users browsing this forum: No registered users and 14 guests

fashionable