mschott
(usa Debian)
Enviado em 12/09/2011 - 13:29h
sou iniciante em iptables, meu conf vai ficar assim??
# Firewall configurado por Mateus Schott 26/08/2011 13:42
#
#
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
:RH-Firewall-1-INPUT - [0:0]
-A INPUT -j RH-Firewall-1-INPUT
-A FORWARD -j RH-Firewall-1-INPUT
-A RH-Firewall-1-INPUT -i lo -j ACCEPT
-A RH-Firewall-1-INPUT -p icmp --icmp-type any -j ACCEPT
-A RH-Firewall-1-INPUT -p 50 -j ACCEPT
-A RH-Firewall-1-INPUT -p 51 -j ACCEPT
-A RH-Firewall-1-INPUT -p udp --dport 5353 -d 224.0.0.251 -j ACCEPT
-A RH-Firewall-1-INPUT -p udp -m udp --dport 631 -j ACCEPT
-A RH-Firewall-1-INPUT -p tcp -m tcp --dport 631 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 2049 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m udp -p udp --dport 137 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m udp -p udp --dport 138 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 139 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 445 -j ACCEPT
###### Libera entrada para o SSH ######
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 52225 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 52224 -j ACCEPT
###### Libera entrada para o VNC ######
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 5900 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 5902 -j ACCEPT
###### Libera entrada para o Webmin ######
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 10500 -j ACCEPT
###### Libera entrada de fora para o servidor web ######
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 10888 -j ACCEPT
###### Liberando a internet para a rede interna ######
-A RH-Firewall-1-INPUT -s 192.168.0.0/24 -o eth0 -j ACCEPT
###### Liberando consulta de DNS ######
#-A RH-Firewall-1-INPUT -p udp --sport 53 -j ACCEPT
#-A RH-Firewall-1-INPUT -p udp --dport 53 -j ACCEPT
#-A RH-Firewall-1-INPUT -p tcp --sport 53 -j ACCEPT
#-A RH-Firewall-1-INPUT -p tcp --dport 53 -j ACCEPT
iptables -t nat -A PREROUTING -p tcp -i eth0 --dport 52224 -j DNAT --to ip do cliente debian:52224
iptables -t nat -A PREROUTING -p udp -i eth0 --dport 52224 -j DNAT --to ip do cliente debian:52224
iptables -t nat -A POSTROUTING -d ip do cliente debian -j SNAT --to ip da rede local do servidor centos
-A RH-Firewall-1-INPUT -j REJECT --reject-with icmp-host-prohibited
COMMIT
# Generated by webmin
*nat
:OUTPUT ACCEPT [0:0]
:PREROUTING ACCEPT [0:0]
:POSTROUTING ACCEPT [0:0]
###### Ativa o mascaramento da rede ######
-A POSTROUTING -o eth0 -j MASQUERADE
COMMIT
# Completed