如何检查Azure VMSS中的有效路由?

huangapple go评论52阅读模式
英文:

How to check effective routes in Azure VMSS?

问题

我有一个部署在虚拟网络子网内的 VMSS。我想要检查此 VMSS 上所有有效的路由,以进行网络故障排除,但我找不到任何查看它的选项。

对于虚拟机,可以在 Azure 门户中查看网络接口页面上的有效路由。

任何帮助将不胜感激。

英文:

I have a VMSS deployed in a subnet inside VNet. I want to check all the effective routes available on this VMSS for network troubleshooting, but I cannot find any options to view it.

For VMs, one can easily see the Effective Routes on the Network Interface's page in Azure Portal.

Any help would be much appreciated.

答案1

得分: 1

你可以使用PowerShell和Get-AzEffectiveRouteTable cmdlet来实现这一点。

$ResourceGroupName = "你的资源组名称"
$VMMSNicName = "你的VMSS网络接口NIC名称"

$VMSSNic = Get-AzNetworkInterface `
    -ResourceGroupName $ResourceGroupName `
    | Where-Object {$_.Name -like "$VMMSNicName*"} | Select-Object -First 1 
# 我假设第一个将是VMSS NICS之一。

Get-AzEffectiveRouteTable `
    -NetworkInterfaceName $VMSSNic.name `
    -ResourceGroupName $ResourceGroupName | ft -AutoSize

祝好,Alistair

英文:

You can achieve this using PowerShell and the Get-AzEffectiveRouteTable cmdlet

$ResourceGroupName = "YourResourceGroup"
$VMMSNicName = "YourVMSSNetworkInterfaceNICName"

$VMSSNic = Get-AzNetworkInterface `
    -ResourceGroupName $rgname `
    | Where-Object {$_.Name -like "$vmmsnicname*"} | Select-Object -First 1 
# I am making the assumption that the first one will be the one of the VMSS NICS.

Get-AzEffectiveRouteTable `
    -NetworkInterfaceName $VMSSNic.name `
    -ResourceGroupName $ResourceGroupName | ft -AutoSize

kind regards

Alistair

huangapple
  • 本文由 发表于 2023年6月1日 14:09:33
  • 转载请务必保留本文链接:https://go.coder-hub.com/76379106.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定