在Windows 8上使用命令行将静态IP设置为DHCP
我的电脑是Windows8。 我使用命令行设置静态IP地址在Windows 8上使用命令行将静态IP设置为DHCP,windows,dhcp,static-ip-address,Windows,Dhcp,Static Ip Address,我的电脑是Windows8。 我使用命令行设置静态IP地址 netsh interface ipv4 set address name="Wired Ethernet Connection" source=static address=1.1.1.1 mask=1.1.1.1 gateway=1.1.1.1 和静态DNS netsh interface ipv4 add dnsserver name="Wired Ethernet Connection" address=1.1.1.1 ind
netsh interface ipv4 set address name="Wired Ethernet Connection" source=static address=1.1.1.1 mask=1.1.1.1 gateway=1.1.1.1
和静态DNS
netsh interface ipv4 add dnsserver name="Wired Ethernet Connection" address=1.1.1.1 index=1
其中1.1.1.1在这两种情况下仅用于演示,并由我的真实IP取代
编辑:自2018年起,1.1.1.1
现在用作DNS服务器
我现在想从静态IP改为DHCP 我试过了
netsh interface ipv4 set address name="Wired Ethernet Connection" source=dhcp
对于IP和
netsh interface ipv4 set dnsservers name="Wired Ethernet Connection" source=dhcp
对于DNS
但是,只有DNS命令起作用
然后,我与
ipconfig /all
它告诉我,DHCP已用于以太网。然而,我以前的IP仍然存在
有没有办法在命令行中将静态设置为DHCP
netsh interface ipv4 set address name="Wired Ethernet Connection" source=dhcp
ipconfig /renew Wired*
如果上面的ipconfig/renew
命令没有帮助,请尝试
netsh interface set interface name="Wired Ethernet Connection" admin=DISABLED
netsh interface ipv4 set address name="Wired Ethernet Connection" source=dhcp
netsh interface set interface name="Wired Ethernet Connection" admin=ENABLED
但是,从dhcp
获取的所有地址
、掩码
和网关
可能都与以前由源=静态
定义的匹配。ipconfig/ALL
输出中是否显示Lease-agained
和Lease-Expires
属性 适用于Windows 10
netsh interface ip set address "Ethernet" static 10.10.10.11 255.255.255.0
netsh interface ip set address "Ethernet" source=dhcp
我试过上面的命令,但拔下插头时,它们不起作用。(插上电源后,它们工作了。)没有插上电源时,我能做什么?或者我必须插入才能设置这些命令?未插入的接口无法连接到
dhcp
服务器,因此它会丢失所有租用的属性。。。租约应在重新封堵后续签,无需人工干预。