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 > macOS > port forwarding using Mac OS X's "InternetSharing"

port forwarding using Mac OS X's "InternetSharing"
Thread Tools
Sarc
Mac Elite
Join Date: Sep 2001
Location: Chile
Status: Offline
Reply With Quote
May 22, 2004, 01:49 AM
 
I have my Mac set up as a router for a LAN using System Preferences's Sharing Pref. Pane.

However, I need to forward some ports to some of the computers. However I can't find a a config file, or anything where I can specify wich ports to forward.

Anyone ?
thx
:: frankenstein / lcd-less TiBook / 1GHz / radeon 9000 64MB / 1GB RAM / w/ext. 250GB fw drive / noname usb bluetooth dongle / d-link usb 2.0 pcmcia card / X.5.8
:: unibody macbook pro / 2.4 Ghz C2D / 6GB RAM / dell 2407wfp - X.6.3
     
Sarc  (op)
Mac Elite
Join Date: Sep 2001
Location: Chile
Status: Offline
Reply With Quote
May 22, 2004, 02:02 AM
 
so far I stumbled with this,
but I can't get it to work properly.

anyone please ?

sudo ipfw add 101 fwd 127.0.0.1,27910 tcp from any to 192.168.10.9 27910 in
:: frankenstein / lcd-less TiBook / 1GHz / radeon 9000 64MB / 1GB RAM / w/ext. 250GB fw drive / noname usb bluetooth dongle / d-link usb 2.0 pcmcia card / X.5.8
:: unibody macbook pro / 2.4 Ghz C2D / 6GB RAM / dell 2407wfp - X.6.3
     
Adam Betts
Addicted to MacNN
Join Date: Aug 2001
Location: North Hollywood, CA
Status: Offline
Reply With Quote
May 22, 2004, 02:25 AM
 
You'd have to setup it on master computer (the one sharing the internet connection).. Open System Preferences > Sharing and you should see something like Port Mapping.

I could never figure it out after that. I'd love to serve some games but it never worked for me
     
Sarc  (op)
Mac Elite
Join Date: Sep 2001
Location: Chile
Status: Offline
Reply With Quote
May 22, 2004, 02:28 AM
 
Originally posted by Adam Betts:
You'd have to setup it on master computer (the one sharing the internet connection).. Open System Preferences > Sharing and you should see something like Port Mapping.

I could never figure it out after that. I'd love to serve some games but it never worked for me
I can't find that "Port Mapping" thing ... is it there on your Pref. Pane ??
:: frankenstein / lcd-less TiBook / 1GHz / radeon 9000 64MB / 1GB RAM / w/ext. 250GB fw drive / noname usb bluetooth dongle / d-link usb 2.0 pcmcia card / X.5.8
:: unibody macbook pro / 2.4 Ghz C2D / 6GB RAM / dell 2407wfp - X.6.3
     
ul1984
Forum Regular
Join Date: Feb 2003
Location: Sundsvall, Sweden
Status: Offline
Reply With Quote
May 22, 2004, 04:53 AM
 
first prepare a file called natd.conf or something, put it anywhere you like, this is an example file i made
Code:
# example : redirect_port tcp 192.168.0.2:6667 6667 # example 2 : redirect_port tcp 192.168.0.2:2000-3000 2000-3000 # forward web traffic(port 80) to 192.168.0.5:2500 redirect_port tcp 192.168.0.5:2500 80 # bittorrent(192.168.0.3) redirect_port tcp 192.168.0.3:6881-6889 6881-6889 # quake3 (if i remember the port correctly) (192.168.0.2) redirect_port udp 192.168.0.2:27960 27960
now make sure that internet sharing is running, then do this:

1. open up a Terminal window and click the zoom button to make it big
2. run
Code:
ps ax | grep natd
3. copy the whole natd command(/usr/sbin/natd -alias_address....) to your clipboard
4. run
Code:
sudo killall natd
5. wait a few seconds until natd has quit, dont ask me why it takes a few seconds.
6. type "sudo " and paste in the natd command you copied and add " -f <path to your natd.conf>", similiar to this:
Code:
sudo /usr/sbin/natd -alias_address 67.31.86.11 -interface en0 -use_sockets -same_ports -unregistered_only -dynamic -clamp_mss -f /Users/joel/natd.conf
7. then run the command

that should be it
im not sure this works, but i think it should.

just remember this wont stick after a reboot, you have to rerun step 1 to 7 again, you could of course make a shell script that does this for you, but even if you dont, at least its good to have the ports you want to forward saved in a file(natd.conf) so you dont have to retype those everytime you reboot.

Good luck! i hope it works
     
   
 
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
Top
Privacy Policy
All times are GMT -4. The time now is 04:13 AM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,