Two small scripts let ip switch "drug to disease"

  
                

Friends who use a notebook with their home and family may have a problem. It is more troublesome to switch IP between multiple LANs. Although there are many IP switching tools, some are used. It's not very satisfactory, because I usually use a laptop between my home and the company, so I have a deep understanding of it. Today, I recommend the following 2 small scripts to your experience to ensure that you are sick immediately. except.

1 Switch to fixed IP

@echo off

netsh interface ip set address local static 192.168.0.84 255.255.255.0 192.168.0.254

netsh interface ip set dns local 192.168.0.254

netsh interface ip add dns local 202.106.196.115 index = 2

netsh interface ip add dns local 202.106.0.20 index = 3

2 switch to get IP automatically

@echo off

netsh interface ip set address name="local" source=dhcp

netsh interface ip set dns name= "local" source=dhcp

"local" is your local NIC name, or it may be "local connection", you need to replace it yourself. If it is a switch between two fixed IPs, change the second script yourself:)

In the dns setting, the first one is set, which means setting, the latter two are added, and you replace it yourself. Become a local dns server.

Often running back and forth with a laptop, you need to switch IP addresses frequently. As long as you master the above two small script methods, you no longer have to worry about switching IP addresses!

Copyright © Windows knowledge All Rights Reserved