I never did find a way of making Internet Sharing stay on, but I did come up with a way of achieving the same result. With a quick bit of Ruby, I whipped up this solution.
Load IRB by opening terminal and typing irb
Copy and paste this into irb, and hit Enter to activate.
while(true);sleep 15;puts Time.now.to_s + ": " + `launchctl load -w /System/Library/LaunchDaemons/com.apple.InternetSharing.plist 2>&1`;end
As it stands, the code will re-activate Internet Sharing every 15 seconds. Now, that may seem like too short of a period, but at 15 seconds there's a good chance that the connection will be re-enabled before any connection drops occur. You can change 15 to any number of seconds that you like.
This will result in a log such as:
Mon Jul 25 09:37:07 -0400 2011: com.apple.InternetSharing: Already loaded
Mon Jul 25 09:37:22 -0400 2011: com.apple.InternetSharing: Already loaded
Mon Jul 25 09:37:37 -0400 2011: com.apple.InternetSharing: Already loaded
It's important to remember that closing the window will terminate the script (Internet Sharing won't re-activate every 15 seconds), so if you need to close the window, consider using screen which is included on Macs.
Best Answer
Mac OS X (I'm speaking here of Lion, Mountain Lion & Mavericks) is a pretty good system to build a secured network access. But I can't agree more with your analysis: it really lacks any GUI to manage configuration.
For example, to be able to manage correctly
DHCP
, I finally set up a highly inelegant way to circumvent the wayInternetSharing
is blocking any attempt to configure it. This method may cause problem with any MacOS X update, so I have to remove my modifications before any OS update.Here is the technic I used with a solid success on a small network: How to stop InternetSharing overwriting
/etc/bootpd.plist
.I haven't yet tested my
/etc/bootpd.plist
to enable distributing IPv6 addresses, but I'm pretty sure it would be working by defining the correct<key>net_range</key>
entry.