diff --git a/src/sonic-dhcp-utilities/dhcp_utilities/dhcpservd/dhcp_cfggen.py b/src/sonic-dhcp-utilities/dhcp_utilities/dhcpservd/dhcp_cfggen.py index fad5128f1429..4058dffcecae 100755 --- a/src/sonic-dhcp-utilities/dhcp_utilities/dhcpservd/dhcp_cfggen.py +++ b/src/sonic-dhcp-utilities/dhcp_utilities/dhcpservd/dhcp_cfggen.py @@ -255,7 +255,7 @@ def _construct_obj_for_template(self, dhcp_server_ipv4, port_ips, hostname, cust "lease_time": dhcp_config["lease_time"] if "lease_time" in dhcp_config else DEFAULT_LEASE_TIME, "customized_options": curr_options } - if "gateway" in dhcp_config: + if "gateway" in dhcp_config and not smart_switch: subnet_obj["gateway"] = dhcp_config["gateway"] subnets.append(subnet_obj) render_obj = { diff --git a/src/sonic-dhcp-utilities/tests/test_smart_switch.py b/src/sonic-dhcp-utilities/tests/test_smart_switch.py index e3c627347a78..5d2c416b3742 100644 --- a/src/sonic-dhcp-utilities/tests/test_smart_switch.py +++ b/src/sonic-dhcp-utilities/tests/test_smart_switch.py @@ -57,10 +57,6 @@ } ], "option-data": [ - { - "name": "routers", - "data": "169.254.200.254" - }, { "name": "dhcp-server-identifier", "data": "169.254.200.254",