Skip to content

Instantly share code, notes, and snippets.

@sverweij
Last active August 29, 2015 14:18
Show Gist options
  • Save sverweij/efe1ab3723e7bb76898d to your computer and use it in GitHub Desktop.
Save sverweij/efe1ab3723e7bb76898d to your computer and use it in GitHub Desktop.
Connection sharing on microsoft windows machines

TL;DR

netsh wlan set hostednetwork mode=allow "ssid=AIVDSurveilanceCar1" “key=PreferablyaVerylooongpassword” keyUsage=persistent
netsh wlan start hostednetwork

landline connection -> properties -> Sharing -> Share to Wireless Network Connection 2

Does not work with cisco VPN.

Slow explanation

Set up a hosted network

For this, open the command prompt as administrator and enter the following netsh command:

netsh wlan set hostednetwork mode=allow "ssid=AIVDSurveilanceCar1" “key=PreferablyaVerylongpassword” keyUsage=persistent

For the ssid a practical name is the name of your laptop. The password has to be between 8 and 63 characters long.

Now start the hosted network by entering:

netsh wlan start hostednetwork

Share the landline

Navigate to the network connection panel (Computer\All Control Panel Items\Network Connections. You'll see several network connections. At least one land line (probably named Local Area Connection) and two wireless ones (probably named Wireless Network Connection and Wireless Network Connection 2).

Open the properties of the land line and on the Sharing tab:

  • Check "Allow other network users to connect throught this computer's Internet connection"
  • For Home networking connection choose Wireless Network Connection 2

Test the network

From this point you should be able to connect to the ssid and access the landline.

Optional

Wireless Network Connection 2 standardly exposes a lot of services you don't need. Switch them off, they'll only bother you.

Stopping the network

You'll want to do this eventually:

netsh wlan stop hostednetwork

Duh (1)

The shared network gives access to everything you can access. Not only to the iPads you use for testing, but also to people on the street. Who impersonate you on the network. Although it takes some time, It is not very hard to crack WPA2 passwords.

  • Make sure to use a strong password and change it on a regular basis (netsh wlan set hostednetwork "key=NewandchangedLongkey")
  • Shut down the hosted network when you don't use it (netsh wlan stop hostednetwork)

Duh (2)

Your laptop has a hardware switch for wireless. Make sure it is not switched off.

Caveat: doesn't work with VPN

The cisco VPN software is (probably on purpose) incompatible with network sharing. As long as a hosted network is running it is not possible to log in. The VPN software doesn't give any warning, appears to work and behaves as if you entered a wrong number from your key. To make it work again, stop the hosted network and uncheck "Allow other network users to connect through this computer's Internet connection".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment