Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Mac OS X > redirect port traffic?

redirect port traffic?
Thread Tools
Junior Member
Join Date: Oct 1999
Location: Greenville, NC USA
Status: Offline
Reply With Quote
Mar 25, 2003, 12:45 PM
 
Hi,

Is it possible to redirect network port traffic from the port of one mac to another port on a different machine??

Trying establish secure port connections, ssl, and such.. but for now, just trying to redirect the port 24/7. So if the user disconnects, the port stays open for him to reconnect. I've done this in java believe that there has to be a way to do this in unix..

thanks
tim
     
Mac Elite
Join Date: May 1999
Location: San Jose, CA
Status: Offline
Reply With Quote
Mar 25, 2003, 06:31 PM
 
Originally posted by Ecuguru:
Hi,

Is it possible to redirect network port traffic from the port of one mac to another port on a different machine??

Trying establish secure port connections, ssl, and such.. but for now, just trying to redirect the port 24/7. So if the user disconnects, the port stays open for him to reconnect. I've done this in java believe that there has to be a way to do this in unix..

thanks
tim
It's easy to setup port forwarding using SSH, so that ports are forwarded while the SSH session is open.

ssh -R host_port:target_host:target_port host

will open a SSH session to machine 'host', and instruct it to listen to port 'host_port'. Any connections to 'host_port' are forwarded to port 'target_port' on machine 'target_host'.

so

ssh -R 8080:www.apple.com:80 home_ip_address

will connect to the machine at home_ip_address. Connecting to http://home_ip_address:8080/ will proxy the request to www.apple.com:80

Setting up a permanant port forwarder involves running some kind of proxy service on your machine. Certainly possible, and may be easier for you - it depends on whether you want the port to be open all the time or just at specific times you control (by opening a SSH session to the machine)
Gods don't kill people - people with Gods kill people.
     
Ecuguru  (op)
Junior Member
Join Date: Oct 1999
Location: Greenville, NC USA
Status: Offline
Reply With Quote
Mar 26, 2003, 02:46 AM
 
Very cool, your example worked great..

never would have thought that ssh had such a feature built in.
How do I turn that off, or change the ip address it goes to? if I try to execute the function twice, it says that the port is already open.

So it can do web traffic.. if the web site forwards to a secure port, does it keep transmitting through the port 80 connect?

Thanks
tim
     
   
Thread Tools
Forum Links
Forum 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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 07:38 AM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2