配置用于 Microsoft 对等互连的路由筛选器:Azure 门户Configure route filters for Microsoft peering: Azure portal

路由筛选器是通过 Microsoft 对等互连使用部分受支持服务的一种方法。Route filters are a way to consume a subset of supported services through Microsoft peering. 本文中的步骤可帮助配置和管理 ExpressRoute 线路的路由筛选器。The steps in this article help you configure and manage route filters for ExpressRoute circuits.

可以通过 Microsoft 对等互连访问 Azure 服务(如存储和 SQL DB)。Azure services such as storage and SQL DB are accessible through Microsoft peering. 如果在 ExpressRoute 线路中配置 Microsoft 对等互连,则会通过建立的 BGP 会话播发与这些服务相关的所有前缀。When Microsoft peering is configured in an ExpressRoute circuit, all prefixes related to these services are advertised through the BGP sessions that are established. 每个前缀附加有 BGP 团体值,以标识通过该前缀提供的服务。A BGP community value is attached to every prefix to identify the service that is offered through the prefix.

如需连接所有服务,则应通过 BGP 播发大量前缀。If you require connectivity to all services, a large number of prefixes are advertised through BGP. 这会显著增加网络中路由器所维护路由表的大小。This significantly increases the size of the route tables maintained by routers within your network. 如果打算仅使用通过 Microsoft 对等互连提供的一部分服务,可通过两种方式减少路由表大小。If you plan to consume only a subset of services offered through Microsoft peering, you can reduce the size of your route tables in two ways. 方法:You can:

  • 通过在 BGP 团体上应用路由筛选器,筛选出不需要的前缀。Filter out unwanted prefixes by applying route filters on BGP communities. 这是标准的网络做法,通常在多个网络中使用。This is a standard networking practice and is used commonly within many networks.

  • 定义路由筛选器,并将其应用于 ExpressRoute 线路。Define route filters and apply them to your ExpressRoute circuit. 路由筛选器是一种新资源,可让你选择计划通过 Microsoft 对等互连使用的服务列表。A route filter is a new resource that lets you select the list of services you plan to consume through Microsoft peering. ExpressRoute 路由器仅发送属于路由筛选器中所标识服务的前缀列表。ExpressRoute routers only send the list of prefixes that belong to the services identified in the route filter.

关于路由筛选器About route filters

在 ExpressRoute 线路上配置 Microsoft 对等互连时,Microsoft 边缘路由器会建立你的或你连接提供商的边缘路由器的一对 BGP 会话。When Microsoft peering is configured on your ExpressRoute circuit, the Microsoft edge routers establish a pair of BGP sessions with the edge routers (yours or your connectivity provider's). 不会将任何路由播发到网络。No routes are advertised to your network. 若要能够将路由播发到网络,必须关联路由筛选器。To enable route advertisements to your network, you must associate a route filter.

使用路由筛选器可标识要通过 ExpressRoute 线路的 Microsoft 对等互连使用的服务。A route filter lets you identify services you want to consume through your ExpressRoute circuit's Microsoft peering. 它实质上是要允许的所有 BGP 社区值的列表。It is essentially a list of all the BGP community values you want to allow. 定义路由筛选器资源并将其附加到 ExpressRoute 线路后,映射到 BGP 团体值的所有前缀均会播发到网络。Once a route filter resource is defined and attached to an ExpressRoute circuit, all prefixes that map to the BGP community values are advertised to your network.

重要

在 2019 年 10 月 1 日之前配置的 ExpressRoute 线路的 Microsoft 对等互连会通过 Microsoft 对等互连播发所有服务前缀,即使未定义路由筛选器。Microsoft peering of ExpressRoute circuits that were configured prior to October 1, 2019 will have all service prefixes advertised through Microsoft peering, even if route filters are not defined. 在 2019 年 10 月 1 日或之后配置的 ExpressRoute 线路的 Microsoft 对等互连的任何前缀只有在路由筛选器附加到线路之后才会播发。Microsoft peering of ExpressRoute circuits that are configured on or after October 1, 2019 will not have any prefixes advertised until a route filter is attached to the circuit.

工作流Workflow

若要通过 Microsoft 对等互连成功连接服务,必须完成以下配置步骤:To be able to successfully connect to services through Microsoft peering, you must complete the following configuration steps:

  • 必须具备预配了 Microsoft 对等互连的活动 ExpressRoute 线路。You must have an active ExpressRoute circuit that has Microsoft peering provisioned. 可使用以下说明完成这些任务:You can use the following instructions to accomplish these tasks:

    • 继续下一步之前,请创建 ExpressRoute 线路,并让连接提供商启用该线路。Create an ExpressRoute circuit and have the circuit enabled by your connectivity provider before you proceed. ExpressRoute 线路必须处于已预配且已启用状态。The ExpressRoute circuit must be in a provisioned and enabled state.
    • 如果直接管理 BGP 会话,请创建 Microsoft 对等互连Create Microsoft peering if you manage the BGP session directly. 或者,让连接提供商为线路预配 Microsoft 对等互连。Or, have your connectivity provider provision Microsoft peering for your circuit.
  • 必须创建并配置路由筛选器。You must create and configure a route filter.

    • 标识要通过 Microsoft 对等互连使用的服务Identify the services you with to consume through Microsoft peering
    • 标识与服务关联的 BGP 团体值列表Identify the list of BGP community values associated with the services
    • 创建规则以允许前缀列表与 BGP 团体值相匹配Create a rule to allow the prefix list matching the BGP community values
  • 必须将路由筛选器附加到 ExpressRoute 线路。You must attach the route filter to the ExpressRoute circuit.

准备阶段Before you begin

开始配置之前,请确保满足以下条件:Before you begin configuration, make sure you meet the following criteria:

步骤 1:获取前缀和 BGP 团体值的列表Step 1: Get a list of prefixes and BGP community values

1.获取 BGP 团体值列表1. Get a list of BGP community values

可从 ExpressRoute 路由要求页获取与可通过 Microsoft 对等互连访问的服务关联的 BGP 社区值。BGP community values associated with services accessible through Microsoft peering is available in the ExpressRoute routing requirements page.

2.列出要使用的值2. Make a list of the values that you want to use

列出要在路由筛选器中使用的 BGP 团体值列表。Make a list of BGP community values you want to use in the route filter.

步骤 2:创建路由筛选器和筛选器规则Step 2: Create a route filter and a filter rule

1 个路由筛选器只能有 1 个规则,并且规则类型必须是“允许”。A route filter can have only one rule, and the rule must be of type 'Allow'. 此规则可以有与之关联的 BGP 团体值列表。This rule can have a list of BGP community values associated with it.

1.创建路由筛选器1. Create a route filter

可以通过选择创建新资源的选项来创建路由筛选器。You can create a route filter by selecting the option to create a new resource. 单击“创建资源” > “网络” > “RouteFilter”,如下图所示 :Click Create a resource > Networking > RouteFilter, as shown in the following image:

创建路由筛选器

必须将路由筛选器放置在资源组中。You must place the route filter in a resource group.

创建路由筛选器

2.创建筛选器规则2. Create a filter rule

可通过选择管理规则选项卡添加和更新路由筛选器规则。You can add and update rules by selecting the manage rule tab for your route filter.

创建路由筛选器

可从下拉列表中选择希望连接的服务,并在完成后保存规则。You can select the services you want to connect to from the drop-down list and save the rule when done.

创建路由筛选器

步骤 3:将路由筛选器附加到 ExpressRoute 线路Step 3: Attach the route filter to an ExpressRoute circuit

可通过选择“添加线路”按钮并从下拉列表中选择 ExpressRoute 线路将路由筛选器附加到线路。You can attach the route filter to a circuit by selecting the "add Circuit" button and selecting the ExpressRoute circuit from the drop-down list.

创建路由筛选器

如果连接服务提供商为 ExpressRoute 线路配置了对等互连,请先从 ExpressRoute 线路边栏选项卡中刷新线路,再选择“添加线路”按钮。If the connectivity provider configures peering for your ExpressRoute circuit refresh the circuit from the ExpressRoute circuit blade before you select the "add Circuit" button.

创建路由筛选器

常见任务Common tasks

获取路由筛选器的属性To get the properties of a route filter

在门户中打开资源时,可以查看路由筛选器的属性。You can view properties of a route filter when you open the resource in the portal.

创建路由筛选器

更新路由筛选器的属性To update the properties of a route filter

可通过选择“管理规则”按钮更新附加到线路的 BGP 社区值列表。You can update the list of BGP community values attached to a circuit by selecting the "Manage rule" button.

创建路由筛选器

创建路由筛选器

从 ExpressRoute 线路分离路由筛选器To detach a route filter from an ExpressRoute circuit

若要从路由筛选器中分离线路,请右键单击线路并单击“取消关联”。To detach a circuit from the route filter, right-click on the circuit and click on "disassociate".

创建路由筛选器

删除路由筛选器To delete a route filter

可通过选择“删除”按钮删除路由筛选器。You can delete a route filter by selecting the delete button.

创建路由筛选器

后续步骤Next Steps