spotinick
(usa Debian)
Enviado em 23/04/2010 - 12:57h
Não funfou tbm...
#!/bin/bash
echo "1" > /proc/sys/net/ipv4/ip_forward
# Limpando as tabelas
iptables -F
iptables -t nat -F
iptables -t mangle -F
iptables -P FORWARD ACCEPT
iptables -P OUTPUT ACCEPT
iptables -P INPUT ACCEPT
# Macarando conexões da rede
iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE
# Roteamento entre filiais
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
# Liberando acesso total a servidores
iptables -A FORWARD -s 10.5.1.4 -j ACCEPT
iptables -A FORWARD -d 10.5.1.4 -j ACCEPT
iptables -A FORWARD -s 10.5.1.21 -j ACCEPT
iptables -A FORWARD -d 10.5.1.21 -j ACCEPT
# Redirecionamento ao TS
iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 3389 -j DNAT --to-destination 10.5.1.11
iptables -t nat -A PREROUTING -i eth0 -p udp --dport 3389 -j DNAT --to-destination 10.5.1.11