Mid 2011 iMac
Mac OS Mountain Lion 10.8.2 completely up to date
Apple TV 3rd Gen 5.1
iPhone 4s iOS 6
I have experienced this same problem. I originally ran OS X Lion 10.7.4, activated Internet Sharing from ethernet to WIFI, using WPA 2. This was at a totally different home with different internet connection sending to the iMac's ethernet port. I had 2 iPhones, original running 3.1.2 and iPhone 4s running 5.1.1. These devices would consistently lose their internet connection. They would show connected to the network being broadcast by the iMac, but would not connect to the internet. My roommate had a Windows laptop which experienced the same issue.
I moved into a new house, changed internet connection, updated to Mountain Lion 10.8.2. I also added an Apple TV to this mix, and a 2006 MacBook. My iphones seemed to consistently connect, but the MacBook experienced problems. The biggest problem became the Apple TV. The Apple TV would connect to the network just fine. It would hold a stable connection... until I attempted to use AirPlay mirroring. If I connected the Apple TV to the Wifi the iMac was broadcasing, it would allow me to do AirPlay Mirroring for a good period of time. If I left it connected it would disconnect, or if I disconnected, I would not be able to reconnect it. If I attempted to reconnect enable AirPlay Mirroring from my iMac for a second time, I would get the spinning color wheel, and the AirPlay Mirroring icon would disappear (note: restarting the Apple TV or the iMac, either device, would allow me to reconnect for a while). Additionally, AirPlay Mirroring was not available on my iPhone 4s at any point, despite the fact botht the iPhone and Apple TV are compatible and connected to this same wireless network (provided by the iMac).
For quite a while, I believed this to be a problem with the individual devices. I thought for sure it was not an issue with the internet signal broadcast by the iMac.. until.. I decided to try this on a network created by a separate wireless router. I connected the iMac to the router via ethernet and the Apple TV and iPhone 4s to the router Wifi signal, lo and behold, all problems were solved. I was able to activate and deactivate AirPlay Mirroring on my iMac, the Apple TV stayed connected to the network with no issues, AirPlay Mirroring functions worked between my iPhone and Apple TV, and other devices were able to hold a stable connection to the wireless network.
The only thing that changed was the source of the wireless network from the Internet Sharing on my iMac to a different wireless router.
I was unable to find anything on support.apple.com that discussed the compatibility of using AirPlay functions over a network shared by a Mac. I would be surprised if this is not supported. So based on what I have read, this is a supported configuration.
Am I missing something? Shouldn't this work consistently? Shouldn't the AirPlay Mirroring functions be available on the iMac brodcast Wifi signal? Should devices stay connected to the iMac broadcast Wifi signal?
I believe I have eliminated the possibility of this being anything other than an issue caused by the Mac (specifically the OS or iMac). Furthermore, I have a separate FireWire drive with a fresh installation of Lion 10.7.4 and Mountain Lion 10.8.2. I have booted from both of those partitions, and the problem still occurs. They are fresh installations; thus, reinstalling the OS will not resolve this.
-The possibility of the issue being related to each connected device and/or the devices' OS has been eliminated, as I have attempted to connected the iPhone 1st gen, iPhone 4s, Apple TV, MacBook (running Leopard 10.5.8), and a Windows Laptop running Windows 7.
-The possibility of the issue being related to the environment has been eliminated as I have completely changed locations
-the possiblity of being the OS, instance of the OS installation, specific to 10.7.5 or 10.8.2 has been eliminated as I have booted from each
After all, I am thoroughly convinced this is a bug in the OS specifically related to the Mid 2011 iMac. If I am missing something, please let me know. I require a set up when sharing my internet connection from my iMac because of a VPN connection from work (although the VPN is not a factor in this troubleshooting).
Thanks