Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

What is the command line that starts sharing the internet connection from LAN over Wi-Fi? I think it allows to set a specific network name and a password.

I remember it from some techie talk on a podcast, but they gave no specifics, and my friends told me it exists, though they couldn't remember it on the spot.

share|improve this question
    
Why the requirement for it being command line only? Will normal Internet Connection Sharing not work for you? –  Scott Chamberlain Apr 10 '13 at 3:19
    
I'm only interested in the command line execution of this feature. I'm sure other people will find it interesting too. –  user1306322 Apr 10 '13 at 4:05
add comment

1 Answer

up vote 7 down vote accepted

This feature is called hosted networks. On a Wi-Fi enabled computer running Windows 7 or later, use the following commands in an elevated command prompt:

  • netsh wlan set hostednetwork mode=MODE ssid=SSID key=KEY keyusage=KEYUSAGE
    Changes access point settings. mode can be allow or disallow, specifying whether the access point is enabled. ssid is the name of the network; key is the encryption key used for accessing the network. keyusage can be persistent or temporary, indicating whether the key is kept or discarded after one use (the default is persistent). Note that WPA2-AES is used.
  • netsh wlan start hostednetwork
    Starts the access point.
  • netsh wlan stop hostednetwork
    Stops the access point.
  • netsh wlan show hostednetwork
    Shows the status of the access point.

To allow Internet access through the access point, open the properties for the adapter that provides the Internet connection under Change adapter settings in the Network and Sharing Center, then enable Internet Connection Sharing to the Microsoft Virtual WiFi Miniport Adapter that is providing the wireless connection, usually Wireless Network Connection 2.

Note that the access point created using this procedure uses infrastructure mode. For more information and technical details about hosted networks, see http://msdn.microsoft.com/en-us/library/windows/desktop/dd815243%28v=vs.85%29.aspx.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.