Pra salvar:
#iptables-save > nomedoarquivo
Pra restaurar:
#iptables-restore < nomedoarquivo
Versão Imprimível
Pra salvar:
#iptables-save > nomedoarquivo
Pra restaurar:
#iptables-restore < nomedoarquivo
fiz essa bagaça aqui é naum funfou continuou a mesma coisa:
Minhas regras são ::Citação:
Postado originalmente por maurogbs
Chain INPUT (policy DROP)
target prot opt source destination
ACCEPT all -- anywhere anywhere
ACCEPT tcp -- anywhere anywhere tcp flags:ACK/ACK
ACCEPT all -- anywhere anywhere state ESTABLISHED
ACCEPT all -- anywhere anywhere state RELATED
ACCEPT udp -- anywhere anywhere udp spt:domain dpts:1024:65535
ACCEPT icmp -- anywhere anywhere icmp echo-reply
ACCEPT icmp -- anywhere anywhere icmp destination-unreachable
ACCEPT icmp -- anywhere anywhere icmp source-quench
ACCEPT icmp -- anywhere anywhere icmp time-exceeded
ACCEPT icmp -- anywhere anywhere icmp parameter-problem
ACCEPT tcp -- anywhere anywhere tcp dpt:ssh
ACCEPT tcp -- anywhere anywhere tcp dpt: 00000
ACCEPT udp -- anywhere anywhere udp dpt:domain
ACCEPT tcp -- anywhere anywhere tcp dpt:domain
ACCEPT udp -- anywhere anywhere udp dpt:isakmp
ACCEPT tcp -- anywhere anywhere tcp dpt:re-mail-ck
ACCEPT tcp -- anywhere anywhere tcp dpt:00
Chain FORWARD (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
Tem algo errado??
no windows com dns e gatway apontados para essa maquina dá o seguinte:
Disparando contra www.uol.com.br [200.221.2.45] com 32 bytes de dados:
Esgotado o tempo limite do pedido.
Esgotado o tempo limite do pedido.
Esgotado o tempo limite do pedido.
Esgotado o tempo limite do pedido.
Estatísticas do Ping para 200.221.2.45:
Pacotes: Enviados = 4, Recebidos = 0, Perdidos = 4 (100% de perda),
Tempos aproximados de ida e volta em milissegundos:
Mínimo = 0ms, Máximo = 0ms, Média = 0ms
pode ser alguma conf da minha eth1 que faz a rede interna???
Para zerar o firewal totalmente, liberando as CHAINS INPUT, FORWARD e ACCEPT:
iptables -P INPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -P OUTPUT ACCEPT
Limpando as regras existentes:
iptables -F
echo "1" > /proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -s <ip_da_sua_rede/mascara> -o <placa_ethernet_da_internet> -j MASQUERADE
Configura o DNS nas estações e manda bronca :!:
Com isso, foram limpas todas as regras e as Chains todas setadas para o padrão de aceitar todos os pacotes, assim não havendo nenhum bloqueio, apenas para você certificar que todas as estações estão acesando sem problemas. A partir dai, você vai configurando as suas regras manualmente. Espero que lhe ajude, cara.
[]´s
Kra, coloca essas regras que se e-mail vai funfar.... e as máqiuinas vão pingar para fora......
######
iptables -A INPUT -p udp -s 200.xxx.xxx.xxx --sport 53 -d $WAN -j ACCEPT
iptables -A INPUT -p udp -s 200.xxx.xxx.xxx --sport 53 -d $WAN -j ACCEPT
iptables -A FORWARD -p udp -s 200.xxx.xxx.xxx -d $LAN --dport 53 -j ACCEPT
iptables -A FORWARD -p udp -s 200.xxx.xxx.xxx -d $LAN --dport 53 -j ACCEPT
iptables -A FORWARD -p udp -s $LAN -d 200.xxx.xxx.xxx --sport 53 -j ACCEPT
iptables -A FORWARD -p udp -s $LAN -d 200.xxx.xxx.xxx --sport 53 -j ACCEPT
iptables -A FORWARD -p tcp -s $LAN --dport 25 -j ACCEPT
iptables -A FORWARD -p tcp --sport 25 -j ACCEPT
iptables -A FORWARD -p tcp -s $LAN --dport 110 -j ACCEPT
iptables -A FORWARD -p tcp --sport 110 -j ACCEPT
iptables -A INPUT -p icmp --icmp-type echo-reply -s 0/0 -i $WAN -j ACCEPT
iptables -A INPUT -p icmp --icmp-type destination-unreachable -s 0/0 -i $WAN -j ACCEPT
iptables -A INPUT -p icmp --icmp-type time-exceeded -s 0/0 -i $WAN -j ACCEPT
iptables -A OUTPUT -p icmp -o $WAN -j ACCEPT
iptables -t nat -A POSTROUTING -s 192.168.0.0/24 -d 0/0 -p icmp -j MASQUERADE
######
espero que te ajude....
$LAN -> ip da rede interna
$WAN -> eth na internete
200.xxx.xxx.xxx -> endereço do DNS do ISP
um abraço
Paulo Fernando Lamellas