I was looking for a way to block all internet input/output on my linux with the exception of a few chosen applications, and I found the following script which uses the iptables command:before the script is run, a group called 'internet' is created (sudo  groupadd internet). #!/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 -ssource: https://plus.google.com/+TobyKurien/posts/YZhZJCZmGgmThe only problem is that it doesn't seem to work for me. After running the script, I use the same terminal to call firefox by just typing firefox, the browser opens, but there is no internet access. All I get is Server not found. Before having run the script, the internet access was fine.QUESTION: Why might I be getting this issue? I understand the code being executed, and I can't figure out exactly why the firefox browser wasn't able to get a connection.
iptables linux code causing internet issues
linux;networking;iptables;firewall