My lab has two types of networks: Iron Tong network, which can be used to access websites outside China. However, it is slow to access the CERNET and cannot access libraries and forums in the school. The other is CERNET, access to CERNET is fast, and you can access libraries and forums on campus, but you cannot access websites outside China.
You can't have both the fish and the bear's paw! Because I often use library resources and on-campus forums, and frequently access foreign websites, I always switch between these two networks. In this way, you have to use the Windows dialog box each time. It takes several steps to complete the operation, and it is too time-consuming.
To switch the two networks in our lab, you only need to modify the gateway and DNS, so I found a simple method that greatly saves the switching time. The method is as follows:
Copy the following code, such as Notepad, and save it as "Iron Tong. Bat"
Netsh interface IP Set address local connection static 192.168.0.107 255.255.255.0 192.168.0.1 1
Netsh interface IP Set DNS local connection static 192.168.0.1
Copy the following code as Notepad and save it as "CERNET. Bat"
Netsh interface IP Set address local connection static 192.168.0.107 255.255.255.0 192.168.0.2 1
Netsh interface IP Set DNS local connection static 192.168.0.2
Explanation: The static line is followed by an IP address, subnet mask, default gateway, and parameter 1.
The second line is static followed by DNS
Then, when switching, you only need to double-click the corresponding file.
If you have any questions in this article, you can contact me: hjhinternet@163.com