How to start/stop iptables?

The Uncomplicated Firewall or ufw is the configuration tool for iptables that comes by default on Ubuntu. So if you wanted to start or stop the ufw service, you'd have to do something like this

#To stop
$ sudo service ufw stop
ufw stop/waiting

#To start
$ sudo service ufw start
ufw start/running

About why you are not receiving the output as shown in the source. It clearly states there that the output you are receiving is for an inactive firewall, that is, no rules have been set. So try setting up some rules in iptables. Here's the Ubuntu Wiki on iptables that shows you how to set, edit them and such.


the service command works on RedHat-based systems with iptables very well, even on Centos 7, which has adopted systemd.

So if Debian-based systems don't consider iptables a service per se, it still might be thought of as one. And the command "service iptables restart" is actually very useful, especially when you want iptables to restore the 'default' rule (meaning, to use the main script; in centos /etc/sysconfig/iptables, etc.)

Tags:

Iptables