Windows设置IP命令:修订间差异

来自三线的随记
无编辑摘要
无编辑摘要
 
第17行: 第17行:


To create an IPv4 address or IPv6 address, use the '''New-NetIPAddress''' cmdlet.
To create an IPv4 address or IPv6 address, use the '''New-NetIPAddress''' cmdlet.
/*设置IP和更改IP还分开了?令人窒息*/

2018年10月8日 (一) 09:12的最新版本

netsh

netsh interface ip set address "以太网 5" static 192.168.62.5 255.255.255.0 192.168.62.254

netsh interface ip set address "以太网 5" dhcp

powershell

Get-NetIPInterface 获取index

New-NetIPAddress -InterfaceIndex 17 -IPAddress 192.168.62.5 -PrefixLength 24 -DefaultGateway 192.168.62.254

Set-NetIPAddress -InterfaceIndex 17 -IPAddress 192.168.0.1 -PrefixLength 24

powershell --> comment

The Set-NetIPAddress cmdlet modifies IP address configuration properties of an existing IP address.

To create an IPv4 address or IPv6 address, use the New-NetIPAddress cmdlet.

/*设置IP和更改IP还分开了?令人窒息*/