alexanjos87
(usa Debian)
Enviado em 25/10/2011 - 17:57h
Resolvi o problema do script da seguinte forma:
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
modprobe iptable_nat
modprobe ip_tables
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -F INPUT
iptables -F OUTPUT
iptables -F FORWARD
iptables -F -t nat
iptables -F -t mangle
iptables -A INPUT -i eth0 -p TCP --dport 3128 -j DROP
iptables -t nat -A PREROUTING -i eth1 -p TCP --dport 80 -j REDIRECT --to-port 3128
iptables -t nat -A POSTROUTING -s 192.168.254.0/255.255.255.0 -j MASQUERADE
## Redirecionar Porta 3389 (Area de Trabalho Remota - MEUPC)##
iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 3389 -j DNAT --to 192.168.254.5
iptables -A FORWARD -p tcp -i eth0 --dport 3389 -d 192.168.254.5 -j ACCEPT
iptables -t nat -A PREROUTING -i eth0 -p udp --dport 3389 -j DNAT --to 192.168.254.5
iptables -A FORWARD -p udp -i eth0 --dport 3389 -d 192.168.254.5 -j ACCEPT
##
exit 0