Debian e iptables: differenze tra le versioni

Vai alla navigazione Vai alla ricerca
Riga 152: Riga 152:
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
# Accetta anche le nuove connessioni per le porte 4662 e 4672
# Accetta anche le nuove connessioni per le porte 4662 e 4672
iptables -A INPUT -p tcp -m state --state NEW --dport 4662 -j ACCEPT
iptables -A INPUT -m state --state NEW -p tcp --dport 4662 -j ACCEPT
iptables -A INPUT -p udp -m state --state NEW --dport 4672 -j ACCEPT
iptables -A INPUT -m state --state NEW -p udp --dport 4672 -j ACCEPT
# Accetta tutte le nuove connessioni SSH
# Accetta tutte le nuove connessioni SSH
iptables -A INPUT -p tcp -m state --state NEW --dport 22 -j ACCEPT
iptables -A INPUT -m state --state NEW -p tcp --dport 22 -j ACCEPT


# Permettere ping
# Permettere ping
Riga 186: Riga 186:
# purché veicolato da connessioni già stabilite o ad esse riconducibile
# purché veicolato da connessioni già stabilite o ad esse riconducibile
iptables -A FORWARD -i ppp0 -o br0 -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A FORWARD -i ppp0 -o br0 -m state --state ESTABLISHED,RELATED -j ACCEPT
# Programmi specifici
# Programmi specifici, ad esempio un server di COD4
iptables -A FORWARD -i ppp0 -o br0 -m state --state NEW -p tcp --dport 80 -j ACCEPT
iptables -A FORWARD -i ppp0 -o br0 -m state --state NEW -p tcp --dport 20800 -j ACCEPT
iptables -A FORWARD -i ppp0 -o br0 -m state --state NEW -p tcp --dport 443 -j ACCEPT
iptables -A FORWARD -i ppp0 -o br0 -m state --state NEW -p udp --dport 20800 -j ACCEPT
# COD4
iptables -A FORWARD -i ppp0 -o br0 -m state --state NEW -p tcp --dport 20810 -j ACCEPT
iptables -A FORWARD -i ppp0 -o br0 -m state --state NEW --dport 20800 -j ACCEPT
iptables -A FORWARD -i ppp0 -o br0 -m state --state NEW -p udp --dport 20810 -j ACCEPT
iptables -A FORWARD -i ppp0 -o br0 -m state --state NEW --dport 20810 -j ACCEPT
iptables -A FORWARD -i ppp0 -o br0 -m state --state NEW -p tcp --dport 28960 -j ACCEPT
iptables -A FORWARD -i ppp0 -o br0 -m state --state NEW --dport 28960 -j ACCEPT
iptables -A FORWARD -i ppp0 -o br0 -m state --state NEW -p udp --dport 28960 -j ACCEPT
# Non inoltrare il restante traffico in entrata
# Non inoltrare il restante traffico in entrata
iptables -A FORWARD -i ppp0 -o br0 -j REJECT
iptables -A FORWARD -i ppp0 -o br0 -j REJECT
Riga 211: Riga 211:


# COD4
# COD4
iptables -t nat -A PREROUTING -i ppp0 --dport 20800 -j DNAT --to-destination 192.168.1.172
iptables -t nat -A PREROUTING -i ppp0 -p tcp --dport 20800 -j DNAT --to-destination 192.168.1.172
iptables -t nat -A PREROUTING -i ppp0 --dport 20810 -j DNAT --to-destination 192.168.1.172
iptables -t nat -A PREROUTING -i ppp0 -p udp --dport 20800 -j DNAT --to-destination 192.168.1.172
iptables -t nat -A PREROUTING -i ppp0 --dport 28960 -j DNAT --to-destination 192.168.1.172
iptables -t nat -A PREROUTING -i ppp0 -p tcp --dport 20810 -j DNAT --to-destination 192.168.1.172
iptables -t nat -A PREROUTING -i ppp0 -p udp --dport 20810 -j DNAT --to-destination 192.168.1.172
iptables -t nat -A PREROUTING -i ppp0 -p tcp --dport 28960 -j DNAT --to-destination 192.168.1.172




3 155

contributi

Menu di navigazione