查看虚拟中心有效路由View virtual hub effective routes

可以在 Azure 门户中查看虚拟 WAN 中心的所有路由。You can view all routes of your Virtual WAN hub in the Azure portal. 本文将指导你完成查看有效路由的步骤。This article walks you through the steps to view effective routes. 有关虚拟中心路由的详细信息,请参阅关于虚拟中心路由For more information about virtual hub routing, see About virtual hub routing.

选择连接或路由表Select connections or route tables

  1. 导航到虚拟中心,然后选择“路由”。Navigate to your virtual hub, then select Routing . 在“路由”页上,选择“有效路由”。On the Routing page, select Effective Routes .
  2. 可以从下拉列表中选择“路由表”。From the dropdown, you can select Route Table . 如果看不到“路由表”选项,这意味着你在此虚拟中心中未设置自定义或默认路由表。If you don't see a Route Table option, this means that you don't have a custom or default route table set up in this virtual hub.

查看输出View output

页面输出显示以下字段:The page output shows the following fields:

  • 前缀:当前实体已知的地址前缀(从虚拟中心路由器了解)Prefix : Address prefix known to the current entity (learnt from the virtual hub router)
  • 下一跃点类型:可以是虚拟网络连接、VPN_S2S_Gateway、ExpressRouteGateway、远程中心或 Azure 防火墙。Next hop type : Can be Virtual Network Connection, VPN_S2S_Gateway, ExpressRouteGateway, Remote Hub, or Azure Firewall.
  • 下一跃点 :这是指向下一跃点的资源 ID 的链接,或只是显示“在链路上”以表示当前中心。Next hop : This is the link to the resource ID of the next hop, or simply shows On-link to imply the current hub.
  • :路由源的资源 ID。Origin : Resource ID of the routing source.
  • AS 路径:BGP 属性 AS(自治系统)路径会列出需要遍历的所有 AS 编号,以访问播发路径所附加到的前缀的位置。AS Path : BGP Attribute AS (autonomous system) path lists all the AS numbers that need to be traversed to reach the location where the prefix that the path is attached to, is advertised from.

示例Example

以下示例表中的值表示虚拟中心连接或路由表已了解 10.2.0.0/24(分支前缀)的路由。The values in the following example table imply that the virtual hub connection or route table has learned the route of 10.2.0.0/24 (a branch prefix). 由于“VPN 下一跃点类型”为 VPN_S2S_Gateway 并且“下一跃点”为 VPN 网关资源 ID,因此它已了解路由 。It has learned the route due to the VPN Next hop type VPN_S2S_Gateway with Next hop VPN Gateway resource ID. “路由源”指向发起 VPN 网关/路由表/连接的资源 ID。Route Origin points to the resource ID of the originating VPN gateway/Route table/Connection. “AS 路径”表示分支的 AS 路径。AS Path indicates the AS Path for the branch.

可以使用表底部的滚动条查看“AS 路径”。Use the scroll bar at the bottom of the table to view the "AS Path".

PrefixPrefix 下一跃点类型Next hop type 下一跃点Next hop 路由原点Route Origin AS 路径AS Path
10.2.0.0/2410.2.0.0/24 VPN_S2S_GatewayVPN_S2S_Gateway /subscriptions/<sub id>/resourceGroups/<resource group name>/providers/Microsoft.Network/vpnGateways/vpngw/subscriptions/<sub id>/resourceGroups/<resource group name>/providers/Microsoft.Network/vpnGateways/vpngw /subscriptions/<sub id>/resourceGroups/<resource group name>/providers/Microsoft.Network/vpnGateways/vpngw/subscriptions/<sub id>/resourceGroups/<resource group name>/providers/Microsoft.Network/vpnGateways/vpngw 2000020000

注意事项:Considerations:

  • 如果在“获取有效路由”输出中看到 0.0.0.0/0,则表示路由存在于一个路由表中。If you see 0.0.0.0/0 in the Get Effective Routes output, it implies the route exists in one of the route tables. 但是,如果此路由是为 Internet 设置的,则连接中需要附加标志“enableInternetSecurity”:true。However, if this route was set up for internet, an additional flag "enableInternetSecurity": true is required on the connection. 如果连接中的“enableInternetSecurity”标志为“false”,则 VM NIC 上的有效路由不会显示路由。The effective route on the VM NIC will not show the route if the "enableInternetSecurity" flag on the connection is "false".

  • 当你编辑虚拟网络连接、VPN 连接或 ExpressRoute 连接时,Azure 虚拟 WAN 门户中会显示“传播默认路由”字段。The Propagate Default Route field is seen in Azure Virtual WAN portal when you edit a virtual network connection, a VPN connection, or an ExpressRoute connection. 此字段指示 enableInternetSecurity 标志,该标志在默认情况下对于 ExpressRoute 和 VPN 连接始终为“false”,对于虚拟网络连接为“true”。This field indicates the enableInternetSecurity flag, which is always by default "false" for ExpressRoute and VPN connections, but "true" for virtual network connections.

  • 查看 VM NIC 上的有效路由时,如果将下一跃点视为“虚拟网络网关”,则在 VM 处于连接到虚拟 WAN 中心的分支中时,这会表示虚拟中心路由器。When viewing effective routes on a VM NIC, if you see the next hop as 'Virtual Network Gateway', that implies the Virtual hub router when the VM is in a spoke connected to a Virtual WAN hub.

  • 仅当虚拟中心至少连接到一种连接类型 (VPN/ER/VNET) 时,才会填充“虚拟中心路由表的有效路由”视图。View Effective routes for a virtual hub route table is populated only if the virtual hub has at least one type of connection (VPN/ER/VNET) connected to it.

后续步骤Next steps