一. 查看网卡名称
打开 cmd.exe 命令行,或者 Windows Terminal 查看要配置的网卡名称,比如 以太网
ipconfig
二. 配置网卡地址
$ 配置静态IP地址
netsh interface ip set address "以太网" static 10.10.10.22 255.255.255.0 10.10.10.1
$ 配置动态IP地址
netsh interface ip set address "以太网" dhcp
$ 查看IP地址
netsh interface ip show address "以太网"
$ 添加指定DNS
netsh interface ip add dnsservers "以太网" 114.114.114.114 index=1
netsh interface ip add dnsservers "以太网" 8.8.8.8 index=2
$ 添加动态DNS
netsh interface ip set dns "以太网" dhcp
$ 查看DNS
netsh interface ip show dns "以太网"