0

I am new to iptables and I need to block all HTTP/HTTPS traffic except to a certain IP (I am using below the IP of example.com)

iptables -A INPUT -p tcp -s 93.184.216.34 –-dport 443 -j ACCEPT
iptables -A OUTPUT -p tcp -d 93.184.216.34 –-sport 443 -j ACCEPT
iptables -A INPUT -p tcp -s 93.184.216.34 -–dport 80 -j ACCEPT
iptables -A OUTPUT -p tcp -d 93.184.216.34 -–sport 80 -j ACCEPT

欧洲杯买球For the DNS resolution I also have:

iptables -A INPUT -p udp -s 192.168.1.253 –-dport 53 -j ACCEPT

欧洲杯买球However, every time I set the default policies to DROP, I cannot access the IP despite my own rules. I have tried using -m state --state NEW,ESTABLISHED but with no luck. What am I missing here?

New contributor
Yann Gagne is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
  • 1
    Please note that Stack Overflow is for programming questions and not general computing issues. Question may be appropriate for or but do check their help before posting. – kaylum 2 days ago

Browse other questions tagged or ask your own question.