Home Download Ubuntu

How to disable iptables temporarily on ubuntu

With iptables you can create your own set of rules for your network, just like a firewall.
If you need to disable all the iptables rules temporarily, you can flush all the rules using:

sudo iptables -F


note: to enable the rules, just restart ubuntu.

or you can make a script:

sudo nano -w /root/fw.stop


enter the following:

echo "Stopping iptables rules and allow everyone..."
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 FORWARD ACCEPT
iptables -P OUTPUT ACCEPT


save it and make it executable:

sudo chmod +x /root/fw.stop


to run your new script:

sudo /root/fw.stop


Resources: help.ubuntu.com

0 comments:

Post a Comment