osvaldojr
(usa Ubuntu)
Enviado em 08/01/2008 - 09:14h
#!/bin/bash
##################################
# Comeco
##################################
IPREDE=172.16.0.0/16
DNS1=200.176.2.10
DNS2=200.204.0.138
iptables -A FORWARD -p TCP --dport 25 -i eth1 -j ACCEPT
iptables -A FORWARD -p UDP --dport 53 -i eth1 -j ACCEPT
iptables -A FORWARD -p TCP --dport 110 -i eth1 -j ACCEPT
iptables -t nat -A POSTROUTING -j MASQUERADE
modprobe iptable_nat
modprobe ip_nat_ftp
modprobe ip_conntrack_ftp
modprobe ip_conntrack
echo "Habilitando o roteamento a WEB ..."
iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE
echo 1 > /proc/sys/net/ipv4/ip_forward
echo "Feito!"
#### Para funcionar os OutLook da vida...
iptables -A FORWARD -p udp -s $IPREDE -d $DNS1 --dport 53 -j ACCEPT
iptables -A FORWARD -p udp -s $IPREDE -d $DNS2 --dport 53 -j ACCEPT
iptables -A FORWARD -p udp -s $DNS1 --sport 53 -d $IPREDE -j ACCEPT
iptables -A FORWARD -p udp -s $DNS2 --sport 53 -d $IPREDE -j ACCEPT
#
echo " Feito!"
####
echo "Liberando o acesso ao SMTP e POP dos clientes de email ..."
iptables -A FORWARD -p TCP -s $IPREDE --dport 25 -j ACCEPT
iptables -A FORWARD -p TCP -s $IPREDE --dport 110 -j ACCEPT
iptables -A FORWARD -p TCP --sport 25 -j ACCEPT
iptables -A FORWARD -p TCP --sport 110 -j ACCEPT
echo " Feito!"
echo "PRONTO!"
#####
#EOF
####