spotinick
(usa Debian)
Enviado em 14/04/2010 - 13:18h
Bom vamos lá, bind desinstalado, agora abaixo eu havia montado um script para carregar junto ao debian qdo reiniciar, lá vai:
#!/bin/bash
modprobe iptables
modprobe iptables_nat
#
## Roteamento entre filiais
route add -net 10.5.1.0 netmask 255.255.255.0 gw 10.5.1.1
route add -net 10.5.2.0 netmask 255.255.255.0 gw 10.5.1.1
route add -net 10.5.3.0 netmask 255.255.255.0 gw 10.5.1.1
route add -net 10.5.4.0 netmask 255.255.255.0 gw 10.5.1.1
route add -net 10.5.5.0 netmask 255.255.255.0 gw 10.5.1.1
#
## Compartilhar Internet
iptables -F
iptables -F INPUT
iptables -F OUTPUT
iptables -F POSTROUTING -t nat
iptables -F PREROUTING -t nat
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -P FORWARD ACCEPT
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
#
## Libera Skype
iptables -A FORWARD -i eth0 -o eth1 -s 10.5.0.0 -p tcp --dport 443 -j ACCEPT
iptables -A FORWARD -i eth0 -o eth1 -s 10.5.0.0 -p tcp --dport 1024:65535 ACCEPT
iptables -A OUTPUT -p tcp --dport 443 -j ACCEPT
iptables -A INPUT -p tcp --dport 443 -j ACCEPT
#
##
iptables -A POSTROUTING -s 10.5.1.0/24 -d! 10.0.0.0/8 -j MASQUERADE
#
## Liberacao de Portas para rede
iptables -A FORWARD -p tcp -m tcp -s 10.5.1.0/24 --dport 2631 -j ACCEPT
iptables -A FORWARD -p tcp -m tcp -s 10.5.1.0/24 --dport 5017 -j ACCEPT
#