BGP 基础配置
BGP 基础配置
BGP 简介
边界网关协议(BGP)是一种标准化的路由协议,用于在互联网上路由流量。它在互联网上的自治系统(AS)之间交换路由信息,并根据路径、网络策略和规则集做出路由决策。BGP 包含两个子集:内部 BGP(iBGP)和外部 BGP(eBGP)。iBGP 用于在自己的网络内部使用。eBGP 用于连接不同的网络,并且是互联网骨干的主要路由协议。
FortiGate 的 BGP 基础配置参数如下:
| 选项 | 描述 |
|---|---|
| 本地 AS | 本地 FortiGate 的 AS 号。 |
| Router ID | 一个用于在网络中标识你的路由器的唯一 ID,通常以 x.x.x.x 的格式表示。 |
| 邻居 | FortiGate 将与之进行 BGP 连接的邻居。配置远程路由器的自治系统(Remote AS)号码,与邻居连接所使用的任何其他属性,以及 IPv4 和 IPv6 路由过滤。 |
| 邻居组 | 共享相同出站策略配置的邻居组,一般用于被多个 BGP 邻居主动连接的情况。 |
| 邻居范围 | BGP 邻居的源地址范围,用于分配给一个邻居组。 |
| IPv4 & IPv6 网络 | 要宣告给其他 BGP 路由器的网络。 |
| IPv4 & IPv6 重分发 | 启用协议的重分发。指定某个路由协议的路由,可以通过 route-map 进行过滤。 |
| Dampening | 启用路由振荡抑制以减少振荡路由的传播。 |
| 优雅重启(graceful-restart) | 启用 BGP 优雅重启(graceful-restart),相邻的路由器在 FortiGate 重启 BGP 进程时保持 BGP 路由条目。在 HA 中发生主备切换时非常有用(暂不支持 GR Helper 配置为 GR Helper-only 模式)。 |
| 高级选项 | 多种 BGP 高级选项,如 Local Preference、Local Preference、Distance internal、Keepalive、Holdtime 等。 |
| 最佳路径选择 | 路径选择的相关属性配置。 |
BGP 选路原则
优先选择具有最高的 Weight 的路由(Weight 仅本地生效)。
优先选择具有最高的 Local Preference 的路由(仅在本 AS 内生效)。
优先选择本地路由器产生的路由(下一跳为 0.0.0.0)。
优先选择具有最短的 AS-Path 的路由。
IGP 路由 > EGP 路由 > incomplete 路由。
优先选择具有最低 MED(可在 AS 之间交换)的路由。
eBGP 路径优先于 iBGP 路由。
iBGP 路由优先选择更近的 iBGP 邻居学习到的路由。
eBGP 路由优先选择更早学习到的 eBGP 路由。
优先选择具有最小邻居 Router ID 的路由。
优先选择具有最小邻居 IP 的路由。
网络拓扑

网络连接:
- FGT-1 与 FGT-2 通过 ISP1 的 Internet 建立 IPSec 隧道,二阶段保护网段两端均为 0.0.0.0/0(配置略)。
- 为两台 FortiGate 的 IPSec Tunnel 接口配置 IP,并配置 IPSec 业务互访的放通策略(配置略):
- FGT-1 Tunnel IP:100.1.1.1。
- FGT-2 Tunnel IP:100.1.1.2。
- FGT-1 与 Router 为直连网段设备。
BGP 邻居:
FGT-1 与 FGT-2 通过 IPSec 隧道建立 iBGP 邻居,BGP 均创建在 IPSec Tunnel 接口上。
FGT-1 与 Router 之间使用物理口建立 eBGP 邻居。
路由学习:
- FGT-1 和 FGT-2 互相学习 IBGP 路由并通过 IPSec 隧道通信。
- FGT-1 从 Router 学习 eBGP 路由,并发布到 FGT-2,但不允许发布任何 iBGP 路由到 Router。
- FGT-1 通过 eBGP 向 Router 发布默认路由。
配置步骤
基础配置
FGT-1 的 VPN 配置。
config vpn ipsec phase1-interface edit "to_FGT-2" set interface "port2" set ike-version 2 set peertype any set net-device disable set proposal aes128-sha256 aes256-sha256 aes128gcm-prfsha256 aes256gcm-prfsha384 chacha20poly1305-prfsha256 set dpd on-idle set remote-gw 101.103.2.2 set psksecret xxxxxxxx next end config vpn ipsec phase2-interface edit "to_FGT-2" set phase1name "to_FGT-2" set proposal aes128-sha1 aes256-sha1 aes128-sha256 aes256-sha256 aes128gcm aes256gcm chacha20poly1305 set auto-negotiate enable next endFGT-2 的 VPN 配置。
config vpn ipsec phase1-interface edit "to_FGT-1" set interface "port2" set ike-version 2 set peertype any set net-device disable set proposal aes128-sha256 aes256-sha256 aes128gcm-prfsha256 aes256gcm-prfsha384 chacha20poly1305-prfsha256 set dpd on-idle set remote-gw 101.103.1.2 set psksecret xxxxxxxx next end config vpn ipsec phase2-interface edit "to_FGT-1" set phase1name "to_FGT-1" set proposal aes128-sha1 aes256-sha1 aes128-sha256 aes256-sha256 aes128gcm aes256gcm chacha20poly1305 set auto-negotiate enable next endFGT-1 的接口与静态路由配置。
config system interface edit "port2" set vdom "root" set ip 101.103.1.2 255.255.255.0 set alias "WAN1" next edit "port3" set vdom "root" set ip 202.103.1.2 255.255.255.0 set alias "WAN2" next edit "port4" set vdom "root" set ip 10.10.1.1 255.255.255.0 set allowaccess ping https http set alias "LAN" next edit "to_FGT-2" set vdom "root" set ip 100.1.1.1 255.255.255.255 set allowaccess ping set type tunnel set remote-ip 100.1.1.254 255.255.255.0 set interface "port2" next end config router static edit 1 set gateway 101.103.1.1 set device "port2" next endFGT-2 的接口与静态路由配置。
config system interface edit "port2" set vdom "root" set ip 101.103.2.2 255.255.255.0 set alias "WAN" next edit "port3" set vdom "root" set ip 10.10.2.1 255.255.255.0 set alias "LAN" next edit "to_FGT-1" set vdom "root" set ip 100.1.1.2 255.255.255.255 set allowaccess ping https http set type tunnel set remote-ip 100.1.1.254 255.255.255.0 set interface "port2" next end config router static edit 1 set gateway 101.103.2.1 set device "port2" next end配置安全策略,放通 FGT-1 和 FGT-2 间 IPSec 隧道的流量,按需配置其他安全策略(略)。
等待 FGT-1 和 FGT-2 之间的 IPSec 隧道建立成功。
FGT-1 # get vpn ipsec tunnel summary 'to_FGT-2' 101.103.2.2:0 selectors(total,up): 1/1 rx(pkt,err): 395/0 tx(pkt,err): 396/0 FGT-2 # get vpn ipsec tunnel summary 'to_FGT-1' 101.103.1.2:0 selectors(total,up): 1/1 rx(pkt,err): 397/0 tx(pkt,err): 396/0
iBGP(FGT-1 to FGT-2)
在 FGT-1 上进入网络 → BGP 页面,配置本地 AS 和 Router ID,在网络选项中配置要发布的本地路由。

重要
默认配置下,BGP 只能发布设备自身路由表中已经存在的路由条目(路由与掩码都要一致),如果需要发布路由表中不存在的路由条目,需要使用如下 CLI 关闭发布路由的检查。
config router bgp set network-import-check disable end点击邻居选项中的新建按钮,在弹出的新建邻居页面中配置 iBGP 邻居的 IP、远程 AS,接口和更新源都选择 IPSec Tunnel 接口,开启“Next hop self”(FGT-1 向 FGT-2 宣告 Router 发送的 eBGP 路由时,将下一跳改为自己的 IPSec tunnel 口 IP),建议开启软重配功能,点击确认下发 BGP 邻居配置。

在 BGP 页面点击应用下发 BGP 配置。

相关 CLI 如下。
config router bgp set as 65001 set router-id 101.103.1.2 config neighbor edit "100.1.1.2" set next-hop-self enable set soft-reconfiguration enable set interface "to_FGT-2" set remote-as 65001 set update-source "to_FGT-2" next end config network edit 1 set prefix 10.10.1.0 255.255.255.0 next end end在 FGT-2 使用与 FGT-1 同样的步骤配置 iBGP,过程略,相关配置 CLI 如下。
config router bgp set as 65001 set router-id 101.103.2.2 config neighbor edit "100.1.1.1" set soft-reconfiguration enable set interface "to_FGT-1" set remote-as 65001 set update-source "to_FGT-1" next end config network edit 1 set prefix 10.10.2.0 255.255.255.0 next end end
eBGP
在 FGT-1 上新建 Route Map,用于阻止从 FGT-2 学到的 iBGP 路由发布到 eBGP 邻居 Router。进入网络 → 路由对象页面,点击新建 → Route Map。

配置 Route Map 的名称,并点击规则下的新建按钮。在弹出的新建规则页面中配置动作为拒绝,在“其他规则变量”中开启“匹配初始”,并选择 IGP,下发规则和 Route Map 的配置。

config router route-map edit "deny_iBGP" config rule edit 1 set action deny set match-origin igp next end next end在 FGT-1 上进入网络 → BGP 页面,点击邻居选项中的新建按钮,在弹出的新建邻居页面中配置 eBGP 邻居的 IP、远程 AS,在“IPv4 过滤”中的“Route map out”引用上步创建的 Route Map,开启“Capability: default originate”功能,向 Router 宣告默认路由,建议开启软重配功能,随后下发 BGP 邻居配置和 BGP 配置。
重要
如果与此 eBGP 邻居之间存在多跳(非直连),需要开启 eBGP 多跳功能(set ebgp-enforce-multihop enable)。

config router bgp config neighbor edit "202.103.1.1" set capability-default-originate enable set soft-reconfiguration enable set remote-as 65002 set route-map-out "deny_iBGP" next end end在 Router 上参考 FGT-1 配置 eBGP 邻居,配置略,相关 CLI 如下。
config router bgp set as 65002 set router-id 202.103.1.1 config neighbor edit "202.103.1.2" set soft-reconfiguration enable set remote-as 65001 next end config network edit 1 set prefix 10.10.3.0 255.255.255.0 next edit 2 set prefix 10.10.4.0 255.255.255.0 next edit 3 set prefix 10.10.5.0 255.255.255.0 next edit 4 set prefix 10.10.6.0 255.255.255.0 next end end
结果验证
FGT-1
在 FGT-1 上查看 BGP 邻居状态,可以看到和 FGT-2、Router 分别建立了 BGP 邻居,并学习到路由(从 FGT-2 学到 1 条,从 Router 学习到 4 条)。
重要
查看 BGP 邻居的详细信息,请使用
get router info bgp neighbors。FGT-1 # get router info bgp summary VRF 0 BGP router identifier 101.103.1.2, local AS number 65001 BGP table version is 8 2 BGP AS-PATH entries 0 BGP community entries Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd 100.1.1.2 4 65001 142 162 8 0 0 00:29:39 1 202.103.1.1 4 65002 15 16 8 0 0 00:11:01 4 Total number of neighbors 2在 FGT-1 上查看从不同邻居收到的路由条目。
FGT-1 # get router info bgp neighbors 100.1.1.2 received-routes VRF 0 BGP table version is 3, local router ID is 101.103.1.2 Status codes: s suppressed, d damped, h history, * valid, > best, i - internal Origin codes: i - IGP, e - EGP, ? - incomplete Network Next Hop Metric LocPrf Weight RouteTag Path *>i10.10.2.0/24 100.1.1.2 100 0 0 i <-/-> Total number of prefixes 1 FGT-1 # get router info bgp neighbors 202.103.1.1 received-routes VRF 0 BGP table version is 3, local router ID is 101.103.1.2 Status codes: s suppressed, d damped, h history, * valid, > best, i - internal Origin codes: i - IGP, e - EGP, ? - incomplete Network Next Hop Metric LocPrf Weight RouteTag Path *> 10.10.3.0/24 202.103.1.1 0 0 65002 i <-/-> *> 10.10.4.0/24 202.103.1.1 0 0 65002 i <-/-> *> 10.10.5.0/24 202.103.1.1 0 0 65002 i <-/-> *> 10.10.6.0/24 202.103.1.1 0 0 65002 i <-/-> Total number of prefixes 4在 FGT-1 上查看向不同邻居发布的路由条目。
FGT-1 # get router info bgp neighbors 100.1.1.2 advertised-routes VRF 0 BGP table version is 3, local router ID is 101.103.1.2 Status codes: s suppressed, d damped, h history, * valid, > best, i - internal Origin codes: i - IGP, e - EGP, ? - incomplete Network Next Hop Metric LocPrf Weight RouteTag Path *>i10.10.1.0/24 100.1.1.1 100 32768 0 i <-/-> *>i10.10.3.0/24 100.1.1.1 100 0 0 65002 i <-/-> *>i10.10.4.0/24 100.1.1.1 100 0 0 65002 i <-/-> *>i10.10.5.0/24 100.1.1.1 100 0 0 65002 i <-/-> *>i10.10.6.0/24 100.1.1.1 100 0 0 65002 i <-/-> Total number of prefixes 5 FGT-1 # get router info bgp neighbors 202.103.1.1 advertised-routes VRF 0 BGP table version is 3, local router ID is 101.103.1.2 Status codes: s suppressed, d damped, h history, * valid, > best, i - internal Origin codes: i - IGP, e - EGP, ? - incomplete Network Next Hop Metric LocPrf Weight RouteTag Path *> 0.0.0.0/0 202.103.1.2 100 32768 0 i <-/-> Total number of prefixes 1在 FGT-1 上查看 BGP 路由数据库,可以看到 iBGP 路由前边会有 i 标记,包含本地发布的路由(weight 为 32768)。
FGT-1 # get router info bgp network VRF 0 BGP table version is 8, local router ID is 101.103.1.2 Status codes: s suppressed, d damped, h history, * valid, > best, i - internal, S Stale Origin codes: i - IGP, e - EGP, ? - incomplete Network Next Hop Metric LocPrf Weight RouteTag Path *> 10.10.1.0/24 0.0.0.0 100 32768 0 i <-/1> *>i10.10.2.0/24 100.1.1.2 0 100 0 0 i <-/1> *> 10.10.3.0/24 202.103.1.1 0 0 0 65002 i <-/1> *> 10.10.4.0/24 202.103.1.1 0 0 0 65002 i <-/1> *> 10.10.5.0/24 202.103.1.1 0 0 0 65002 i <-/1> *> 10.10.6.0/24 202.103.1.1 0 0 0 65002 i <-/1> Total number of prefixes 6查看指定的某个 BGP 路由详细信息可以在该命令后加相应网段。
FGT-1 # get router info bgp network 10.10.3.0 VRF 0 BGP routing table entry for 10.10.3.0/24 Paths: (1 available, best #1, table Default-IP-Routing-Table) Advertised to non peer-group peers: 100.1.1.2 Original VRF 0 65002 202.103.1.1 from 202.103.1.1 (202.103.1.1) Origin IGP metric 0, localpref 100, valid, external, best Last update: Fri Jan 5 17:12:47 2024查看 FGT-1 的路由表中的 BGP 路由,可以看到 FGT-1 从 FGT-2、Router 学习到的路由均已被放入路由表,iBGP 路由的 distance 为 200,eBGP 路由的 distance 为 20。
FGT-1 # get router info routing-table bgp Routing table for VRF=0 B 10.10.2.0/24 [200/0] via 100.1.1.2 (recursive via to_FGT-2 tunnel 101.103.2.2), 00:34:19, [1/0] B 10.10.3.0/24 [20/0] via 202.103.1.1 (recursive is directly connected, port3), 00:17:59, [1/0] B 10.10.4.0/24 [20/0] via 202.103.1.1 (recursive is directly connected, port3), 00:17:59, [1/0] B 10.10.5.0/24 [20/0] via 202.103.1.1 (recursive is directly connected, port3), 00:17:59, [1/0] B 10.10.6.0/24 [20/0] via 202.103.1.1 (recursive is directly connected, port3), 00:17:59, [1/0]FGT-1 内网 PC 可以正常访问 FGT-2 和 Router 内网 PC。
FGT-2
在 FGT-2 上查看 BGP 邻居状态,可以看到和 FGT-1 建立了 BGP 邻居,并学习到路由(从 FGT-1 学到 5 条,其中 1 条为 FGT-1 发布,4 条为 Router 发布)。
重要
查看 BGP 邻居的详细信息,请使用
get router info bgp neighbors。FGT-2 # get router info bgp summary VRF 0 BGP router identifier 101.103.2.2, local AS number 65001 BGP table version is 2 2 BGP AS-PATH entries 0 BGP community entries Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd 100.1.1.1 4 65001 172 154 1 0 0 00:39:35 5 Total number of neighbors 1在 FGT-2 上查看从 BGP 邻居收到的路由条目。
FGT-2 # get router info bgp neighbors 100.1.1.1 received-routes VRF 0 BGP table version is 2, local router ID is 101.103.2.2 Status codes: s suppressed, d damped, h history, * valid, > best, i - internal Origin codes: i - IGP, e - EGP, ? - incomplete Network Next Hop Metric LocPrf Weight RouteTag Path *>i10.10.1.0/24 100.1.1.1 100 0 0 i <-/-> *>i10.10.3.0/24 100.1.1.1 100 0 0 65002 i <-/-> *>i10.10.4.0/24 100.1.1.1 100 0 0 65002 i <-/-> *>i10.10.5.0/24 100.1.1.1 100 0 0 65002 i <-/-> *>i10.10.6.0/24 100.1.1.1 100 0 0 65002 i <-/-> Total number of prefixes 5在 FGT-2 上查看向邻居发布的路由条目。
FGT-2 # get router info bgp neighbors 100.1.1.1 advertised-routes VRF 0 BGP table version is 2, local router ID is 101.103.2.2 Status codes: s suppressed, d damped, h history, * valid, > best, i - internal Origin codes: i - IGP, e - EGP, ? - incomplete Network Next Hop Metric LocPrf Weight RouteTag Path *>i10.10.2.0/24 100.1.1.2 100 32768 0 i <-/-> Total number of prefixes 1在 FGT-2 上查看 BGP 路由数据库,可以看到 iBGP 路由前边会有 i 标记,包含本地发布的路由(weight 为 32768)。Router 发布的路由经过 FGT-1 发送给 FGT-2,变为 iBGP 路由。
FGT-2 # get router info bgp network VRF 0 BGP table version is 2, local router ID is 101.103.2.2 Status codes: s suppressed, d damped, h history, * valid, > best, i - internal, S Stale Origin codes: i - IGP, e - EGP, ? - incomplete Network Next Hop Metric LocPrf Weight RouteTag Path *>i10.10.1.0/24 100.1.1.1 0 100 0 0 i <-/1> *> 10.10.2.0/24 0.0.0.0 100 32768 0 i <-/1> *>i10.10.3.0/24 100.1.1.1 0 100 0 0 65002 i <-/1> *>i10.10.4.0/24 100.1.1.1 0 100 0 0 65002 i <-/1> *>i10.10.5.0/24 100.1.1.1 0 100 0 0 65002 i <-/1> *>i10.10.6.0/24 100.1.1.1 0 100 0 0 65002 i <-/1> Total number of prefixes 6查看指定的某个 BGP 路由详细信息可以在该命令后加相应网段。
FGT-2 # get router info bgp network 10.10.3.0 VRF 0 BGP routing table entry for 10.10.3.0/24 Paths: (1 available, best #1, table Default-IP-Routing-Table) Not advertised to any peer Original VRF 0 65002 100.1.1.1 from 100.1.1.1 (101.103.1.2) Origin IGP metric 0, localpref 100, valid, internal, best Last update: Fri Jan 5 17:12:50 2024查看 FGT-2 的路由表中的 BGP 路由,可以看到 FGT-2 从 FGT-1 学习到的路由均已被放入路由表,iBGP 路由的 distance 为 200。
FGT-2 # get router info routing-table bgp Routing table for VRF=0 B 10.10.1.0/24 [200/0] via 100.1.1.1 (recursive via to_FGT-1 tunnel 101.103.1.2), 00:43:14, [1/0] B 10.10.3.0/24 [200/0] via 100.1.1.1 (recursive via to_FGT-1 tunnel 101.103.1.2), 00:24:36, [1/0] B 10.10.4.0/24 [200/0] via 100.1.1.1 (recursive via to_FGT-1 tunnel 101.103.1.2), 00:24:36, [1/0] B 10.10.5.0/24 [200/0] via 100.1.1.1 (recursive via to_FGT-1 tunnel 101.103.1.2), 00:24:36, [1/0] B 10.10.6.0/24 [200/0] via 100.1.1.1 (recursive via to_FGT-1 tunnel 101.103.1.2), 00:24:36, [1/0]FGT-2 内网 PC 可以正常访问 FGT-1 和 Router 内网 PC。
Router
在 Router 上查看 BGP 邻居状态,可以看到和 FGT-1 建立了 BGP 邻居,并学习到路由(从 FGT-1 学到 1 条,为 FGT-1 发布的默认路由)。
重要
查看 BGP 邻居的详细信息,请使用
get router info bgp neighbors。Router # get router info bgp summary VRF 0 BGP router identifier 202.103.1.1, local AS number 65002 BGP table version is 2 2 BGP AS-PATH entries 0 BGP community entries Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd 202.103.1.2 4 65001 86 95 1 0 0 00:27:29 1 Total number of neighbors 1在 Router 上查看从 BGP 邻居收到的路由条目。
Router # get router info bgp neighbors 202.103.1.2 received-routes VRF 0 BGP table version is 1, local router ID is 202.103.1.1 Status codes: s suppressed, d damped, h history, * valid, > best, i - internal Origin codes: i - IGP, e - EGP, ? - incomplete Network Next Hop Metric LocPrf Weight RouteTag Path *> 0.0.0.0/0 202.103.1.2 0 0 65001 i <-/-> Total number of prefixes 1在 FGT-2 上查看向邻居发布的路由条目。
Router # get router info bgp neighbors 202.103.1.2 advertised-routes VRF 0 BGP table version is 1, local router ID is 202.103.1.1 Status codes: s suppressed, d damped, h history, * valid, > best, i - internal Origin codes: i - IGP, e - EGP, ? - incomplete Network Next Hop Metric LocPrf Weight RouteTag Path *> 10.10.3.0/24 202.103.1.1 100 32768 0 i <-/-> *> 10.10.4.0/24 202.103.1.1 100 32768 0 i <-/-> *> 10.10.5.0/24 202.103.1.1 100 32768 0 i <-/-> *> 10.10.6.0/24 202.103.1.1 100 32768 0 i <-/-> Total number of prefixes 4在 Router 上查看 BGP 路由数据库,可以看到除了本地发布的路由(weight 为 32768)和 FGT-1 发布的默认路由,无法学习到 FGT-1 和 FGT-2 发布的 iBGP 路由,这说明在 FGT-1 上配置的 route-map 已生效(过滤 IGP 路由)。
Router # get router info bgp network VRF 0 BGP table version is 2, local router ID is 202.103.1.1 Status codes: s suppressed, d damped, h history, * valid, > best, i - internal, S Stale Origin codes: i - IGP, e - EGP, ? - incomplete Network Next Hop Metric LocPrf Weight RouteTag Path *> 0.0.0.0/0 202.103.1.2 0 0 0 65001 i <-/1> *> 10.10.3.0/24 0.0.0.0 100 32768 0 i <-/1> *> 10.10.4.0/24 0.0.0.0 100 32768 0 i <-/1> *> 10.10.5.0/24 0.0.0.0 100 32768 0 i <-/1> *> 10.10.6.0/24 0.0.0.0 100 32768 0 i <-/1> Total number of prefixes 5查看指定的某个 BGP 路由详细信息可以在该命令后加相应网段。
Router # get router info bgp network 0.0.0.0 VRF 0 BGP routing table entry for 0.0.0.0/0 Paths: (1 available, best #1, table Default-IP-Routing-Table) Not advertised to any peer Original VRF 0 65001 202.103.1.2 from 202.103.1.2 (101.103.1.2) Origin IGP metric 0, localpref 100, valid, external, best Last update: Fri Jan 5 17:12:51 2024查看 Router 的路由表中的 BGP 路由,只有一条默认路由指向 FGT-1,distance 为 20(eBGP 路由)。
Router # get router info routing-table bgp Routing table for VRF=0 B* 0.0.0.0/0 [20/0] via 202.103.1.2 (recursive is directly connected, port2), 00:31:31, [1/0]Router 内网 PC 可以正常访问 FGT-1 和 FGT-2 内网 PC。
BGP 邻居建立排错
- 检查 FGT-1 的 WAN1 接口与 FGT-2 的 WAN 接口之间的连通性。
- 检查 FGT-1 和 FGT-2 之间的 IPSec 隧道是否建立成功,并验证 IPSec 隧道的连通性。
- 检查 BGP 建立的状态:
- Idle:本地 FortiGate 尚未与邻居启动 BGP 进程。这可能是因为 eBGP 对等方距离较远,但未启用 multihop。
- Connect:本地 FortiGate 已启动 BGP 进程,但尚未发起 TCP 连接,可能是由于不正确的路由导致无法发起协商。
- Active:本地 FortiGate 已启动 TCP 连接,但没有收到对端的响应。
- 如果 BGP 邻居间建立 TCP 连接存在问题,可以使用命令
diagnose sniffer packet any 'tcp and port 179' 4来判断协商问题。