Find-NetRoute

Find-NetRoute

Finds the best local IP address and the best route to reach a remote address.

Syntax

Parameter Set: Find0
Find-NetRoute -RemoteIPAddress <String> [-AsJob] [-CimSession <CimSession[]> ] [-InterfaceIndex <UInt32> ] [-LocalIPAddress <String> ] [-ThrottleLimit <Int32> ] [ <CommonParameters>]

Detailed Description

The Find-NetRoute cmdlet finds the best local IP address and the best route to reach a remote address. Specify the remote address to reach. You can also specify an interface and a local address to use to reach the remote address.

For more information about routing, see Chapter 5 - IP Routing (https://technet.microsoft.com/library/bb727001.aspx) in the TechNet library.

Parameters

-AsJob

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-CimSession<CimSession[]>

Runs the cmdlet in a remote session or on a remote computer. Enter a computer name or a session object, such as the output of a New-CimSession or Get-CimSession cmdlet. The default is the current session on the local computer.

Aliases

Session

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-InterfaceIndex<UInt32>

Specifies an index of a network interface. The cmdlet finds a route for this interface.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-LocalIPAddress<String>

Specifies a local IP address from which to find a route. You can specify a host address or a subnet address. You can also use a wildcard address, such as 0.0.0.0/0 for all IPv4 addresses, ::/0 for all IPv6 addresses, or ANY for all addresses.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-RemoteIPAddress<String>

Specifies a remote IP address to which to find a route. You can specify a host address or a subnet address. You can also use a wildcard address, such as 0.0.0.0/0 for all IPv4 addresses, ::/0 for all IPv6 addresses, or ANY for all addresses

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-ThrottleLimit<Int32>

Specifies the maximum number of concurrent operations that can be established to run the cmdlet. If this parameter is omitted or a value of 0 is entered, then Windows PowerShell® calculates an optimum throttle limit for the cmdlet based on the number of CIM cmdlets that are running on the computer. The throttle limit applies only to the current cmdlet, not to the session or to the computer.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

<CommonParameters>

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see    about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).

Inputs

The input type is the type of the objects that you can pipe to the cmdlet.

  • None

Outputs

The output type is the type of the objects that the cmdlet emits.

  • NetIPAddress, NetRoute

Examples

Example 1: Find a local address and route

This command finds a NetIPAddress object and NetRoute object to use to access the IP address 10.79.197.200. The command returns two objects. The first object is the local IP address. The second object is the local route that includes the selected connectivity path and next hop.

PS C:\> Find-NetRoute -RemoteIPAddress "10.79.197.200"

Get-NetRoute

New-NetRoute

Remove-NetRoute

Set-NetRoute