Here’s a situation that comes up more than you’d think: you need to plug your laptop into a device that isn’t on the internet yet. Maybe it’s a new router you’re configuring, a lab switch or an appliance’s management port. The second you plug in the Ethernet cable, Windows decides the wired connection is the better route and your internet drops, even though Wi-Fi is still connected. This happened to me while I was setting up a new router at home, and the fix is a quick interface metric change in PowerShell.
Why it happens
Windows gives every network interface a metric, and when more than one interface has a default gateway, it sends traffic out the one with the lowest number. By default the metric is set automatically based on link speed, so a gigabit Ethernet connection almost always beats Wi-Fi. That’s great normally, but not when the wired side has no way out to the internet.
The fix is to set the metrics by hand so Wi-Fi wins. You can still reach the device on the wired side because its subnet is directly connected; only your internet-bound traffic stays on Wi-Fi.
Check the current metrics
Open PowerShell as an administrator and see what you’ve got:
Get-NetIPInterface -AddressFamily IPv4 |
Where-Object ConnectionState -eq 'Connected' |
Sort-Object InterfaceMetric |
Format-Table InterfaceAlias, InterfaceIndex, InterfaceMetric, AutomaticMetric
Note the exact names in the InterfaceAlias column. They’re usually Wi-Fi and Ethernet, but docks and USB adapters often show up as something like Ethernet 3.
Make Wi-Fi the preferred route
# Lower number wins
Set-NetIPInterface -InterfaceAlias 'Wi-Fi' -AddressFamily IPv4 -InterfaceMetric 10
Set-NetIPInterface -InterfaceAlias 'Ethernet' -AddressFamily IPv4 -InterfaceMetric 100
Setting a manual metric turns off the automatic metric for that interface. Run the check command again to confirm Wi-Fi now has the lower number. Your internet should stay on Wi-Fi, and you can still browse to the device on the wired side by its IP address.
If you want to confirm which way the traffic is going, this shows the interface Windows will use to reach the internet:
Find-NetRoute -RemoteIPAddress 1.1.1.1 | Select-Object -First 1 InterfaceAlias
Put it back when you’re done
Don’t forget this part. If you leave the manual metrics in place, your laptop will keep preferring Wi-Fi even when you’re docked at your desk on a good wired connection.
Set-NetIPInterface -InterfaceAlias 'Wi-Fi' -AddressFamily IPv4 -AutomaticMetric Enabled
Set-NetIPInterface -InterfaceAlias 'Ethernet' -AddressFamily IPv4 -AutomaticMetric Enabled
That hands control back to Windows, and the metrics go back to being based on link speed. The same trick works on servers with multiple NICs where only one should carry the default route, though on a server you’ll usually want to fix the gateway configuration instead.

Leave a Reply