Quantcast
Channel: Windows PowerShell Forum
Viewing all articles
Browse latest Browse all 2562

Change default gateway using *netipaddress* cmdlet

$
0
0

Hi, is there a way to change the DFG after the IP is assigned to an adapter?

I am using Server 2012. I created a new IP using "new-netipaddress -Ipaddress 1.2.3.4 -prefixlength 24 -interfaceindex 10". I have forgotten to add the -defaultgateway parameter in the command. IP address was sucessfully assigned, but I cannot figure out a way to change/add a default gateway.

Does anyone know how to do it via native powershell cmdlets (no gwmi, functions or scripts)?

Cheers


Viewing all articles
Browse latest Browse all 2562

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>