Bridging wifi and ethernet in windows

December 17, 2024

The problem

One day I am setting up my remote dev enrivroment via cabled connectiion with my laptop, and I wanted internet access to my dev machine, but both the remote machine and my laptop are conected to an internal network. Then I realised my laptop is also connected to internet via wifi, that raises the question:

In Windows 11, how to use the bridging feature to share an Ethernet port (connected via cable) as a LAN port to another device, while already being connected to an external network via Wi-Fi?

My Solution

  1. Bridging the wifi adapter and the cabled network adapter in control panel.
  2. Set both machine to make them in the same local subnet.
  3. Set network gateway on the dev machine to the laptop's ip.
  4. Set a route rule on laptop's cabled network interface, to send all packages toward wifi network interface since it's not in the same subnet.
  5. Alternativly, set the wifi NIC to be in the same subnet since its connected by the net bridge

Conclusion What is net bridge

Net bridge is a net traffic control device the does not physically seperate NICs on default unlike switch or router, but it can filter broadcast network traffic and seperate subnets by setting.

© 2024 borui. All rights reserved. This content may be freely reproduced, displayed, modified, or distributed with proper attribution to borui and a link to the article: borui (2024-12-17). Bridging wifi and ethernet in windows. https://caiborui.com/blog/2024-12-17-en-network-bridge-set-up

@misc{borui2024-2a67b472,
  author = {borui},
  title = {{Bridging wifi and ethernet in windows}},
  year = {2024},
  publisher = {borui's blog},
  url = {https://caiborui.com/blog/2024-12-17-en-network-bridge-set-up}
}