Wednesday, November 04, 2009

Windows 7 includes soft-ap


All Windows 7 machines can become a wifi access-point, routing the connections over Ethernet or even over a client station connection on the same wifi adapter. This Slashdot article mentions this, but gets the facts slightly wrong (claiming that it's incomplete and that you need extra software). Instructions for doing this are below.

This is going to be bad, causing rogue access-points to proliferate in companies.

CONTEXT

Technically, this isn't really new. You could always setup ad-hoc wifi and connection-sharing, which is almost he same thing. Also, it's already possible on Mac OS X, Linux, Windows Mobile, and iPhones.

Yet, a full "access-point" sucks less than "ad-hoc" networking. Also, it can work over the same WiFi adapter. Thus, while you are connected to "gogoinflight" on the airplane, your friend can log onto your "buddy" access-point on your computer and share your connection.

And there is increasing reason to do this. On my last flight, I wanted to sync both my iPhone and use my notebook. I only had to pay "gogoinflight" once, but I had to keep logging in again each time I switched from one device to the other. I totally would've just enabled this feature on my notebook and synced my iPhone through a virtual access-point instead.

Note: It only supports WPA, therefore you can't make "evil twin" access-points out of this (although I bet there is a way to hack it to turn WPA off).

HOW IT WORKS

Windows 7 can create "virtual" wifi adapters based on the real adapters, with a unique MAC address and everything. This is similar to VAPs on Linux, which allows you to create one virtual adapter for logging onto an access-point, and another for running a soft-ap. The difference with Windows 7 is that it creates only a single virtual adapter for "hosted" mode -- no matter how many actual adapters you have in the system. It's called "Microsoft Virtual WiFi Miniport Adapter", with the same MAC address decremented by one.

Making it work is simply a matter of (1) configuring the SSID and WPA password, (2) configuring Internet Connection Sharing to bridge it with the network, and (3) turning it on.

WHY IT WORKS

Zune, and stuff like it.

Microsoft wants you to be able to transfer music/video from your computer to your Zune easily. This makes it easier.

It's not just soft-ap. Windows 7 allows a lot of other low-level functionality. For example, you can write applications that add custom "information elements" to the beacon and association packets sent when new wifi connection is setup. Thus, your desktop becomes not simply an "access-point", but a "media access-point".

Finally, by mandating this low-level functionality in wifi hardware drivers now, it means Windows 7 should seamlessly work with "Wi-Fi Direct" bluetooth-like functionality whenever that standard becomes solidified.

INSTRUCTIONS

STEP 0: Open a command-prompt with administrator privileges.

Click on Start menu, All Programs, Accessories, right-click on Command Prompt, select "Run as administrator"). Type in:

STEP 1: Configure the "hosted" interface:

netsh wlan set hostednetwork mode=allow ssid=Test key=letmein9

This example creates an access-point with an SSID of "Test", with a WPA password of "letmein9".

STEP 2: Configure Internet Connection Sharing (ICS)

Open up the networking control panel. Select the interface that currently has Internet connection (like your Ethernet or normal wifi), enable "Sharing", and then select the special "hosted" interface.

STEP 3: Start it

netsh wlan start hostednetwork

STEP 4: Enjoy

On your other devices (say, iPhone), connect to "Test" and give the WPA password of "letmein9".








Links:

20 comments:

Anonymous said...

FYI, I posted on this on Nov 3rd on my blog:
http://lituuslimacon.blogspot.com/2009/11/connectify-you-windows-7-pc- for-free.html

I had been using it to sync and make purchases from my Zune by connecting to my PC (HP tx2 w Realtek card) via the “hostednetwork” since a month or so and when I saw Connectify pop up everywhere in my Google Reader, I decided to post on it. My post is nowhere near as detailed or screenshot laden as yours though.

Not asking for credit, since this is publicly accessible info from MSDN. Just an FYI.

Unknown said...

There is a nifty little tool out there call Virtual Router Manager that provides a simple GUI interface to the process of setting up a soft-ap.

Link: http://bit.ly/3VQOal

Sam Bowne said...

I tried this on an Asus Eee 900HA and also with a USB external NIC from EDIMAX EW-7318Ug. It always fails after the 3rd step with "The hosted network couldn't be started. The group or resource is not in the correct state to perform the requested operation". From the other things I tried, I suspect I need to have a NIC with a full Windows 7 driver. If there's some way to do it with the stuff I have, I'd love to know!

Sam Bowne said...

I found another way to do it, with a wireless Ad Hoc network, which works on all the hardware I have tried. I wrote it up as a homework assignment for my students here.

iSingle said...

Then how to delete the virtrual wifi adapter?

Bagoes said...

hi... I just read your article, and I've tried it... and it works!!!
glad that I don't have to buy any USB Wifi or router to make my other devices go online...
but is there any way that I can change the key into WEP or WPA?
the key is always WPA2, and some my devices (such as NDS and PSP console) don't support WPA2...
thx for the answer...

India Forum said...

Thanks for the information on "ad-hoc"

Unknown said...

Thank you very much. Works perfect on my Windows 7 x64 Ultimate with Ralink 802.11n USB wlan card.

Unknown said...

Actually you guys forgot the most important step here i.e to successfully start the hosted network. This is how I did it :
Launch the command prompt with administrator privilage.
Type as below and you would see the output similar to me.
C:\Windows\system32>netsh wlan set hostednetwork mode=allow ssid=aryanwin7vwifi
key=loma#sexy#toma
The hosted network mode has been set to allow.
The SSID of the hosted network has been successfully changed.
The user key passphrase of the hosted network has been successfully changed.

C:\Windows\system32>netsh wlan start hostednetwork
THE MOST IMPORTANT THING HERE IS TO SET PATH TO \system32 before executing START command.
The hosted network started.
Now share your active internet connection to this Virtual WIFI.
ENJOY.

Anonymous said...

Is there any way to make this use an 802.11n 40 MHz channel / channel bonding? I have 150 Mbps and 300 Mbps capable adapters, but I'm stuck at 65 Mbps with the default 20 MHz channel.

mavimi said...

Sam was getting this error:
"The hosted network couldn't be started. The group or resource is not in the correct state to perform the requested operation."
I got it too. But I had set up a ad-hoc network with the same ssid (and keyword) as the virtual wifinetwork I was trying to set up. Once I changed the ssid of the virtual wifinetwork, it worked.

Anonymous said...

Latest Intel drivers add Windows 7 Virtual WiFi support

Intel WiFi Card : 32 BIT

http://downloadcenter.intel.com/Detail_Desc.aspx?agr=Y&DwnldID=18211&ProdId=3062&lang=eng

Intel WiFi Card : 64 BIT

http://downloadcenter.intel.com/Detail_Desc.aspx?agr=Y&DwnldID=18212&ProdId=3062&lang=eng

This Drivers Solve Following Problem When You Run Command

" netsh wlan set hostednetwork mode=allow ssid=Test key=password "

" netsh wlan start hostednetwork "


" The hosted network couldn't be started. The group or resource is not in the correct state to perform the requested opera tion. "

shikhar chhottra said...

i am not able to connect to the wireless network. the network "test" appears to have no active connection. please help!!

Anonymous said...

I got the error as below:


C:\Windows\system32>netsh wlan start hostednetwork
The hosted network couldn't be started.
The group or resource is not in the correct state to perform the requested opera
tion.


i downloaded the latest drivers but didnt work moreover my wificard named Intel(R) PRO/Wireless 3945ABG Network Connection is in the incompatible list of Virtual Router Manager...im using Compaq 610 with Windows 7 Ultimate 32 bitplz help..

Anonymous said...

Great! It works with Galaxy S2 and W7HP on ASUS U31SD.

Ranjan Purbey said...

People having trouble with a pop-up message saying this "The hosted network couldn't be started. The group or resource is not in the correct state to perform the requested operation" can try typing the following command:
C:\windows\system32\>netsh wlan set hostednetwork mode=allow
And then...
C:\windows\system32\>netsh wlan start hostednetwork
I think it'll work :)

S S said...

"The hosted network couldn't be started. The group or resource is not in the correct state to perform the requested operation"
why is this error coming in the command prompt? anyone pls help me.
i cant even configure the sharing option in the properties window of the existing network connection as there is no 2nd network connection.
kindly help me out how to create a wireless network connection with he microsoft wifi miniport adaptor for windows7 32-bit.
plz post the reply soon

Unknown said...

how can i change the password? it actually works! this rocks! thanks! :))

Unknown said...

when i turn off my laptop. then i turn it on, will i do this again? because after i shut down my laptop. then i turned it on, the connection i created was gone. so, i would have to follow these instructions again. help please.

Anonymous said...

do i really have to do the instructions again and again everytime i turn on my laptop? or is there any other way? but this is really great. thanks