< Back

Get-AzureRmNetworkWatcherNextHop

Tue Jan 29, 2019 9:54 pm

NAME Get-AzureRmNetworkWatcherNextHop



SYNOPSIS

Gets the next hop from a VM.





SYNTAX

Get-AzureRmNetworkWatcherNextHop [-AsJob] [-DefaultProfile <IAzureContextContainer>] -DestinationIPAddress <String> -NetworkWatcher

<PSNetworkWatcher> -SourceIPAddress <String> [-TargetNetworkInterfaceId <String>] -TargetVirtualMachineId <String> [<CommonParameters>]



Get-AzureRmNetworkWatcherNextHop [-AsJob] [-DefaultProfile <IAzureContextContainer>] -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.





PARAMETERS

-AsJob [<SwitchParameter>]

Run cmdlet in the background



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-DefaultProfile <IAzureContextContainer>

The credentials, account, tenant, and subscription used for communication with azure.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-DestinationIPAddress <String>

Destination IP address.



Required? true

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-NetworkWatcher <PSNetworkWatcher>

The network watcher resource.



Required? true

Position? named

Default value None

Accept pipeline input? True (ByValue)

Accept wildcard characters? false



-NetworkWatcherName <String>

The name of network watcher.



Required? true

Position? named

Default value None

Accept pipeline input? True (ByValue)

Accept wildcard characters? false



-ResourceGroupName <String>

The name of the network watcher resource group.



Required? true

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-SourceIPAddress <String>

Source IP address.



Required? true

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-TargetNetworkInterfaceId <String>

Target network interface Id.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-TargetVirtualMachineId <String>

The target virtual machine ID.



Required? true

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).



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



-- 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)







RELATED LINKS

Online Version: https://docs.microsoft.com/en-us/powers ... hernexthop

New-AzureRmNetworkWatcher

Get-AzureRmNetworkWatcher

Remove-AzureRmNetworkWatcher

Test-AzureRmNetworkWatcherIPFlow

Get-AzureRmNetworkWatcherSecurityGroupView

Get-AzureRmNetworkWatcherTopology

Start-AzureRmNetworkWatcherResourceTroubleshooting

New-AzureRmNetworkWatcherPacketCapture

New-AzureRmPacketCaptureFilterConfig

Get-AzureRmNetworkWatcherPacketCapture

Remove-AzureRmNetworkWatcherPacketCapture

Stop-AzureRmNetworkWatcherPacketCapture