1

I have a Mac mini which I'm using to give some other devices wireless access, by sharing it's Airport connection with the local ethernet, and that is plugged into a switch. All devices can get online no problem. (See how: http://www.macosxhints.com/article.php?story=20041112101646643 and http://www.macosxhints.com/article.php?story=20071223001432304 )

The issue is that I need to be able to connect in to these machines as well (at least, for the Slingbox to work). All the devices have 192.168.2.* addresses, and the rest of my local network is on 192.168.1.*.

I tried setting a static route so that the 192.168.2.* addresses would use a gateway of 192.168.1.50 (my mac mini's address) but that didn't seem to help. Does anyone know if what I'm trying to do is possible? I admit I'm not certain what Internet Connection sharing is really doing under the hood... perhaps it just does basic nat, and doesn't do the type of routing I'm looking for. If so, anyone know if this is possible?

1 Answer 1

0

You might want to take a look to this. The interesting part for you is "How Do I Setup Port Forwarding OS X Router?"

If you want to be able to connect to 192.168.2.5 using SSH (port 22) through your Mac Mini (192.168.1.50) you can do :

killall -9 natd sleep 5
/usr/sbin/natd -alias_address 192.168.2.50 -interface en0 -use_sockets -same_ports -unregistered_only -dynamic -clamp_mss -enable_natportmap -natportmap_interface en0 -redirect_port tcp 192.168.2.5:22 2222 -l

Then if you do a ssh to port 2222 of your mac mini, you will connect to 192.168.2.5 (In this example I assume your 192.168.1.* network is on en1 and your 192.168.2.* network is on en0)

1
  • I think I'm close, but it doesn't quite work. /usr/sbin/natd -alias_address 192.168.1.50 -interface en1 -use_sockets -same_ports -unregistered_only -dynamic -clamp_mss -enable_natportmap -natportmap_interface en0 -redirect_port tcp 192.168.2.2:5001 5001 -redirect_port udp 192.168.2.2:5001 5001 -l I can telnet in to the slingbox, but it doesn't seem like packets are coming out interestingly, your code sample above has the same interface for the -interface param, and the -natportmap_interface param. The article uses different interfaces. But, for me, neither works.
    – Tom Lianza
    Jul 29, 2010 at 5:50

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .