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



Question:

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 127.0.0.1 -j ACCEPT  sudo iptables -A OUTPUT -p tcp -d 192.168.0.1/24 -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  


Solution:1

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  


Solution:2

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
Previous
Next Post »