diff --git a/src/sonic-yang-models/tests/files/sample_config_db.json b/src/sonic-yang-models/tests/files/sample_config_db.json index 2693c5c2216..803e5e7bee6 100644 --- a/src/sonic-yang-models/tests/files/sample_config_db.json +++ b/src/sonic-yang-models/tests/files/sample_config_db.json @@ -867,6 +867,15 @@ } }, "BGP_NEIGHBOR": { + "10.0.0.1": { + "asn": "65200", + "holdtime": "180", + "keepalive": "60", + "local_addr": "10.0.0.2", + "name":"PEER1", + "nhopself":"0", + "rrclient":"0" + }, "default|192.168.1.1": { } }, diff --git a/src/sonic-yang-models/yang-models/sonic-bgp-neighbor.yang b/src/sonic-yang-models/yang-models/sonic-bgp-neighbor.yang index cbd94eefdac..8e0e3f4cc80 100644 --- a/src/sonic-yang-models/yang-models/sonic-bgp-neighbor.yang +++ b/src/sonic-yang-models/yang-models/sonic-bgp-neighbor.yang @@ -48,7 +48,60 @@ module sonic-bgp-neighbor { container sonic-bgp-neighbor { container BGP_NEIGHBOR { + list BGP_NEIGHBOR_TEMPLATE_LIST { + description "This list is to support template based BGP neighbor configuration handled by bgpcfgd"; + key "neighbor"; + + leaf neighbor { + type inet:ip-address; + description "BGP Neighbor address"; + } + + leaf asn { + type uint32 { + range "1..4294967295"; + } + description "Peer AS number"; + } + + leaf holdtime { + type uint16; + description "Hold time"; + } + + leaf keepalive { + type uint16; + description "Keepalive interval"; + } + + leaf local_addr { + type inet:ip-address; + description "Local source address or interface name to use for connection."; + } + + leaf name { + type string; + description "Peer description"; + } + + leaf nhopself { + type uint8 { + range "0..1"; + } + description "Nexthop is self, no nexthop calculation"; + } + + leaf rrclient { + type uint8 { + range "0..1"; + } + description "Route reflector client"; + } + } + list BGP_NEIGHBOR_LIST { + description "This list is to support generic BGP neighbor configuration handled by frrcfgd and + frr_mgmt_framework_config field should be set to true in DEVICE_METADATA talbe for accepting the generic BGP table configurations."; key "vrf_name neighbor"; leaf vrf_name {