I am setting up a basic Firewall rules for my Laptop but I cant seem to get HTTP and HTTPS, thus using of the Webbrowser to work.
My current rules are like this
# 1. Delete all existing rules
iptables -F
# 2. Set default chain policies
iptables -P INPUT DROP
iptables -P FORWARD DROP
iptables -P OUTPUT DROP
# 3. Allow outgoing SSH for Ethernet(enp12s0) and Wlan(wlp6s0)
iptables -A INPUT -i wlp6s0 -p tcp --sport 22 -m state --state ESTABLISHED -j ACCEPT
iptables -A INPUT -i enp12s0 -p tcp --sport 22 -m state --state ESTABLISHED -j ACCEPT
iptables -A OUTPUT -o wlp6s0 -p tcp --dport 22 -m state --state NEW,ESTABLISHED -j ACCEPT
iptables -A OUTPUT -o enp12s0 -p tcp --dport 22 -m state --state NEW,ESTABLISHED -j ACCEPT
# 4. Allow HTTP and HTTPS
iptables -A OUTPUT -j ACCEPT -m state --state NEW,ESTABLISHED,RELATED -o wlp6s0 -p tcp -m multiport --dports 80,443
iptables -A OUTPUT -j ACCEPT -m state --state NEW,ESTABLISHED,RELATED -o enp12s0 -p tcp -m multiport --dports 80,443
iptables -A INPUT -j ACCEPT -m state --state ESTABLISHED,RELATED -i wlp6s0 -p tcp -m multiport --sports 80,443
iptables -A INPUT -j ACCEPT -m state --state ESTABLISHED,RELATED -i enp12s0 -p tcp -m multiport --sports 80,443How can I allow the HTTP and HTTPS traffic so that I can use my browser again?
51 Answer
Through bodhi.zazen`s comment I found the solution.
Setting
iptables -A OUTPUT -m state --state NEW -p udp --dport 53 -j ACCEPT
iptables -A OUTPUT -m state --state NEW -p tcp --dport 53 -j ACCEPTand allowing Input from a previous established connection with eiter
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPTor
iptables -A INPUT -m state --state ESTABLISHED -p udp --sport 53 -j ACCEPT
iptables -A INPUT -m state --state ESTABLISHED -p tcp --sport 53 -j ACCEPTfixes the problem.