5
2
I need to have the mac take traffic coming into it on one port send the traffic to a different but still local port.
I.e. Traffic comes in on port 1234 and transfers to port 5900 (vnc)
This is because the router wont allow me to set up portforward where the origin and destination ports differ and I need to connect to multiple machines.
So for example in my router I have set up: port 1234 -> 192.168.0.2:1234 port 1235 -> 192.168.0.3:1235 port 1236 -> 192.168.0.4:1236
Then I need the mac to take incoming port and send it to local port 5900
As an aside: some VNC implementations support repeaters/proxies. Like UltraVNC Repeater. This might help one to forward just the default port to a single computer, which can then forward requests to other computers. However: that would require you to have one Mac running at all times. Also, I don't know if the built-in Screen Sharing server supports this feature.
– Arjan – 2010-11-30T15:31:37.3501VNC supports ports less than 5900. Set the display to -4666 (5900 - 1234). VNC will then listen on port 1234. – BillThor – 2010-11-30T16:17:06.630
@BillThor, that might be hard on a Mac: How to change the default screen sharing / VNC port number on Mac OS X?
– Arjan – 2010-11-30T16:24:08.063Or: use SSH to connect to the Macs? (The VNC protocol is not secure, though OS X adds an option to encrypt the data. I don't know what it does, but using SSH you can also use a Windows VNC client to connect securely.) So, on the client computer:
– Arjan – 2010-12-01T10:51:32.337ssh -L 1234:localhost:5900 -p 22 your-remote-mac
and connect your VCN client tolocalhost:1234
. However, using your router, this needs a uniquesshd
port for each Mac. See How to change sshd port on Mac OS X?Anyone who knows how to configure the IP Firewall? I thought
– Arjan – 2010-12-01T10:57:21.893sudo ipfw add fwd 127.0.0.1,1234 tcp from any to me dst-port 5900
might do the trick, but: no cigar. Maybe in 10.6 one needs to actually enableipfw
manually? (The built-in Application Firewall in System Preferences is a different thing altogether.)Yes, ipfw port forwarding seems broken in Mac 10.7 (and maybe earlier versions) – Claudio Floreani – 2012-04-16T22:47:19.343