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

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s