Get-​Azure​Rm​Network​Watcher​Next​Hop

Gets the next hop from a VM.

Syntax

Get-AzureRmNetworkWatcherNextHop
   -DestinationIPAddress <String>
   -NetworkWatcher <PSNetworkWatcher>
   -SourceIPAddress <String>
   [-TargetNetworkInterfaceId <String>]
   -TargetVirtualMachineId <String>
   [<CommonParameters>]
Get-AzureRmNetworkWatcherNextHop
   -DestinationIPAddress <String>
   -NetworkWatcherName <String>
   -ResourceGroupName <String>
   -SourceIPAddress <String>
   [-TargetNetworkInterfaceId <String>]
   -TargetVirtualMachineId <String>
   [<CommonParameters>]

Description

The Get-AzureRmNetworkWatcherNextHop cmdlet gets the next hop from a VM. Next hop allows you to view the type of Azure resource, the associated IP address of that resource, and the routing table rule that is responsible for the route.

Examples

-- Example 1: Get the Next Hop when communicating with an Internet IP --

$nw = Get-AzurermResource | Where {$_.ResourceType -eq "Microsoft.Network/networkWatchers" -and $_.Location -eq "WestCentralUS" } 
$networkWatcher = Get-AzureRmNetworkWatcher -Name $nw.Name -ResourceGroupName $nw.ResourceGroupName 
$VM = Get-AzurermVM -ResourceGroupName ContosoResourceGroup -Name VM0
$Nics = Get-AzureRmNetworkInterface | Where {$_.Id -eq $vm.NetworkInterfaceIDs.ForEach({$_})}
Get-AzureRmNetworkWatcherNextHop -NetworkWatcher $networkWatcher -TargetVirtualMachineId $VM.Id -SourceIPAddress $nics[0].IpConfigurations[0].PrivateIpAddress  -DestinationIPAddress 204.79.197.200


NextHopIpAddress NextHopType RouteTableId
---------------- ----------- ------------
                 Internet    System Route

Get's the Next Hop for outbound communication from the primary Network Interface on the specified Virtual Vachine to 204.79.197.200 (www.bing.com)

Required Parameters

-DestinationIPAddress

Destination IP address.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-NetworkWatcher

The network watcher resource.

Type:PSNetworkWatcher
Position:Named
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False
-NetworkWatcherName

The name of network watcher.

Type:String
Aliases:Name
Position:Named
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False
-ResourceGroupName

The name of the network watcher resource group.

Type:String
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-SourceIPAddress

Source IP address.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-TargetVirtualMachineId

The target virtual machine ID.

Type:String
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False

Optional Parameters

-TargetNetworkInterfaceId

Target network interface Id.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

Inputs

Microsoft.Azure.Commands.Network.Models.PSNetworkWatcher

System.String

Outputs

Microsoft.Azure.Commands.Network.Models.PSNextHopResult

Notes

Keywords: azure, azurerm, arm, resource, management, manager, network, networking, network watcher, next, hop