LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 04-12-2006, 11:46 PM   #1
Palula
Member
 
Registered: May 2005
Location: Brazil
Distribution: Fedore Core 3
Posts: 138

Rep: Reputation: 15
Port Forwarding Help


Hi everybody!

I'm using a Torrent Client called microTorrent (very nice and slim by the way). But the thing is that had to make port forwarding lines within my iptables firewall to use it on a machine inside my network.

I'd like you guys to help me ou wit this one.

Here are the lines:
Code:
/sbin/iptables -A FORWARD -p tcp --dport ("port") -j ACCEPT
/sbin/iptables -t nat -A PREROUTING -i $wanic -p tcp --dport ("port") -j DNAT --to ("ip_address:port")
Here is the response from microTorrent:
Unable to map UPnP port to "ip_address_inside_lanort"

What is wrong with this?
Indeed, if I make a port check from the Internet to the "port". It appears Stealthed...

Thanks!!!
 
Old 04-13-2006, 04:41 PM   #2
Centinul
Member
 
Registered: Jun 2005
Distribution: Gentoo
Posts: 552

Rep: Reputation: 30
Quote:
Originally Posted by Palula
Here is the response from microTorrent:
Unable to map UPnP port to "ip_address_inside_lanort"
Does this torrent client use UPnP? If so a regular static port forward won't work (to my knowledge) because when an application uses UPnP ports are allocated dynamically. This might be the cause of your problem. I'm not sure though. Hope this helps!
 
Old 04-13-2006, 07:45 PM   #3
fotoguy
Senior Member
 
Registered: Mar 2003
Location: Brisbane Queensland Australia
Distribution: Custom Debian Live ISO's
Posts: 1,291

Rep: Reputation: 62
If you want anyone from the internet to access the machine on the inside of your network you first need to accept the packet on the INPUT chain, then preroute it, then push it onto the forward chain.

/sbin/iptables -A INPUT -i $wanic -p tcp --dport ("port") -j ACCEPT
/sbin/iptables -t nat -A PREROUTING -i $wanic -p tcp --dport ("port") -j DNAT --to ("ip_addressort")
/sbin/iptables -A FORWARD -i $wanic -p tcp --dport ("port") -j DNAT --to ("ip_addressort")
 
Old 04-13-2006, 09:58 PM   #4
Centinul
Member
 
Registered: Jun 2005
Distribution: Gentoo
Posts: 552

Rep: Reputation: 30
fotoguy -- I thought the PREROUTING chain was hit BEFORE the INPUT chain. At least that is how I understand it from this tutorial. Please let me know if I'm misunderstanding it

In that case, OP, I would switch your rules so the PREROUTING rule is before the forward rule. Also, take note of what I mentioned above.

Last edited by Centinul; 04-13-2006 at 09:59 PM.
 
Old 04-14-2006, 03:47 AM   #5
fotoguy
Senior Member
 
Registered: Mar 2003
Location: Brisbane Queensland Australia
Distribution: Custom Debian Live ISO's
Posts: 1,291

Rep: Reputation: 62
Quote:
Originally Posted by Centinul
fotoguy -- I thought the PREROUTING chain was hit BEFORE the INPUT chain. At least that is how I understand it from this tutorial. Please let me know if I'm misunderstanding it

In that case, OP, I would switch your rules so the PREROUTING rule is before the forward rule. Also, take note of what I mentioned above.
I think you are right, I have read example which tell you to accept on the INPUT chain before you can preroute it, so I may have to do some more research on the subject.

Thanks for that
 
  


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
IPCHAINS port forwarding and IPTABLES port forwarding ediestajr Linux - Networking 26 01-14-2007 07:35 PM
Simple Port Forwarding Firewall - not forwarding MadTurki Linux - Security 14 04-09-2006 12:08 PM
Port 80 forwarding to port 22 with iptables zahoo Linux - Networking 3 02-22-2005 07:22 AM
Port forwarding RoaCh Of DisCor Linux - Networking 2 11-10-2004 04:46 AM
port forwarding and packet forwarding syrtsardo Linux - Newbie 2 07-03-2003 10:37 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 03:14 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
Open Source Consulting | Domain Registration