A recent hint here explained how to enable NAT on boot, but this one enables Apple's actual Internet Sharing option from the Sharing panel during startup. Here's what you need to do.
[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
% 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
#!/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
Mac OS X Hints
http://hints.macworld.com/article.php?story=200210280525440