BGP_GLOBALS_AF テーブル
概要
BGP_GLOBALS_AF は BGP_GLOBALS の VRF ごとに、address-family / subsequent address-family 単位の BGP 設定を保持する CONFIG_DB テーブル。multipath、VRF import、route download filter、distance、route flap dampening、EVPN/VXLAN 関連フラグを扱う。派生テーブルとして、aggregate-address を定義する BGP_GLOBALS_AF_AGGREGATE_ADDR と、network statement を定義する BGP_GLOBALS_AF_NETWORK がある。実装側のテーブル名定数は schema.h も参照する。
データフロー (自動生成)
flowchart LR
CDB[("CONFIG_DB<br/>BGP_GLOBALS_AF")]
DM["bgpcfgd"]
CDB --> DM
凡例
CONFIG_DB から SAI までの典型経路を docs/reference/config-db-orch-map.md から機械生成したミニ図。詳細・例外は本ページ本文と対応表を参照。
key 構造
BGP_GLOBALS_AF|<vrf_name>|<afi_safi>
BGP_GLOBALS_AF_AGGREGATE_ADDR|<vrf_name>|<afi_safi>|<ip_prefix>
BGP_GLOBALS_AF_NETWORK|<vrf_name>|<afi_safi>|<ip_prefix>
<vrf_name> は BGP_GLOBALS.vrf_name への leafref。<afi_safi> は address family 名文字列。
主要フィールド
BGP_GLOBALS_AF
| フィールド |
型 |
既定値 |
説明 |
max_ebgp_paths |
uint16 1..256 |
1 |
eBGP multipath 最大数 |
max_ibgp_paths |
uint16 1..256 |
1 |
iBGP multipath 最大数 |
import_vrf |
default or leafref BGP_GLOBALS.vrf_name |
- |
route import 元 VRF |
import_vrf_route_map |
leafref ROUTE_MAP_SET.name |
- |
VRF import 時の route filter |
route_download_filter |
leafref ROUTE_MAP_SET.name |
- |
FIB download を絞る table-map |
ebgp_route_distance |
uint8 1..255 |
- |
eBGP route distance |
ibgp_route_distance |
uint8 1..255 |
- |
iBGP route distance |
local_route_distance |
uint8 1..255 |
- |
local route distance |
ibgp_equal_cluster_length |
boolean |
- |
iBGP multipath 比較で cluster-list length を揃える |
route_flap_dampen |
boolean |
- |
route flap dampening 有効化 |
route_flap_dampen_half_life |
uint8 1..45 |
- |
dampening half-life |
route_flap_dampen_reuse_threshold |
uint16 1..20000 |
- |
reuse threshold |
route_flap_dampen_suppress_threshold |
uint16 1..20000 |
- |
suppress threshold |
route_flap_dampen_max_suppress |
uint8 1..255 |
- |
max suppress duration |
autort |
enum rfc8365-compatible |
- |
RFC8365 互換 route-target 自動生成 |
advertise-all-vni |
boolean |
- |
L2VPN で全 VNI を advertise |
advertise-svi-ip |
boolean |
- |
local SVI IP を remote VTEP へ advertise |
BGP_GLOBALS_AF_AGGREGATE_ADDR
| フィールド |
型 |
説明 |
ip_prefix |
ip-prefix |
aggregate address |
as_set |
boolean |
AS set path 情報を生成 |
summary_only |
boolean |
more specific route の update を抑制 |
policy |
leafref ROUTE_MAP_SET.name |
aggregate network に適用する route-map |
BGP_GLOBALS_AF_NETWORK
| フィールド |
型 |
説明 |
ip_prefix |
ip-prefix |
network statement の prefix |
policy |
leafref ROUTE_MAP_SET.name |
attribute 変更用 route-map |
backdoor |
boolean |
backdoor route 指定 |
制約
vrf_name は BGP_GLOBALS への leafref。
import_vrf は自分自身の vrf_name と同じ値を禁止する must を持つ。
route_flap_dampen* は afi_safi = 'ipv4_unicast' の場合のみ許可される。
policy / route-map 系 field は ROUTE_MAP_SET への leafref。
購読者
bgpcfgd: CONFIG_DB の BGP global AF 設定を FRR address-family 設定へ変換する。
frr-mgmt-framework: DEVICE_METADATA.frr_mgmt_framework_config = true のときに generic BGP model として処理する。
bgpd (FRR): vtysh / mgmt framework 経由で最終的な AF 設定を保持する。
関連 CONFIG_DB / YANG / CLI
- 関連 CONFIG_DB:
BGP_GLOBALS、BGP_NEIGHBOR_AF、BGP_PEER_GROUP_AF、ROUTE_MAP_SET、VRF
- 関連 CLI:
config bgp
- 関連 YANG:
sonic-bgp-global
関連リファレンス
引用元
運用ヒント
典型値
- key 形式:
BGP_GLOBALS_AF|<vrf>|<af> (af = ipv4_unicast / ipv6_unicast / l2vpn_evpn 等)`。
max_ebgp_paths / max_ibgp_paths: 64(ECMP 上限)。network_import_check: true。
よくある誤設定
l2vpn_evpn AF を有効化しても advertise-all-vni を入れ忘れ Type-3 が広告されない。
確認コマンド
sonic-db-cli CONFIG_DB keys 'BGP_GLOBALS_AF|*'
vtysh -c 'show bgp l2vpn evpn summary'
値依存挙動マトリクス
autort (BGP_GLOBALS_AF)
| 値 |
FRR コマンド |
備考 |
rfc8365-compatible |
autort rfc8365-compatible |
frrcfgd hdl_enum_conversion が _ → - 変換して発行 |
| (未設定) |
コマンドなし |
EVPN route-target は手動設定が必要 |
afi_safi (key フィールド、挙動分岐)
| 値 |
FRR address-family |
route_flap_dampen* |
autort / advertise-all-vni |
ipv4_unicast |
address-family ipv4 unicast |
有効 |
無効 (YANG must で拒否) |
ipv6_unicast |
address-family ipv6 unicast |
無効 (YANG must で拒否) |
無効 |
l2vpn_evpn |
address-family l2vpn evpn |
無効 |
有効 |
advertise-all-vni (boolean、l2vpn_evpn AF 限定)
| 値 |
FRR コマンド |
true |
advertise-all-vni |
false |
no advertise-all-vni |
例外条件・特殊挙動
| 条件 |
挙動 |
ソース |
local_asn が未設定の VRF で更新が到達 |
frrcfgd が ignore table {} update because local_asn for VRF {} was not configured を LOG_DEBUG して skip |
frrcfgd.py L2660 |
| BGP_GLOBALS_AF 更新コマンドが vtysh で失敗 |
failed running BGP global AF config command を LOG_ERR → continue (drop) |
frrcfgd.py L2780 |
route_flap_dampen を IPv4 unicast 以外の AFI に設定 |
YANG must 制約により事前拒否 (afi_safi = 'ipv4_unicast' のみ許可) |
sonic-bgp-global.yang |
import_vrf に未設定 VRF を指定 |
frrcfgd は存在チェックなし → FRR 側でエラー (ログなし) |
frrcfgd.py |
| BGP_GLOBALS_AF_AGGREGATE_ADDR の IP プレフィックスが不正形式 |
invalid IP prefix format %s for af %s を LOG_ERR → skip |
frrcfgd.py L3174 |
| ホスト bit が立ったプレフィックス |
frrcfgd が正規化してから処理 (例: 192.168.1.1/24 → 192.168.1.0/24) |
frrcfgd.py |
max_ebgp_paths / max_ibgp_paths 未設定 |
YANG default=1 が適用される |
sonic-bgp-global.yang |