首页/网络/BGP 与广域网速查/FRR + IPsec:VTI 隧道上跑 BGP
IPsec VPN60 条

FRR + IPsec:VTI 隧道上跑 BGP

Linux 用 XFRM/VTI 接口承载 IPsec,FRR 在隧道接口上建立 BGP 邻居,内网路由随 BGP 走隧道;VTI 的 key 需与 IPsec 策略 mark 对应。

BGP 与广域网速查网络更新于 2026-10-12
接口ip tunnel add vti0 mode vti
关键参数key 与 IPsec 策略 mark 对应
BGPFRR 在 vti0 上建 neighbor
核对ip -s xfrm state 与 show ip bgp

Linux + FRR

Linux + FRR
ip tunnel add vti0 mode vti local 198.51.100.1 remote 203.0.113.2 key 42
ip addr add 169.254.100.1/30 dev vti0
ip link set vti0 up
sysctl -w net.ipv4.conf.vti0.disable_policy=1
vtysh -c 'conf t' -c 'router bgp 65001' -c 'neighbor 169.254.100.2 remote-as 65002' -c 'end'
!
ip -s xfrm state
vtysh -c 'show ip bgp summary'

易错点

  • VTI key 与 strongSwan mark 不一致:流量不进入隧道
  • 隧道接口地址未参与 BGP 更新源或网络宣告:邻居起但路由无

数据来源与参考

  • Linux ip-tunnel 手册
  • FRR 文档:BGP 邻居配置
​‌‌​​‌​​​‌‌​‌‌‌‌​‌‌​​​‌‌​‌‌‌​​‌‌​​‌​‌‌‌​​‌‌‌​​​‌​‌‌​‌​​‌​‌‌‌​​​‌​‌‌​‌​​‌​‌‌​​​‌‌​‌‌‌​‌​​​‌‌​‌‌‌‌​​‌​‌‌‌​​‌‌​​​‌‌​‌‌​‌‌‌‌​‌‌​‌‌​‌