# BGP 路由模式配置

#### IPT 服务交付中的 BGP 路由模式

**BGP 路由模式**使用 BGP（边界网关协议）的路由协议实现自动路由学习和调整。在这种模式下：

* 客户必须拥有自己的 IP 地址。
* 网络会自动适应拓扑变化。
* 适用于**复杂且频繁变化的网络架构**。
* 支持实时路由优化和故障切换。
* 需要更高级的网络设备和配置。

## 前提条件

* 请先 [授权 ASN 或 AS-SET](/welcome/cn/global-bgp/authorize-asn.md) 以便进行 BGP 互联。
* 交付时间可能会因地域不同而有所变化。实际界面显示为准。感谢您的耐心。

## 操作步骤

<figure><img src="/files/1i1QC5kkfdaXn2GWc9Og" alt=""><figcaption><p>IPT BGP 路由模式</p></figcaption></figure>

## 授权的 ASN 用于 BGP 对等

我们的 ASN 为 21859，将在 BGP 会话的我们这一侧使用，最大接受的路由数为 1,000 条，以防止因配置错误或恶意行为导致的路由泄漏。

## BFD（可选）

勾选 **启用 BFD（可选）** 以激活 BFD，增强路由可靠性。

双向转发检测（BFD）是一种网络协议，可快速检测转发路径在两个方向上的链路故障。

#### **最小发送间隔** (ms)

本地设备向其对等设备发送 BFD 控制包的最小发送间隔，以毫秒为单位。\
**较低的值** 可以更快地检测故障，但会增加网络开销。

#### **最小接收间隔** (ms)

本地设备愿意从其对等设备接收 BFD 包的最小接收间隔，以毫秒为单位。\
这表示对等设备预期发送控制包的频率。

#### **检测倍乘器**

定义在声明连接断开前可以错过多少个 BFD 包。\
例如，检测倍乘器为 **3** 且接收间隔为 **300 ms** 时，如果在 **900 ms** 内未收到 BFD 包，系统将认为链路已断开。\
较高的值可以减少误报的机会，但会延迟故障检测。

## MD5 认证（可选）

**MD5 认证** 是 BGP 路由协议中用于验证对等设备身份并保护路由会话免受未经授权访问或篡改的安全机制。

* **BGP 会话两端的 MD5 密钥必须相同**。
* 密钥不匹配或缺失将导致会话失败。

## 路由

### **1. 选择入站路由类型**

选择您的设备从 BGP 对等设备接收路由的方式：

* **完整路由**\
  接收来自互联网的所有可能的 BGP 路由。

  > *建议用于骨干网络或需要全面了解全球路由的路由器。*
* **默认路由**\
  仅接收默认路由 (0.0.0.0/0)。

  > *适用于较小的网络或不需要外部路由详情的情况。*
* **完整路由 + 默认路由**\
  同时接收完整 BGP 路由和默认路由。

  > *提供路由灵活性，当需要时可以回退到默认路由。*

### **2. 宣告出站路由的 ASN 或 AS-SET**

选择您希望向上游对等设备宣告的 **ASNs** 或 **AS-SETs**。这决定了哪些前缀可以路由回您的网络。

{% hint style="info" %} <mark style="color:blue;">**注意**</mark>

<mark style="color:blue;">如果您不宣告有效的 ASN 或 AS-SET，您的网络可能</mark> <mark style="color:blue;">**无法从互联网访问**</mark><mark style="color:blue;">。</mark>
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.console.zenlayer.com/welcome/cn/ip-transit/create-ip-transit/bgp-routing-mode-configuration.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
