Dela via


Get-AzureRmNetworkWatcherNextHop

Hämtar nästa hopp från en virtuell dator.

Varning

AzureRM PowerShell-modulen är officiellt inaktuell från och med den 29 februari 2024. Användare rekommenderas att migrera från AzureRM till Az PowerShell-modulen för att säkerställa fortsatt support och uppdateringar.

Även om AzureRM-modulen fortfarande kan fungera, underhålls den inte längre eller stöds, vilket gör att användaren kan välja och riskera fortsatt användning. Se våra migreringsresurser för vägledning om övergången till Az-modulen.

Syntax

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

Description

Cmdleten Get-AzureRmNetworkWatcherNextHop får nästa hopp från en virtuell dator. Med Nästa hopp kan du visa typen av Azure-resurs, den associerade IP-adressen för resursen och routningstabellregeln som ansvarar för vägen.

Exempel

Exempel 1: Hämta nästa hopp när du kommunicerar med en Internet-IP-adress

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

Parametrar

-AsJob

Kör cmdlet i bakgrunden

Typ:SwitchParameter
Position:Named
standardvärde:None
Obligatorisk:False
Accept pipeline input:False
Accept wildcard characters:False

-DefaultProfile

Autentiseringsuppgifter, konto, klientorganisation och prenumeration som används för kommunikation med Azure.

Typ:IAzureContextContainer
Aliases:AzureRmContext, AzureCredential
Position:Named
standardvärde:None
Obligatorisk:False
Accept pipeline input:False
Accept wildcard characters:False

-DestinationIPAddress

Mål-IP-adress.

Typ:String
Position:Named
standardvärde:None
Obligatorisk:True
Accept pipeline input:False
Accept wildcard characters:False

-Location

Plats för nätverksbevakaren.

Typ:String
Position:Named
standardvärde:None
Obligatorisk:True
Accept pipeline input:False
Accept wildcard characters:False

-NetworkWatcher

Nätverksbevakarresursen.

Typ:PSNetworkWatcher
Position:Named
standardvärde:None
Obligatorisk:True
Accept pipeline input:True
Accept wildcard characters:False

-NetworkWatcherName

Namnet på nätverksbevakaren.

Typ:String
Aliases:Name
Position:Named
standardvärde:None
Obligatorisk:True
Accept pipeline input:True
Accept wildcard characters:False

-ResourceGroupName

Namnet på resursgruppen network watcher.

Typ:String
Position:Named
standardvärde:None
Obligatorisk:True
Accept pipeline input:True
Accept wildcard characters:False

-SourceIPAddress

Källans IP-adress.

Typ:String
Position:Named
standardvärde:None
Obligatorisk:True
Accept pipeline input:False
Accept wildcard characters:False

-TargetNetworkInterfaceId

Målnätverksgränssnitts-ID.

Typ:String
Position:Named
standardvärde:None
Obligatorisk:False
Accept pipeline input:False
Accept wildcard characters:False

-TargetVirtualMachineId

Mål-ID:t för den virtuella datorn.

Typ:String
Position:Named
standardvärde:None
Obligatorisk:True
Accept pipeline input:True
Accept wildcard characters:False

Indata

PSNetworkWatcher

Parametrar: NetworkWatcher (ByValue)

String

Parametrar: NetworkWatcherName (ByValue)

Utdata

PSNextHopResult

Kommentarer

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