switch between dhcp and static ip in windows

dhcp:

netsh interface ip set address "本地连接 4" dhcp

ipconfig /release "本地连接 4"
ipconfig /renew "本地连接 4"



static ip:

rem netsh interface ip set address "本地连接 4" static 192.168.0.4 255.255.255.0 192.168.1.1 1
REM netsh interface ip set address "本地连接 4" static 192.168.2.4 255.255.255.0 none
netsh interface ip set address "本地连接 4" static 192.168.2.4 255.255.255.0 none

你可能感兴趣的:(switch between dhcp and static ip in windows)