The New-NetRoute cmdlet creates an IP route in the IP routing table. It specifies the destination prefix, and specifies an interface by using the interface alias or the interface index.
Parameters:
- AddressFamily (IPv4, IPv6)
It specifies the IP address family.
- CimSession
Run the cmdlet in a remote session or on a remote computer.
- DestinationPrefix
It specifies a destination prefix of an IP route.
- InterfaceAlias
It specifies the alias of a network interface.
- InterfaceIndex
It specifies the index of a network interface.
- NextHop
It specifies the next hop for the IP route.
- PolicyStore (ActiveStore, PersistentStore)
- PreferredLifetime
- Protocol
It specifies the type of routing protocol.
- Publish (No, Yes, Age)
It specifies the publish setting of an IP route.
- RouteMetric
It specifies an integer route metric for an IP route.
- ThrottleLimit
- ValidLifetime
- Confirm
It prompts for confirmation before running the cmdlet.
- WhatIf
It shows what would happen if the cmdlet runs.
Outputs:
Microsoft.Management.Infrastructure.CimInstance#root\StandardCimv2\MSFT_NetRoute
Examples :
New-NetRoute –Destinationprefix ‘0.0.0.0/0’ –InterfaceAlias ‘Ethernet0’ –NextHop 192.168.1.254
Be the first to comment on "New-NetRoute cmdlet"