shorto |
06-07-2008 06:38 AM |
Forwarding problem (For p2p programs, Iptables, Debian)
So here's the thing, I have a very fast connection that I cannot use.
Here's a quick sketch how my network is linked:
http://i154.photobucket.com/albums/s...ja/Network.png
And well PC1 is my workstation and even though I forward the ports to it it still doesn't work for most p2p programs. I can accept files on IRC no problems but I cannot send them (that goes for PC1 and the Server). The same thing happens with DC++ and lots of other programs, but the puzzling thing is forwarding works fine with emule and utorrent.
Any ideas what should I do? Oh here's the script for forwarding:
Code:
#!/bin/sh
# flush :)
iptables -t nat -F
iptables -F
iptables -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
for i in 21 22 80 113 31337 5000 1024
do iptables -A INPUT -m state --state NEW -p tcp --dport $i -j ACCEPT
done
# zapremo vse ostalo na input
iptables -A INPUT -j DROP
# SNAT + forwarding
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -s 192.168.0.0/255.255.255.0 -d ! 192.168.0.0/255.255.255.0 -o eth0 -j SNAT --to-source 84.255.202.21
# forwarding
# najprej tcp na 192.168.0.2
for i in 32459 6060 59 666 9876 1235 6969 1024
do iptables -t nat -A PREROUTING -i eth0 -p tcp --dport $i -m state --state NEW -j DNAT --to-destination 192.168.0.2
done
# tcp na 192.168.0.3
for i in 6789
do iptables -t nat -A PREROUTING -i eth0 -p tcp --dport $i -m state --state NEW -j DNAT --to-destination 192.168.0.3
done
# in se za konec tcp na 192.168.0.4
for i in 1234 2589 7000
do iptables -t nat -A PREROUTING -i eth0 -p tcp --dport $i -m state --state NEW -j DNAT --to-destination 192.168.0.4
done
# udp 192.168.0.2
for i in 32459 6060 59 666 9876 1235 6969 1024
do iptables -t nat -A PREROUTING -i eth0 -p udp --dport $i -m state --state NEW -j DNAT --to-destination 192.168.0.2
done
# udp 192.168.0.3
for i in 6789
do iptables -t nat -A PREROUTING -i eth0 -p udp --dport $i -m state --state NEW -j DNAT --to-destination 192.168.0.3
done
# udp 192.168.0.4
for i in 1234 2589 7000
do iptables -t nat -A PREROUTING -i eth0 -p udp --dport $i -m state --state NEW -j DNAT --to-destination 192.168.0.4
done
Please help, this is driving me crazy.
P.S. How do I forward a TSL port?
|