Skip to content

Commit

Permalink
[bgp] Add bgp_router_id in DEVICE_METADATA
Browse files Browse the repository at this point in the history
  • Loading branch information
yaqiangz committed Apr 19, 2024
1 parent 5fcb722 commit 8bcd574
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/sonic-yang-models/doc/Configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -958,7 +958,8 @@ instance is supported in SONiC.
"buffer_model": "traditional",
"yang_config_validation": "disable",
"rack_mgmt_map": "dummy_value",
"timezome": "Europe/Kiev"
"timezome": "Europe/Kiev",
"bgp_router_id": "8.8.8.8"
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion src/sonic-yang-models/tests/files/sample_config_db.json
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,8 @@
"bgp_adv_lo_prefix_as_128": "true",
"yang_config_validation": "disable",
"rack_mgmt_map": "dummy_value",
"timezone": "Europe/Kiev"
"timezone": "Europe/Kiev",
"bgp_router_id": "8.8.8.8"
}
},
"VLAN": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,5 +162,12 @@
"DEVICE_METADATA_INVALID_CREATE_ONLY_CONFIG_DB_BUFFERS": {
"desc": "Verifying invalid create_only_config_db_buffers value",
"eStrKey": "InvalidValue"
},
"DEVICE_METADATA_VALID_BGP_ROUTER_ID": {
"desc": "Verifying bgp_router_id configuration."
},
"DEVICE_METADATA_INVALID_BGP_ROUTER_ID": {
"desc": "Verifying invalid bgp_router_id configuration.",
"eStrKey": "Pattern"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -444,5 +444,23 @@
}
}
}
},
"DEVICE_METADATA_VALID_BGP_ROUTER_ID": {
"sonic-device_metadata:sonic-device_metadata": {
"sonic-device_metadata:DEVICE_METADATA": {
"sonic-device_metadata:localhost": {
"bgp_router_id": "8.8.8.8"
}
}
}
},
"DEVICE_METADATA_INVALID_BGP_ROUTER_ID": {
"sonic-device_metadata:sonic-device_metadata": {
"sonic-device_metadata:DEVICE_METADATA": {
"sonic-device_metadata:localhost": {
"bgp_router_id": "8.8.8.300"
}
}
}
}
}
5 changes: 5 additions & 0 deletions src/sonic-yang-models/yang-models/sonic-device_metadata.yang
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,11 @@ module sonic-device_metadata {
otherwise the maximum available buffers (which are read from SAI) will be
created, regardless of the CONFIG_DB buffers configuration.";
}

leaf bgp_router_id {
type inet:ipv4-address;
description "BGP Router identifier";
}
}
/* end of container localhost */
}
Expand Down

0 comments on commit 8bcd574

Please sign in to comment.