diff --git a/dockers/docker-orchagent/orchagent.sh b/dockers/docker-orchagent/orchagent.sh index 705e1ea0db5d..256def591807 100755 --- a/dockers/docker-orchagent/orchagent.sh +++ b/dockers/docker-orchagent/orchagent.sh @@ -97,4 +97,10 @@ if [[ x"${LOCALHOST_SUBTYPE}" == x"SmartSwitch" ]]; then fi fi +# Add VRF parameter when mgmt-vrf enabled +MGMT_VRF_ENABLED=`sonic-db-cli CONFIG_DB hget "MGMT_VRF_CONFIG|vrf_global" "mgmtVrfEnabled"` +if [[ x"${MGMT_VRF_ENABLED}" == x"true" ]]; then + ORCHAGENT_ARGS+=" -v mgmt" +fi + exec /usr/bin/orchagent ${ORCHAGENT_ARGS} diff --git a/dockers/docker-sonic-gnmi/gnmi-native.sh b/dockers/docker-sonic-gnmi/gnmi-native.sh index e9f15810a226..b9241dca1d6a 100755 --- a/dockers/docker-sonic-gnmi/gnmi-native.sh +++ b/dockers/docker-sonic-gnmi/gnmi-native.sh @@ -78,6 +78,12 @@ if [[ x"${LOCALHOST_SUBTYPE}" == x"SmartSwitch" ]]; then TELEMETRY_ARGS+=" -zmq_port=8100" fi +# Add VRF parameter when mgmt-vrf enabled +MGMT_VRF_ENABLED=`sonic-db-cli CONFIG_DB hget "MGMT_VRF_CONFIG|vrf_global" "mgmtVrfEnabled"` +if [[ x"${MGMT_VRF_ENABLED}" == x"true" ]]; then + TELEMETRY_ARGS+=" --vrf mgmt" +fi + # Server will handle threshold connections consecutively THRESHOLD_CONNECTIONS=$(echo $GNMI | jq -r '.threshold') if [[ $THRESHOLD_CONNECTIONS =~ ^[0-9]+$ ]]; then