Comments on: Port forwarding on my Mac mini http://switch.richard5.net/2006/01/25/port-forwarding-on-my-mac-mini/ How to build your Mac into a internet server using open source software Tue, 17 Jun 2008 18:25:42 +0000 hourly 1 http://wordpress.org/?v=3.2.1 By: Pio http://switch.richard5.net/2006/01/25/port-forwarding-on-my-mac-mini/comment-page-1/#comment-13034 Pio Fri, 05 Jan 2007 00:49:38 +0000 http://switch.richard5.net/?p=67#comment-13034 How to automatically restart natd process with the 'port forwarding' option after each reboot: ** This example forwards the port 4662 (aMule) ** ** These operations must be done by root ** i) Create a folder named 'natd' in /Library/StartupItems/ ii) Create two files, 'StartupParameters.plist' and 'natd', inside 'natd' folder === Begin of StartupParameters.plist === { Description = "Network Address Translation"; Provides = ("NAT"); Requires = ("Network", "NetworkExtensions"); OrderPreference = "Last"; } === End of StartupParameters.plist === ========== Begin of natd ========== #!/bin/sh . /etc/rc.common killall -KILL natd sleep 5 natd -alias_address 192.168.1.2 -interface en0 -use_sockets -same_ports -unregistered_only -dynamic -clamp_mss -redirect_port tcp 10.0.0.2:4662 4662 ========== End of natd ========== iii) 'natd' is a script, so we should set it to be executable # chmod 755 natd iv) Reboot your computer. How to automatically restart natd process with the ‘port forwarding’ option after each reboot:

** This example forwards the port 4662 (aMule) **
** These operations must be done by root **

i) Create a folder named ‘natd’ in /Library/StartupItems/

ii) Create two files, ‘StartupParameters.plist’ and ‘natd’, inside ‘natd’ folder

=== Begin of StartupParameters.plist ===

{
Description = “Network Address Translation”;
Provides = (“NAT”);
Requires = (“Network”, “NetworkExtensions”);
OrderPreference = “Last”;
}

=== End of StartupParameters.plist ===

========== Begin of natd ==========

#!/bin/sh
. /etc/rc.common

killall -KILL natd
sleep 5
natd -alias_address 192.168.1.2 -interface en0 -use_sockets -same_ports -unregistered_only -dynamic -clamp_mss -redirect_port tcp 10.0.0.2:4662 4662

========== End of natd ==========

iii) ‘natd’ is a script, so we should set it to be executable

# chmod 755 natd

iv) Reboot your computer.

]]>