[原创]命令行快速切换IP
将以下命令存储为.bat/.cmd文件,即可实现快速切换IP。
// 将“本地连接”设置为自动获取IP
@netsh interface ipv4 set address "本地连接" dhcp
// 为“本地连接”设置固定IP
@netsh interface ipv4 set address "本地连接" static 192.168.0.2 255.255.255.0 192.168.0.1
// 移除“本地连接”全部DNS
@netsh interface ipv4 delete dnsservers "本地连接" all
// 为“本地连接”添加DNS
@netsh interface ipv4 add dnsservers "本地连接" 192.168.0.1