22
Nov

How to change default gateway in windows command line?

I’m sure you been in a situation, where you had to connect to both wireless and wired network on a windows PC. If the wired network is connected to your internal network which doesn’t have internet connectivity, then you are stuck. This is because Windows OS sets the default gateway to the wired network. Below is the command to change the default gateway to wireless networks.

To add default route with the default gateway address of 10.2.3.1, use the below command:

C:>ROUTE ADD 0.0.0.0 MASK 0.0.0.0 10.2.3.1

To make any route persistent after the reboots, you can add ‘-P’ argument to the route command.

Below are some more commands for your reference:

To print the Route information

C:>ROUTE PRINT

To add a route with 10.5.1.* traffic going to 10.2.3.1 gateway

C:>ROUTE ADD 10.5.1.0 MASK 255.0.0.0 10.2.3.1

To change the existing route of 10.5.1.* traffic to go to 10.5.1.1 gateway

C:>ROUTE CHANGE 10.5.1.0 MASK 255.0.0.0 10.5.1.1

Please use comments box to post any questions.

Please bookmark this site.

No Comments

No comments yet.

Leave a comment

Search

Sponsored Links

Your Ad Here