比如我电脑有这样2个网卡(注意网卡名称)
1.启用/禁用网卡
netsh interface set interface JBW disabled
netsh interface set interface wifi enabled
(请将蓝色部分替换为你实际网卡的名称)
2.修改网卡IP地址
netsh interface ipv4 set address name="JBW" source=static addr=192.168.100.192 mask=255.255.255.0 gateway=192.168.100.14 gwmetric=0 >nul
(请将蓝色部分替换为你实际网卡信息)
3.修改DNS服务器(首选和备用)
netsh interface ipv4 set dns name="JBW" source=static addr=192.168.100.2 register=PRIMARY
netsh interface ipv4 add dns name="JBW" addr=114.114.114.114
(请将蓝色部分替换为你实际网卡信息)
4.查看IP配置是否生效
ipconfig /all