Hands-on lab
Assign a static IP address from PowerShell
Set a fixed IPv4 address on the Ethernet interface with New-NetIPAddress, then confirm the address, subnet mask, gateway, and DHCP state with ipconfig. This page teaches a job procedure. These are not exam questions, this is not a score predictor, and nothing here is taken from any certification exam.
Steps
- 1
Run New-NetIPAddress -InterfaceAlias "Ethernet" -IPAddress 192.0.2.50 -PrefixLength 24 -DefaultGateway 192.0.2.1.
- 2
Run ipconfig /all and confirm IPv4 address 192.0.2.50, subnet mask 255.255.255.0, default gateway 192.0.2.1, and DHCP Enabled as No.
What you should see
New-NetIPAddress shows 192.0.2.50 with prefix length 24 on Ethernet. ipconfig /all shows the same address, subnet mask 255.255.255.0, default gateway 192.0.2.1, and DHCP Enabled as No.
