NetWiki

I can make net work

User Tools

Site Tools


windows:windows_routing

Windows Routing

It's often useful to use a wired laptop to test wifi somewhere else. You can RDP to it over a wired connection and then join wifi to make sure it's working correctly or to see first-hand whatever symptoms are showing up. The issue with this is that Windows will prefer the wired connection so I can't use the laptop's wifi to get to the internet or other resources, but I need the wired connection to access the laptop so I can't disconnect it. Routing to the rescue! I can add a route to the laptop so that it uses wired to reach my IP but uses wifi for everything else.

Note: Anyone can view the routing table but you need an admin CLI to make changes.

Warning: The following commands use example IPs. If you don't know what the real IPs are then you shouldn't be doing this.

Commands

route print -4

Will show you the current IPv4 routing table.

route add 203.0.113.67 mask 255.255.255.255 192.0.2.1

Will add a route to my IP address (203.0.113.67) via the wired default gateway (192.0.2.1). Add -p after “add” to make it persistent, meaning it will survive a reboot.

route delete 0.0.0.0

Will remove ALL the default routes, both the wired and the wifi.

route add 0.0.0.0 mask 0.0.0.0 198.51.100.1

Will add the wifi default route back to the routing table.

Timed Reboot

Similar to Cisco's reload in command, you can do a timed reload on Windows so that if you hose the routing table the laptop reboots and you can get in without sending someone to reboot for you.

shutdown /r /t 300

Will reboot in 300 seconds (5 minutes). Feel free to use 600 to give yourself a little more time. Surprisingly, this does not need an admin window.

shutdown /a

Will abort the shutdown if you made the change everything is still working.

windows/windows_routing.txt · Last modified: 2023-08-26 22:24 by dave

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki