Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Automatically enable Internet Sharing at startup Network
You are sharing the Internet connection via Airport, but after every reboot, the AirPort icon in the menu bar shows that Internet Sharing is disabled. Looking in the Internet Sharing prefs panel, everything is configured correctly. Disabling and enabling it again, and it works as it should. This happened to me various times with 10.4.11 and it always happens with 10.5.x. I discovered that by killing either the InternetSharing or the bootpd process, launchd restarts them correctly and InternetSharing gets enabled. Since launchd stores the PID of bootpd in /var/run/bootpd.pid, I thought to automate the process of "refreshing" InternetSharing/bootpd at boot time by means of the /etc/rc.local script. (For compatibility reasons, this script still works in Leopard -- see man rc for details. Basically one needs just to issue the following command:
sudo sh -c 'echo kill $(cat /var/run/bootpd.pid) >> /etc/rc.local'
Run that command, then reboot. After logging in, you will notice that the AirPort icon will show a disabled Internet Sharing state that switches automatically to enabled after a slight delay. I also noticed that this workaround fixed a problem I had with Medialink (a program to share media files to the PS3 via UPnP) that did not always recognize my PS3.

[robg adds: I haven't tested this one.]
    •    
  • Currently 2.13 / 5
  You rated: 5 / 5 (8 votes cast)
 
[21,010 views]  

Automatically enable Internet Sharing at startup | 3 comments | Create New Account
Click here to return to the 'Automatically enable Internet Sharing at startup' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Automatically enable Internet Sharing at startup
Authored by: slb on Apr 20, '08 12:13:47PM

Doesn't appear to work in 10.5.2.
Oh well, thanks for trying...



[ Reply to This | # ]
Automatically enable Internet Sharing at startup
Authored by: deluks on Dec 28, '08 06:44:14AM

I didn't do it the exact same way as explained, but adding ``kill $(cat /var/run/bootpd.pid)'' to /etc/rc.local works for me in 10.5.5
just for the record... ;)



[ Reply to This | # ]
Automatically enable Internet Sharing at startup
Authored by: Michelasso on Feb 08, '09 10:01:31AM

Actually I've found a better way. Simply open the Terminal application and
type:

sudo sh -c 'echo killall InternetSharing >> /etc/rc.local'
sudo sh -c 'chmod +x /etc/rc.local'

or edit the /etc/rc.local file manually, it's the same.

Then reboot. The addition of 'chmod +x /etc/rc.local' is mandatory, because the script needs to be executable. I forgot to add that one. My apologies.



[ Reply to This | # ]