Windows设置IP命令:修订间差异
来自三线的随记
(创建页面,内容为“=== 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 === p…”) |
小无编辑摘要 |
||
(未显示同一用户的1个中间版本) | |||
第11行: | 第11行: | ||
Set-NetIPAddress -InterfaceIndex 17 -IPAddress 192.168.0.1 -PrefixLength 24 | Set-NetIPAddress -InterfaceIndex 17 -IPAddress 192.168.0.1 -PrefixLength 24 | ||
=== powershell --> comment === | ==== powershell --> comment ==== | ||
__强显目录__ | |||
[[分类:Windows]] | |||
The '''Set-NetIPAddress''' cmdlet modifies IP address configuration properties of an existing IP address. | 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. | 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还分开了?令人窒息*/