Windows-10-Based Dual Wireless Router
by OstrichCraft in Circuits > Microsoft
584 Views, 5 Favorites, 0 Comments
Windows-10-Based Dual Wireless Router
This article shows how to set up a Windows 10 machine as a dual wireless router, where both upstream and downstream networks for the internet are connected via two separate wireless cards. Step 1 shows how the routing is done using hosted network mode, and how to automate this process after computer reboots. Step 2 shows how to configure the hardware settings for the router to work reliably, which also serves as a troubleshooting checklist.
Hosted Network Mode Settings
Step 1: Know the scope. The scope of this project is when both upstream and downstream are wireless networks. If you had a wired internet and needed to share it through a wireless card, you could have used the Windows Settings >> Network and Internet >> Mobile hotspot. Windows 10 hotspot only allows local and internet on the same adapter, which cuts the throughput in half, so we will use hosted network instead. Another alternative is if one of your Wi-Fi cards has proprietary software that allows internet sharing, you can use that feature directly.
Step 2: Verify the two Wi-Fi cards meet certain requirements. These requirements stem from the hosted network feature in addition to the internet connection sharing feature, which are both provided natively in Windows 10. The hosted network feature relies on the Wi-Fi card driver, so make sure it is supported on the Wi-Fi card sharing the internet to other devices, and it is not required on the Wi-Fi card established as an internet client. You can use the following command to check for hosted network mode support.
==================CODE=====================
netsh wlan show driver
==================CODE=====================
Step 3: Connect to internet as you would normally do on the adapter established as internet client, and you can choose for it to "connect automatically" once within range. In case the internet drops or you need to change the Wi-Fi profile, you can re-connect as you would normally do.
Step 4: Enable the hosted network mode. By using the following code, you will temporarily disable the adapter established as an internet client, and the hosted network mode will be assigned to the other adapter(s) to form a new network. To do this, type the following code in an elevated/admin command window (you may use WinKey+X >> Command Prompt Admin). In this case, "Wi-Fi N" should be replaced with the correct adapter that connects as internet client and should not be assigned host mode.
==================CODE=====================
netsh interface set interface name="Wi-Fi N" admin=disabled
netsh wlan stop hostednetwork
netsh wlan set hostednetwork mode=allow ssid=SetYourSsid key=SetYourKey
netsh wlan start hostednetwork
netsh interface set interface name="Wi-Fi N" admin=enabled
==================CODE=====================
Step 5: If the hosted network mode can be enabled successfully, we can put those codes into task scheduler and have it triggered by computer log on. Task scheduler is a Windows tool and can be invoked by "taskschd.msc", and you need to create a new task for this. This task needs to use the user account "SYSTEM" and run "with the highest privilege", and you can enable the LogonTrigger or any CalendarTrigger. In the Actions tab, enter the commands one by one, where "netsh" is the program name and the rest are arguments.
Step 6: After the hosted network is created, configure internet connection sharing. There will be a new virtual adapter called local area connection*N, and we will need to notice this name when applying the internet connection sharing feature. Now open the Network and internet settings >> "Change adapter options" (or through Control Panel\Network and Internet\Network Connections), right click on the card that has internet (established as internet client) >> sharing >> allow others to connect >> select the local area connection*N that is just created from the dropdown menu. Notice that internet connection sharing is a separate feature from the hosted network. Also, after major windows updates, the virtual hosted adapter name may change, so you will need to re-select the correct created network from the sharing options (and check power saving features too, see below).
Step 7: Once internet connection sharing is set, the router should begin to work, and you can do a speed test from another device. You can also check for information and monitor connected devices using the following code on the router machine.
==================CODE=====================
netsh wlan show hostednetwork
netsh wlan show hostednetwork setting=security
echo Connected clients
arp -a | findstr -i 192.168.137 | findstr /V 255 | findstr /V 192.168.137.1
==================CODE=====================
Hardware Configuration and Slow Router Troubleshoot
Disable the adapter's power saving feature. This applies to both Wi-Fi cards and also the Microsoft Hosted Network Virtual Adapter that represents the newly generated network. The setting is in device manager >> choose device >> adapter option.
Disable the power saving of the hard drive. The setting is in control panel >> power options >> select a plan (I only have 1 plan) >> change settings >> change advanced settings >> hard disk. I would also chkdsk my c: drive, and removed the MS volume shadow copy provider through registry.
Disable the power saving of the USB hub.
Disable LLDP protocol (not LLTD) in the Wi-Fi adapter properties.
Disable Window Auto Tuning with this code: netsh interface tcp set global autotuninglevel=disabled
In device manager, view >> show hidden devices, then disable all adapters called Microsoft Wi-Fi Direct Virtual Adapter #N, and uninstall any direct virtual adapter that is not connected at the moment. Also disable the wired LAN card if any. Enable the Microsoft Hosted Network Virtual Adapter.
To prevent intermittent internet drops, install the tool from TMeter.ru. This tool will limit the bandwidth preemptively to avoid traffic burst or congestion which may cause internet drop. This tool is free for basic use, and it can be configured as follows. First, open TMeter admin console and pick the relevant adapters in Services > Network Interfaces. You may set the internet adapter as public and others as private. Second, the only filter needed in Configuration >> Filterset is "All traffic", where we enable speed limit in Kbyte=kbps/8 according to the ISP plan's download speed. As an optional precision control mechanism, I also set the destination of that rule as my soft router's subnet or for destination to be exactly swapped with source. These are detailed in the attached screenshots.
The network settings are stored on disk in a sub-directory within C:\ProgramData\Microsoft, so make sure permissions and ownership are set correctly.
Do not hide the Wi-Fi antenna deep inside a cupboard or a cave.
Restart the computer after modifying all the settings.
You can also share printer through the hosted network. The printer name is set in printer setting >> sharing tab. You may also need to turn off password protected sharing on the router computer.