andre_ramos
(usa openSUSE)
Enviado em 18/06/2009 - 12:14h
O meu firewall esta configurado o opensuse 11.1 mas quando coloca a regra: $IPTABLES -P INPUT DROP nao tenho acesso a internet se eu colocar como ACCEPT a internet funciona normalmente, eu acredito que esteja com algum problema na tabela do INPUT e gostaria de saber se alguem pode me ajudar fico grato
segue o meu script do firewall
#!/bin/bash
#Para apagar as tabelas: iptables -F
#Para listar as regras: -L
# Carrega modulos
modprobe ip_nat_ftp
modprobe iptable_nat
# Habilitar Roteamento
IPTABLES=/usr/sbin/iptables
echo 1 > /proc/sys/net/ipv4/ip_forward
#Politicas de acesso geral
$IPTABLES -P INPUT ACCEPT
$IPTABLES -P OUTPUT ACCEPT
$IPTABLES -P FORWARD DROP
#localhost
$IPTABLES -A INPUT -i lo -j ACCEPT
# PREROUTING
$IPTABLES -t nat -A PREROUTING -i eth0 -p tcp -m tcp --dport 80 -j REDIRECT --to-port 3128
# INPUT
$IPTABLES -A INPUT -p tcp --dport 20 -j ACCEPT
$IPTABLES -A INPUT -p tcp --dport 21 -j ACCEPT
# ssh
$IPTABLES -A INPUT -p tcp --dport 22 -j ACCEPT
# smtp
$IPTABLES -A INPUT -p tcp --dport 25 -j ACCEPT
# pop3
$IPTABLES -A INPUT -p tcp --dport 110 -j ACCEPT
# http
$IPTABLES -A INPUT -p tcp --dport 80 -j ACCEPT
$IPTABLES -A INPUT -p udp --dport 80 -j ACCEPT
# https
$IPTABLES -A INPUT -p tcp --dport 443 -j ACCEPT
# OUTPUT
$IPTABLES -A OUTPUT -p tcp --dport 20 -j ACCEPT
$IPTABLES -A OUTPUT -p tcp --dport 21 -j ACCEPT
# ssh
$IPTABLES -A OUTPUT -p tcp --dport 22 -j ACCEPT
# smtp
$IPTABLES -A OUTPUT -p tcp --dport 25 -j ACCEPT
# pop3
$IPTABLES -A OUTPUT -p tcp --dport 110 -j ACCEPT
# http
$IPTABLES -A OUTPUT -p tcp --dport 80 -j ACCEPT
# https
$IPTABLES -A OUTPUT -p tcp --dport 443 -j ACCEPT
# FORWARD
$IPTABLES -A FORWARD -p tcp --dport 20 -j ACCEPT
$IPTABLES -A FORWARD -p tcp --dport 21 -j ACCEPT
# ssh
$IPTABLES -A FORWARD -p tcp --dport 22 -j ACCEPT
# smtp
$IPTABLES -A FORWARD -p tcp --dport 25 -j ACCEPT
$IPTABLES -A FORWARD -p tcp --sport 25 -j ACCEPT
# pop3
$IPTABLES -A FORWARD -p tcp --sport 110 -j ACCEPT
# http
$IPTABLES -A FORWARD -p tcp --dport 80 -j ACCEPT
# https
$IPTABLES -A FORWARD -p tcp --dport 443 -j ACCEPT
# rede local
$IPTABLES -A FORWARD -s 10.1.1.0/8 -j ACCEPT