Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question
add comment

1 Answer

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)

share|improve this answer
    
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 '10 at 5:50
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.