How to disable firewalls in Ubuntu, RedHat, CentOS

RedHat and other RedHat flavours

First login as the root user.

Next enter the following three commands to disable firewall.

# service iptables save
# service iptables stop
# chkconfig iptables off

If you are using IPv6 firewall, enter:

# service ip6tables save
# service ip6tables stop
# chkconfig ip6tables off

Ubuntu

$ sudo iptables -X
$ sudo iptables -t nat -F
$ sudo iptables -t nat -X
$ sudo iptables -t mangle -F
$ sudo iptables -t mangle -X
$ sudo iptables -P INPUT ACCEPT
$ sudo iptables -P FORWARD ACCEPT
$ sudo iptables -P OUTPUT ACCEPT

sudo ufw disable

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top