I'm trying to play a video game with my friends that requires a local wifi network that allows UDP broadcasts. The dorm wifi doesn't allow UDP broadcasts, so I'm trying to set up my laptop as a hotspot. Windows 10 by default allows you to share an internet connection over wifi, but you must have an internet connection to do so. Sharing the wifi connection results in a lot of problems such as constant disconnects, and I don't have access to an ethernet connection to share. Is there some way I can set up a wifi network without actually sharing an internet connection?
Windows – Use Windows 10 wifi hotspot with no internet connection
networkingwindows 10wireless-networking
Related Solutions
This can be done by setting up your windows machine as a very simple wireless access point, similar to the ad-hoc functionality, more difficult to set up but far more robust, i.e. any device that supports WiFi will be able to connect. It is known as 'hostednetwork' and uses the built-in Microsoft Virtual WiFi Adapter.
To set it up, bring up the elevated command prompt by pressing Win-key
, typing cmd
and hitting Ctrl-Shift-Enter
. Then enter the following command:
netsh wlan set hostednetwork mode=allow "ssid=<ssid>" “key=<passphrase>” keyUsage=persistent
Most options are quite self-explanatory, but you can get more info using netsh wlan help
. After executing this command, the hostednetwork will be stored permanently, but still needs to be started and stopped manually. You might want to create some sort of shortcut for the following commands:
netsh wlan start hostednetwork
netsh wlan stop hostednetwork
Note that these commands too must be run as admin.
At this point, a new item should have appeared in the 'network connections' section of the Windows network center. You can edit its properties, but the default settings should work just fine. Your phone should be able to detect the freshly made access point and connect to it, obtaining an IP-address in the 192.168.137.0/24 range. Don't worry though, this will not affect the wired connection on your computer, as they're both using different networks.
While a connection has been established, your pc will not allow machines on the wireless port to interface with any other ports and by extension, the internet. For this, you can use Internet Connection Sharing (ICS). Edit the properties of your wired interface, bring up the 'Sharing' tab, check the box to enable this feature and select the corresponding interface, the wireless AP that is. The interface is a bit buggy, you might need to revert, close the window and try again if you go wrong.
Voila, internet on your Android via your pc.
Found this solution for those who are wondering. First, I have the following in a .reg file (I'm aware that the last modification is not recommended by sys admins):
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Network Connections]
"NC_PersonalFirewallConfig"=dword:00000001
"NC_ShowSharedAccessUI"=dword:00000001
"NC_AllowNetBridge_NLA"=dword:00000001
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer]
"DisableBkGndGroupPolicy"=dword:00000001
Then I have these commands in a .bat file:
REM ----- Run regedit silently to add the necessary network sharing settings -----
regedit.exe /S NetworkSharingSetup.reg
REM ----- Add the hotspot -----
netsh wlan set hostednetwork mode=allow ssid=Hotspot1 key=123456
REM ----- Start the hotspot -----
netsh wlan start hostednetwork
REM ----- Show the hotspot details -----
netsh wlan show hostednetwork
timeout -t 10 /nobreak
REM ----- Bounce the Cellular connection -----
netsh interface set interface name="Cellular" admin=disabled
netsh interface set interface name="Cellular" admin=enabled
pause
I ran into an issue where, after starting the hostednetwork, my cellular connection kept connecting and immediately disconnecting in an infinite loop. I discovered that if I waited (timeout
) and bounced the connection, it fixed the issue. Not sure why the cellular connection got into this status or why the wait was required.
After creating this batch file, I create a shortcut to it, then right-click > Properties > Shortcut tab > Advanced > check the box for "Run as administrator". This is required for the lines where we bounce the cellular connection.
One final thing: During this process, the tablet was kept off the organization's domain.
Best Answer
Two resolutions. First being easier, second being overly complex that even I don't want to approach as it requires programming.
Resolution One: You use a hostednetwork if your wireless adapter is capable. (Usually they are capable.)
1.) Open an elevated command prompt. Win+X and choose CMD (Admin) OR type in "cmd" or "command prompt" into Windows Search by typing into Start Menu and then right click "Command Prompt" and select "Run As Administrator"
2.) Check if your system is capable run this command:
netsh wlan show drivers
. Scroll down toHosted network supported
. If it saysYes
you are in luck; ifNo
there is no easy alternative and don't continue.3.) Run the following command to allow and set up your hostednetwork but look below first.
Replace %ssid% with your Wifi or "Hotspot" Name or SSID. E.g.
ssid=MyGreatHotspot
. Replace %pass% with your Wifi or "Hotspot" Password. It must be 8 characters long at a minimum. E.g.key=strongPasswordsAreWEAK
.4.) After that run the command,
netsh wlan start hostednetwork
, to start the "Hotspot" broadcast. Right now you can play without internet connection after all devices connect. Remember to check IP addresses of all your individual devices in order to connect to each other. The hotspot's IP Address usually is "192.168.137.1".If you want to share your internet connection or for further reference, continue on:
5.) Open Run (Win + R) or by searching for Run and enter in
ncpa.cpl
, then press Enter. A new adapter has shown in the screen it should say something along the lines of "Microsoft Hosted Network Virtual Adapter". (Optional if you're OCD, rename that one if its says "L.A.N Connection* 15" or rather to like "Hotspot"). Right click the Internet Connect Source you want to share internet from and choose "Properties." Go to the "Sharing" Tab and checkmark or toggle on "Allow other network users to connect through this computer's Internet Connection." Apply, OK to save changes.6.) You should be all set! :)
If you want to stop the hostednetwork, in an elevated command prompt you run the command:
netsh wlan stop hostednetwork
Resolution Two: This is taken from this post from user Linard Arquit