Sto cercando di creare regole iptable che consentano connessioni ssh in entrata e in uscita, quindi consentire connessioni in uscita a porte specifiche, quindi rilasciare tutto ciò che non corrisponde.Consentire ssh in entrata/in uscita e bloccare tutto in uscita oltre a porte specifiche
Queste sono le regole che ho elaborato, le regole SSH funzionano, ma quando eseguo il tunnel nella casella non riesco ad accedere a http (porta 80) anche se l'ho consentito. Qualcuno può individuare l'errore?
#!/bin/bash
#clear iptables
iptables -F
iptables -X
#set default policy to drop
iptables -P INPUT DROP
iptables -P OUTPUT DROP
iptables -P FORWARD DROP
#accept everything no matter port on localhost
iptables -A INPUT -i lo -j ACCEPT
#allow established connections
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A OUTPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
#allow input on port 22, (established connections auto accepted)
iptables -A INPUT -p tcp --dport 22 -j ACCEPT
#allow traffic going to specific outbound ports
iptables -A OUTPUT -p tcp --dport 80 -j ACCEPT
iptables -A OUTPUT -p tcp --dport 443 -j ACCEPT
iptables -A OUTPUT -p tcp --dport 6667 -j ACCEPT
iptables -A OUTPUT -p tcp --dport 6697 -j ACCEPT
#...
#drop anything that doesnt match the rules above
iptables -A INPUT -j DROP
iptables -A OUTPUT -j DROP
Grazie per il vostro tempo.
Grazie, non ho pensato a porte DNS. Sta lavorando adesso. –