英文:
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
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论