Ubuntu: I accidently run this script. My Internet is now blocked


I run this script now I wanna undo changes it made.

#!/bin/sh  # Firewall apps - only allow apps run from "internet" group to run    # clear previous rules  sudo iptables -F    # accept packets for internet group  sudo iptables -A OUTPUT -p tcp -m owner --gid-owner internet -j ACCEPT    # also allow local connections  sudo iptables -A OUTPUT -p tcp -d -j ACCEPT  sudo iptables -A OUTPUT -p tcp -d -j ACCEPT    # reject packets for other users  sudo iptables -A OUTPUT -p tcp -j REJECT    # open a shell with internet access  sudo -g internet -s  


This should do:

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  


You could reboot, or run:

sudo iptables -F  

This will flush all the rules that are set.

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Next Post »