Pessoal, estava fazendo testes no meu firewall, para isso usei um servidor com interface eth0 (10.10.10.0) e coloquei um alis eth0:1 (192.168.0.0), eu recebi internet pelo alias eth0:1.
Com isso meu firewall abaixo funcionava perfeitamente:
#!/bin/sh
# Variaveis de ambiente
interna=eth0
externa=eth0
rede_interna=10.10.10.0/24
dns_externo=xxxxxx
porta_dns=53
dedalus1=xxxxxx
dedalus2=xxxx
porta_remote_desktop=3389
porta_pop=25
pop_locaweb=xxxxx
porta_smtp=110
smtp_locaweb=xxxx
# Carregar modulos
modprobe iptable_nat
modprobe ip_conntrack
modprobe ip_conntrack_ftp
modprobe ip_nat_ftp
modprobe ipt_LOG
modprobe ipt_REJECT
modprobe ipt_MASQUERADE
# Tabelas padrão
iptables -F
iptables -X
iptables -F -t nat
iptables -X -t nat
iptables -F -t mangle
iptables -X -t mangle
iptables -P INPUT DROP
iptables -P OUTPUT ACCEPT
iptables -P FORWARD DROP
# Descarta pacotes malformados, protegendo contra ataques diversos:
iptables -A INPUT -m state --state INVALID -j DROP
# Libera todo o acesso a interface loopback
iptables -t filter -A INPUT -j ACCEPT -i lo
# Permite acesso total da rede interna para o firewall
iptables -A INPUT -s $rede_interna -i eth0 -j ACCEPT
# Libera o SSH
iptables -A INPUT -p tcp --dport 22 -i eth0 -j ACCEPT
# Mantem as conexoes estabelecidades e relatadas da tabela INPUT
iptables -t filter -A INPUT -j ACCEPT -m state --state ESTABLISHED,RELATED
# Impede a abertura de novas conexões
iptables -A INPUT -p tcp --syn -j DROP
# Libera o Ping
#iptables -t filter -A FORWARD -p icmp -j ACCEPT
# Redireciona as conexoes da porta 80 para a porta 3128 do squid
#iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 3128
# Mantem as conexoes estabelecidas e relatadas da tabela FORWARD
#iptables -t filter -A FORWARD -m state --state ESTABLISHED,RELATED -j ACCEPT
# Libera o DNS
iptables -t filter -A FORWARD -s $rede_interna -p udp --dport $porta_dns -o eth0 -d $dns_externo -j ACCEPT
# Libera acesso ao servidor externo
iptables -t filter -A FORWARD -s $rede_interna -p tcp --dport $porta_remote_desktop -o eth0 -d $dedalus1 -j ACCEPT
iptables -t filter -A FORWARD -s $rede_interna -p tcp --dport $porta_remote_desktop -o eth0 -d $dedalus2 -j ACCEPT
# Liberar acesso ao e-mail promaps via outlook
iptables -t filter -A FORWARD -s $rede_interna -p tcp --dport $porta_pop -o eth0 -d $pop_locaweb -j ACCEPT
iptables -t filter -A FORWARD -s $rede_interna -p tcp --dport $porta_smtp -o eth0 -d $smtp_locaweb -j ACCEPT
# Libera as máquinas listadas abaixo do firewall
#iptables -t filter -A FORWARD -s 10.10.10.4 -o eth0 -j ACCEPT
Só que agora montei a máquinas que será o firewall da rede com as interfaces fisicas eth0 e eth1 porém não funciona essas regras acima.
Eu não manjo nada de firewall tive ajuda de um colega do firewall para montar essas regras.
Obrigado


 
			
			
 
					
				 
			 Ajuda novamente com firewall
 Ajuda novamente com firewall
				 
					
					
					
						 Citação
  Citação
 
					
				 
			
 
			 Postado originalmente por Slackdi
 Postado originalmente por Slackdi
					
 
						