コンテンツにスキップ

BGP_PEER_GROUP_AF テーブル

概要

BGP_PEER_GROUPアドレスファミリ別 設定を保持するテーブル1frr-mgmt-frameworkDEVICE_METADATA.frr_mgmt_framework_config = true のときに使用する generic 形式。sonic-bgp-common.yangsonic-bgp-cmn-af grouping を uses し、route-map / prefix-list / community / max-prefix 等の AF スコープ設定を表現する。

データフロー (自動生成)

flowchart LR
  CDB[("CONFIG_DB<br/>BGP_PEER_GROUP_AF")]
  DM["frrcfgd"]
  CDB --> DM

凡例

CONFIG_DB から SAI までの典型経路を docs/reference/config-db-orch-map.md から機械生成したミニ図。詳細・例外は本ページ本文と対応表を参照。

key 構造

BGP_PEER_GROUP_AF|<vrf_name>|<peer_group_name>|<afi_safi>
  • <vrf_name>: BGP_GLOBALS_LIST.vrf_name への leafref
  • <peer_group_name>: BGP_PEER_GROUP_LIST.peer_group_name への leafref(同一 vrf 限定)
  • <afi_safi>: ipv4_unicast / ipv6_unicast / l2vpn_evpn

フィールド (sonic-bgp-cmn-af より継承)

フィールド 説明
afi_safi enum address-family 識別子(key 部)
admin_status boolean / string activate / no-activate
send_default_route boolean default-originate
default_rmap string default-originate route-map
max_prefix_limit uint32 maximum-prefix
max_prefix_warning_only boolean warning-only
max_prefix_warning_threshold uint8 warning threshold (%)
max_prefix_restart_interval uint16 restart 間隔
route_map_in / route_map_out leaf-list string inbound / outbound route-map
soft_reconfiguration_in boolean soft-reconfiguration inbound
unsuppress_map_name string unsuppress-map
rrclient boolean route-reflector-client
weight uint16 weight
as_override boolean as-override
send_community enum send-community 種別
tx_add_paths enum addpath 送出
unchanged_as_path / unchanged_med / unchanged_nexthop boolean attribute-unchanged
filter_list_in / filter_list_out string as-path filter-list
nhself / nexthop_self_force boolean next-hop-self / force
prefix_list_in / prefix_list_out string prefix-list 参照
remove_private_as_enabled / replace_private_as / remove_private_as_all boolean remove-private-AS の各オプション
allow_as_in / allow_as_count / allow_as_origin boolean / uint8 allowas-in
cap_orf enum capability orf
route_server_client boolean route-server-client

合計 30 以上の AF レベル leaf を持つ。完全な一覧は sonic-bgp-common.yanggrouping sonic-bgp-cmn-af を参照。

制約

  • vrf_name / peer_group_name はそれぞれ leafref。存在しない peer-group 名はバリデーション失敗
  • key の peer_group_name leafref は [vrf_name=current()/../vrf_name] のスコープ式で同一 VRF に縛られる

購読者

  • frr-mgmt-framework: FRR (bgpd) の address-family ... / neighbor PG ... 配下コマンドへ変換
  • bgpcfgd テンプレ系: 主に neighbor 単位処理が中心で、AF 別設定はテンプレ展開で間接反映

関連 CONFIG_DB / YANG / CLI

関連リファレンス

引用元

運用ヒント

典型値

  • key 形式: BGP_PEER_GROUP_AF|<vrf>|<peer_group>|<afi_safi> (例 BGP_PEER_GROUP_AF|default|UPSTREAM|ipv4_unicast)。
  • admin_status=true で activate、route_map_in/route_map_out でフィルタ。

よくある誤設定

  • peer-group を作成した直後に AF 設定を行わず、neighbor が activate されない (アドレスファミリ未投入)。
  • max_prefix_limit を運用ピーク以下に設定して BGP セッションが reset する。

確認コマンド

sonic-db-cli CONFIG_DB keys 'BGP_PEER_GROUP_AF|*'
vtysh -c "show ip bgp summary"
vtysh -c "show running-config bgpd"

値依存挙動マトリクス

BGP_NEIGHBOR_AF と同一の sonic-bgp-cmn-af grouping を uses するため、enum 挙動は同一。

send_community (bgp_community_type)

FRR コマンド
standard neighbor <pg> send-community standard
extended neighbor <pg> send-community extended
both neighbor <pg> send-community both
large neighbor <pg> send-community large
all neighbor <pg> send-community all
none send-community 無効 (コマンド追加なし)

tx_add_paths

FRR コマンド
tx_all_paths neighbor <pg> addpath-tx-all-paths
tx_best_path_per_as neighbor <pg> addpath-tx-bestpath-per-AS

cap_orf

FRR コマンド
send neighbor <pg> capability orf prefix-list send
receive neighbor <pg> capability orf prefix-list receive
both neighbor <pg> capability orf prefix-list both

peer-group に設定した値は、その peer-group に属する全 neighbor に FRR が自動継承する。

例外条件・特殊挙動

条件 挙動 ソース
key パース時 \| が不正 (ValueError) catch → continue (skip) frrcfgd.py L2665
local_asn が未設定の VRF LOG_DEBUG して skip frrcfgd.py L2660
対象 peer-group が FRR に未存在のまま AF 設定 vtysh コマンド失敗 → failed running BGP neighbor config command を LOG_ERR → continue frrcfgd.py L2791
BGP_PEER_GROUP_AFBGP_NEIGHBOR_AF の key_map 共用 両テーブルは同一 nbr_af_key_map を使用。max_prefix / send_default_route の複合条件は BGP_NEIGHBOR_AF と同様 frrcfgd.py L2112