LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-07-2008, 07:38 AM   #1
shorto
Member
 
Registered: Jul 2006
Distribution: Debian 6.0.2.1 i386
Posts: 111

Rep: Reputation: 15
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?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Iptables forwarding problem andrewfeberwee Linux - Newbie 3 02-13-2007 05:24 PM
Port Forwarding Problem using IPTABLES ^vampire^ Linux - Security 1 10-12-2006 05:22 AM
iptables problem.....port forwarding..... shahg_shahg Linux - Networking 1 03-22-2006 06:17 AM
iptables-p2p - Instalation problems | How to block p2p with iptables Woping Linux - Networking 0 03-14-2006 01:56 PM
Iptables Forwarding Problem bullstrong Linux - Networking 2 09-01-2003 01:34 PM


All times are GMT -5. The time now is 01:25 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration