Hier folgt eine kurze Beschreibung, wie ich mit Hilfe der Skripte von Marco Wessel einen Internet-Zugang über eine AirPort-Verbindung mittels NAT (Network Address Translation) für ein LAN am Ethernet-Port eingerichtet habe.
Tipp: Bei den "Weiteren Optionen" in der Systemeinstellung "Netzwerk" empfiehlt es sich, die Reihenfolge der Einstellungen zu ändern: Ganz oben "AirPort", dann "Ethernet (integriert)", dann "Internes Modem".
## # /etc/hostconfig ## # This file is maintained by the system control panels ## # Network configuration # Services IPFORWARDING=-NO-Dabei die Einstellung "IPFORWARDING" von "-NO-" auf "-YES-" ändern.
## # /etc/hostconfig ## # This file is maintained by the system control panels ## # Network configuration # Services IPFORWARDING=-YES-
Solange auf Mac OS X kein DNS-Server läuft, muss bei den angeschlossenen Rechnern der DNS des Providers von Hand eingetragen werden.
4.4.2001 Anton Betzler - weitere Tipps - zurück
Die Skripte von Marco Wessel:
Put all of these files into /System/Library/StartupItems/NAT
---------------
file: "NAT"
---------------
#!/bin/sh
. /etc/rc.common
ConsoleMessage "Enabling NAT"
fwcmd="/sbin/ipfw"
#Change as needed.. I have en0 on my local network and en1 connected
#to my cable modem. Edit natd.sh as well..
in="en0"
out="en1"
$fwcmd -f flush
$fwcmd add divert natd all from any to any via $out
$fwcmd add allow ip from any to any via lo0
$fwcmd add allow ip from any to any via $out
$fwcmd add allow tcp from any to any out xmit $out setup
$fwcmd add allow tcp from any to any via $out established
#comment out if you don't want to allow ICMP(breaks ping and traceroute)
$fwcmd add 65435 allow icmp from any to any
#this starts natd
/System/Library/StartupItems/NAT/natd.sh
---------------
file: "natd.sh"
---------------
#!/bin/sh
#start natd
#change to your "outside" interface..
out="en1"
natd -n en1
#if you want any ports redirected to internal machines, add the following to
#the natd line above:
# -redirect_port [tcp or udp] destination_address:dest_port incoming_port
#if the ip address of the masqueraded interface could change, add -dynamic
---------------------------------
file: "StartupParameters.plist"
---------------------------------
{
Description = "Network Address Translation";
Provides = ("NAT");
Requires = ("Network");
OrderPreference = "none";
Messages =
{
start = "Starting NAT services";
stop = "Stopping NAT services";
};
}