Impostare un firewall con uno script iptables: differenze tra le versioni

Riga 59: Riga 59:
e diamogli questo contenuto, mettendo in pratica quanto visto nel paragrafo precedente:
e diamogli questo contenuto, mettendo in pratica quanto visto nel paragrafo precedente:
<pre>
<pre>
#!/bin/sh
#!/bin/sh


Riga 170: Riga 169:
$IPT -A INPUT -p tcp --dport 110 -m state --state NEW -j ACCEPT
$IPT -A INPUT -p tcp --dport 110 -m state --state NEW -j ACCEPT


# 111 - Ulogd - Syslog Server - VPN
# 111 - Ulogd - Syslog Server - LAN
$IPT -A INPUT -p tcp --dport 111 -m state --state NEW -s 192.168.90.0/24 -j ACCEPT
$IPT -A INPUT -p tcp --dport 111 -m state --state NEW -s 192.168.90.0/24 -j ACCEPT
$IPT -A INPUT -p tcp --dport 111 -m state --state NEW -s 10.0.0.0/24 -j ACCEPT
$IPT -A INPUT -p tcp --dport 111 -m state --state NEW -s 10.0.0.0/24 -j ACCEPT
Riga 179: Riga 178:
$IPT -A INPUT -p tcp --dport 143 -m state --state NEW -j ACCEPT
$IPT -A INPUT -p tcp --dport 143 -m state --state NEW -j ACCEPT


# 667 - Darkstat - Statistiche - VPN
# 667 - Darkstat - Statistiche - LAN
$IPT -A INPUT -p tcp --dport 667 -m state --state NEW -s 192.168.90.0/24 -j ACCEPT
$IPT -A INPUT -p tcp --dport 667 -m state --state NEW -s 192.168.90.0/24 -j ACCEPT
$IPT -A INPUT -p tcp --dport 667 -m state --state NEW -s 10.0.0.0/24 -j ACCEPT
$IPT -A INPUT -p tcp --dport 667 -m state --state NEW -s 10.0.0.0/24 -j ACCEPT
Riga 189: Riga 188:
$IPT -A INPUT -p tcp --dport 995 -m state --state NEW -j ACCEPT
$IPT -A INPUT -p tcp --dport 995 -m state --state NEW -j ACCEPT


# 1050/1051 - Zabbix - Monitor - VPN
# 1050/1051 - Zabbix - Monitor - LAN
$IPT -A INPUT -p tcp --dport 1050 -m state --state NEW -s 192.168.90.0/24 -j ACCEPT
$IPT -A INPUT -p tcp --dport 1050 -m state --state NEW -s 192.168.90.0/24 -j ACCEPT
$IPT -A INPUT -p tcp --dport 1050 -m state --state NEW -s 10.0.0.0/24 -j ACCEPT
$IPT -A INPUT -p tcp --dport 1050 -m state --state NEW -s 10.0.0.0/24 -j ACCEPT
Riga 205: Riga 204:
$IPT -A INPUT -p tcp --dport 2293 -m state --state NEW -j ACCEPT
$IPT -A INPUT -p tcp --dport 2293 -m state --state NEW -j ACCEPT


# 2605 - BitMeter - Monitor - VPN
# 2605 - BitMeter - Monitor - LAN
$IPT -A INPUT -p tcp --dport 2605 -m state --state NEW -s 192.168.90.0/24 -j ACCEPT
$IPT -A INPUT -p tcp --dport 2605 -m state --state NEW -s 192.168.90.0/24 -j ACCEPT
$IPT -A INPUT -p tcp --dport 2605 -m state --state NEW -s 10.0.0.0/24 -j ACCEPT
$IPT -A INPUT -p tcp --dport 2605 -m state --state NEW -s 10.0.0.0/24 -j ACCEPT
Riga 212: Riga 211:
# Non ha bisogno di configurazione
# Non ha bisogno di configurazione


# 10000  Webmin - Monitor - VPN
# 10000  Webmin - Monitor - LAN
$IPT -A INPUT -p tcp --dport 10000 -m state --state NEW -s 192.168.90.0/24 -j ACCEPT
$IPT -A INPUT -p tcp --dport 10000 -m state --state NEW -s 192.168.90.0/24 -j ACCEPT
$IPT -A INPUT -p tcp --dport 10000 -m state --state NEW -s 10.0.0.0/24 -j ACCEPT
$IPT -A INPUT -p tcp --dport 10000 -m state --state NEW -s 10.0.0.0/24 -j ACCEPT
Riga 236: Riga 235:


# echo -n "Iptables successfully configured."
# echo -n "Iptables successfully configured."
</pre>
</pre>