[Editor's note: I have not tested this myself ... and yes, it's distinct from the above referenced hint. That hint launched NAT at startup, the command-line version of internet sharing; this hint enables Apple's version, which apparently has some differences according to the comments to the first hint.]
In the Terminal, open the file /etc/hostconfig as root by typing sudo pic /etc/hostconfig. Add an entry at the bottom looking like this:
ISHARING=-YES-This is just for having an easy way of disabling
this feature if you want to. Change -YES- to -NO- and it will not start on boot.
Next, you need to createa new StartupItems directory and the required startup files. Do this by typing:
% cd /Library/StartupItems/The last step will open the pico editor on a new, blank "ISharing" file. [Editor's note: I added the "cd ISharing" step here as it was not in the original hint and seems to be required based on the structure of other StartupItems folders.]
% sudo mkdir ISharing
% cd ISharing
% sudo pico ISharing
In this file, copy and paste the following:
#!/bin/shThen hit Control-X and type Yes when it asks you to save. After pico quites, type sudo pico StartupParameters.plist and copy this bit into the file:
. /etc/rc.common
##
# Start up Internet Sharing
##
if [ "${ISHARING:=-NO-}" = "-YES-" ]; then
ConsoleMessage "Starting Internet Sharing"
/usr/libexec/InternetSharing
fi
{
Description = "Internet Sharing";
Provides = ("ISharing");
Requires = ("Network", "NetworkExtensions", "Resolver");
OrderPreference = "Late";
Messages =
{
start = "Starting Internet Sharing";
stop = "Stopping Internet Sharing";
};
}Save once again as described above using Control-X. Now you're almost good to go. Just one more thing, making sure the permissions are right. Just type these commands:% sudo chmod 755 ISharingYou should now be able to restart your machine and have Apple's Internet Sharing preference enabled at startup.
% sudo chown root:wheel ISharing
% sudo chown root:admin StartupParameters.plist
% sudo chmod 644 StartupParameters.plist

