alexsim_1
(usa Debian)
Enviado em 11/10/2011 - 22:55h
Olá meu caro tente isso comigo funcionou.
Configuração Iptables com acesso vpn
#Módulos IPTABLES
modprobe ip_tables
modprobe iptable_nat
modprobe ip_conntrack
modprobe ip_conntrack_ftp
modprobe ip_nat_ftp
modprobe ipt_REJECT
modprobe ipt_MASQUERADE
modprobe ipt_state
modprobe ipt_multiport
modprobe iptable_mangle
modprobe ipt_limit
##Zera todas as regras do iptables
iptables -F
iptables -F INPUT
iptables -F OUTPUT
iptables -F FORWARD
iptables -t nat -F
iptables -X
echo "Limpando Regras..........................[OK]"
# Definindo Politica Padrão
iptables -P INPUT ACCEPT
iptables -P OUTPUT ACCEPT
iptables -P FORWARD ACCEPT
echo "Definindo Politica Padrão.................[OK]"
# Ativando Compartilhamento
modprobe iptable_nat
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
############################ BLOQUEANDO ACESSO AO MSN ###################################
iptables -A FORWARD -s 192.168.1.0/24 -p tcp --dport 1863 -j REJECT
iptables -A FORWARD -s 192.168.1.0/24 -d loginnet.passport.com -j REJECT
########################### ROTEAMENTO DO PROXY #########################################
iptables -t nat -A PREROUTING -i eth1 -p tcp --dport 80 -j REDIRECT --to-port 8700
iptables -t nat -A PREROUTING -i eth1 -p tcp --dport 8080 -j REDIRECT --to-port 8700
iptables -A INPUT -i eth1 -p tcp --dport 8700 -j ACCEPT
iptables -A INPUT -p icmp --icmp-type echo-request -j DROP
echo 1 > /proc/sys/net/ipv4/conf/default/rp_filter
iptables -A INPUT -m state --state INVALID -j DROP
iptables -A INPUT -i lo -j ACCEPT
iptables -A INPUT -i eth1 -j ACCEPT
iptables -A INPUT -p tcp --dport 22 -j ACCEPT
iptables -A INPUT -p tcp --syn -j DROP
echo "Ativando compartilhamento................[OK]"
########################## PREROUTERS PARA VPN #########################################
echo "Encaminha pacotes GRE para o servidor"
iptables -A FORWARD -p 47 -j ACCEPT
iptables -t nat -A PREROUTING -i eth0 -p 47 -j DNAT --to 192.168.1.100 # Windows Server 2003
echo "Ok"
echo "Encaminha pacotes vindos da 1701 UDP para o servidor"
iptables -A FORWARD -p udp --dport 1701 -j ACCEPT
iptables -t nat -A PREROUTING -i eth0 -p udp --dport 1701 -j DNAT --to 192.168.1.100:1701
echo "Encaminha pacotes vindos da 1723 TCP para o servidor"
iptables -A FORWARD -p tcp --dport 1723 -j ACCEPT
iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 1723 -j DNAT --to 192.168.1.100:1723
echo "Encaminha pacotes vindos da 500 UDP para o servidor"
iptables -A FORWARD -p udp --dport 500 -j ACCEPT
iptables -t nat -A PREROUTING -i eth0 -p udp --dport 500 -j DNAT --to 192.168.1.100:500
echo "Encaminha pacotes vindos da 4500 UDP para o servidor"
iptables -A FORWARD -p udp --dport 4500 -j ACCEPT
iptables -t nat -A PREROUTING -i eth0 -p udp --dport 4500 -j DNAT --to 192.168.1.100:4500
echo "Ok"
Espero que te ajude.
Abraço...