LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 03-30-2006, 04:02 AM   #1
smarthouseguy
LQ Newbie
 
Registered: Jan 2006
Posts: 15

Rep: Reputation: 0
Question iptables to same port on mulitple machines


ok... new issue

in rc.firewall i need to have access to my windows machines via remote desktop...

I have this working for one machine, but can't seem to get it working for the other.. could be a syntax error. I'm kinda new to iptables so any help would be wonderful

this works for the one computer:
Code:
iptables -t nat -A PREROUTING -p tcp --dport 3389 -i eth0 -j DNAT --to 192.168.0.30
this is the route that doesn't work.. what am I doing wrong?
Code:
iptables -t nat -A PREROUTING -p tcp --dport 3391 -i eth0 -j DNAT --to 192.168.0.21:3389
 
Old 03-30-2006, 06:07 AM   #2
ledow
Member
 
Registered: Apr 2005
Location: UK
Distribution: Slackware 13.0
Posts: 241

Rep: Reputation: 34
What error do you get when you try that command?

I can't see anything wrong with it (although I'm not *that* familiar with Port Address Translation using iptables). If the rule inserts itself in iptables correctly (without error) then the problem is probably external (port 3391 is not open to the internet either on the computer or whatever hardware you're using, ADSL Router etc. or port 3389 on the second computer is closed etc.)

It could also be that you don't have all the modules necessary loaded but chances are that iptables would throw out all sorts of obvious errors if that is the case.

Additionally, I'm not sure whether such PAT works from the localhost (i.e. if you are ON the machine running those iptables rules, it may bypass such rules)... this is something you would have to check yourself by testing from an external computer.

You could try using www.grc.com's shieldsup to see if your port 3391 is open to the world.
 
Old 03-30-2006, 11:20 AM   #3
win32sux
LQ Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 380Reputation: 380Reputation: 380Reputation: 380
perhaps you are missing the appropriate FORWARD rule to handle the DNATed packets...
 
Old 03-30-2006, 07:51 PM   #4
smarthouseguy
LQ Newbie
 
Registered: Jan 2006
Posts: 15

Original Poster
Rep: Reputation: 0
Quote:
perhaps you are missing the appropriate FORWARD rule to handle the DNATed packets...
nope.. it's in the file.. i actually got this working using this in addition to my normal rc.firewall config

Quote:
iptables -t nat -A PREROUTING -p tcp --dport 3390 -i eth0 -j DNAT --to 192.168.0.20:3389
now if only i can figure out how to have XXXX.XXXXXXX.com point to my.ip.ad.dy:3390 so i can remote desktop to the different machines with dns... any ideas?
 
Old 03-30-2006, 07:56 PM   #5
win32sux
LQ Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 380Reputation: 380Reputation: 380Reputation: 380
Quote:
Originally Posted by smarthouseguy
nope.. it's in the file.. i actually got this working using this in addition to my normal rc.firewall config
huh?? i don't follow... how about you post your rc.firewall script instead so we can see what's going on...??


Quote:
now if only i can figure out how to have XXXX.XXXXXXX.com point to my.ip.ad.dy:3390 so i can remote desktop to the different machines with dns... any ideas?
there's tons of companies that offer this service... for example:
http://www.no-ip.com/
 
  


Reply



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 - incomming port to external port - possible? ziggie216 Linux - Software 1 07-13-2006 02:08 PM
Port 80 forwarding to port 22 with iptables zahoo Linux - Networking 3 02-22-2005 07:22 AM
Blocking Machines From Samba with IPTables Erebus Bat Linux - Networking 7 08-04-2004 02:13 PM
Port Forwarding w/2 Machines & 1 Switch TastyWheat Linux - Networking 0 02-26-2004 11:02 PM
how to open port 25 for remote machines abd_bela Linux - Security 4 01-30-2003 08:01 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 03:16 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