你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
Test-AzNetworkWatcherConnectivity
返回指定源 VM 和目标的连接信息。
语法
Test-AzNetworkWatcherConnectivity
-NetworkWatcher <PSNetworkWatcher>
-SourceId <String>
[-SourcePort <Int32>]
[-DestinationId <String>]
[-DestinationAddress <String>]
[-DestinationPort <Int32>]
[-ProtocolConfiguration <PSNetworkWatcherProtocolConfiguration>]
[-AsJob]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Test-AzNetworkWatcherConnectivity
-NetworkWatcherName <String>
-ResourceGroupName <String>
-SourceId <String>
[-SourcePort <Int32>]
[-DestinationId <String>]
[-DestinationAddress <String>]
[-DestinationPort <Int32>]
[-ProtocolConfiguration <PSNetworkWatcherProtocolConfiguration>]
[-AsJob]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Test-AzNetworkWatcherConnectivity
-Location <String>
-SourceId <String>
[-SourcePort <Int32>]
[-DestinationId <String>]
[-DestinationAddress <String>]
[-DestinationPort <Int32>]
[-ProtocolConfiguration <PSNetworkWatcherProtocolConfiguration>]
[-AsJob]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
说明
Test-AzNetworkWatcherConnectivity cmdlet 返回指定源 VM 和目标的连接信息。 如果无法建立源与目标之间的连接,cmdlet 将返回有关该问题的详细信息。
示例
示例 1:测试从 VM 到网站的网络观察程序连接
Test-AzNetworkWatcherConnectivity -NetworkWatcherName NetworkWatcher -ResourceGroupName NetworkWatcherRG -SourceId "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ContosoRG/providers/Microsoft.Compute/virtualMachines/MultiTierApp0" -DestinationAddress "bing.com" -DestinationPort 80
ConnectionStatus : Reachable
AvgLatencyInMs : 4
MinLatencyInMs : 2
MaxLatencyInMs : 15
ProbesSent : 15
ProbesFailed : 0
Hops : [
{
"Type": "Source",
"Id": "f8cff464-e13f-457f-a09e-4dcd53d38a85",
"Address": "10.1.1.4",
"ResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ContosoRG/provi iders/Microsoft.Network/networkInterfaces/appNic0/ipConfigurations/ipconfig1",
"NextHopIds": [
"1034b1bf-0b1b-4f0a-93b2-900477f45485"
],
"Issues": []
},
{
"Type": "Internet",
"Id": "1034b1bf-0b1b-4f0a-93b2-900477f45485",
"Address": "13.107.21.200",
"ResourceId": "Internet",
"NextHopIds": [],
"Issues": []
}
]
在此示例中,我们测试从 Azure 中的 VM 到 www.bing.com 的连接。
示例 2
返回指定源 VM 和目标的连接信息。 (自动生成)
Test-AzNetworkWatcherConnectivity -DestinationAddress 'bing.com' -DestinationPort 80 -NetworkWatcher <PSNetworkWatcher> -SourceId '/subscriptions/00000000-0000-0000-0000-00000000000000000/resourceGroups/ContosoRG/providers/Microsoft.Compute/virtualMachines/MultiTierApp0'
参数
-AsJob
在后台运行 cmdlet
类型: | SwitchParameter |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-DefaultProfile
用于与 Azure 通信的凭据、帐户、租户和订阅。
类型: | IAzureContextContainer |
别名: | AzContext, AzureRmContext, AzureCredential |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-DestinationAddress
要尝试连接的资源的 IP 地址或 URI。
类型: | String |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-DestinationId
要尝试连接的资源的 ID。
类型: | String |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-DestinationPort
将对其执行检查连接的端口。
类型: | Int32 |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-Location
网络观察程序的位置。
类型: | String |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | False |
接受通配符: | False |
-NetworkWatcher
网络观察程序资源。
类型: | PSNetworkWatcher |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | True |
接受通配符: | False |
-NetworkWatcherName
网络观察程序的名称。
类型: | String |
别名: | Name |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | True |
接受通配符: | False |
-ProtocolConfiguration
将对其执行检查连接的协议配置。
类型: | PSNetworkWatcherProtocolConfiguration |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-ResourceGroupName
网络观察程序资源组的名称。
类型: | String |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | True |
接受通配符: | False |
-SourceId
将从中启动连接检查的资源的 ID。
类型: | String |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | True |
接受通配符: | False |
-SourcePort
将从中执行连接检查的源端口。
类型: | Int32 |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | True |
接受通配符: | False |
输入
输出
备注
关键字:azure, azurerm, arm, 资源, 连接, 管理, 管理器, 网络, 网络, 网络观察程序
相关链接
- New-AzNetworkWatcher
- Get-AzNetworkWatcher
- Remove-AzNetworkWatcher
- Get-AzNetworkWatcherNextHop
- Get-AzNetworkWatcherSecurityGroupView
- Get-AzNetworkWatcherTopology
- Get-AzNetworkWatcherTroubleshootingResult
- New-AzNetworkWatcherPacketCapture
- New-AzPacketCaptureFilterConfig
- Get-AzNetworkWatcherPacketCapture
- Remove-AzNetworkWatcherPacketCapture
- Stop-AzNetworkWatcherPacketCapture
- Start-AzNetworkWatcherResourceTroubleshooting
- New-AzNetworkWatcherProtocolConfiguration
- Test-AzNetworkWatcherIPFlow
- Test-AzNetworkWatcherConnectivity
- Stop-AzNetworkWatcherConnectionMonitor
- Start-AzNetworkWatcherConnectionMonitor
- Set-AzNetworkWatcherConnectionMonitor
- Set-AzNetworkWatcherConfigFlowLog
- Remove-AzNetworkWatcherConnectionMonitor
- New-AzNetworkWatcherConnectionMonitor
- Get-AzNetworkWatcherReachabilityReport
- Get-AzNetworkWatcherReachabilityProvidersList
- Get-AzNetworkWatcherFlowLogStatus
- Get-AzNetworkWatcherConnectionMonitorReport
- Get-AzNetworkWatcherConnectionMonitor