diff --git a/redfish-core/lib/ethernet.hpp b/redfish-core/lib/ethernet.hpp
index 71cde15..c98c8f4 100644
--- a/redfish-core/lib/ethernet.hpp
+++ b/redfish-core/lib/ethernet.hpp
@@ -78,6 +78,7 @@
 {
     uint32_t speed;
     bool auto_neg;
+    bool DHCPEnabled;
     std::string hostname;
     std::string default_gateway;
     std::string mac_address;
@@ -230,6 +231,15 @@
                                 ethData.nameservers = std::move(*nameservers);
                             }
                         }
+                        else if (propertyPair.first == "DHCPEnabled")
+                        {
+                            const bool *DHCPEnabled =
+                                std::get_if<bool>(&propertyPair.second);
+                            if (DHCPEnabled != nullptr)
+                            {
+                                ethData.DHCPEnabled = *DHCPEnabled;
+                            }
+                        }
                     }
                 }
             }
@@ -646,6 +656,50 @@
         "xyz.openbmc_project.Network.IP.Protocol.IPv4", address, subnetMask,
         gateway);
 }
+using GetAllPropertiesType =
+    boost::container::flat_map<std::string, sdbusplus::message::variant<bool>>;
+
+inline void getDHCPConfigData(const std::shared_ptr<AsyncResp> asyncResp)
+{
+    auto getConfig = [asyncResp](const boost::system::error_code error_code,
+                                 const GetAllPropertiesType &dbus_data) {
+        if (error_code)
+        {
+            BMCWEB_LOG_ERROR << "D-Bus response error: " << error_code;
+            messages::internalError(asyncResp->res);
+            return;
+        }
+        nlohmann::json &DHCPConfigTypeJson =
+            asyncResp->res.jsonValue["DHCPv4Configuration"];
+        for (const auto &property : dbus_data)
+        {
+            auto value =
+                sdbusplus::message::variant_ns::get_if<bool>(&property.second);
+
+            if (value == nullptr)
+            {
+                continue;
+            }
+            if (property.first == "DNSEnabled")
+            {
+                DHCPConfigTypeJson["UseDNSServers"] = *value;
+            }
+            else if (property.first == "HostNameEnabled")
+            {
+                DHCPConfigTypeJson["UseDomainName"] = *value;
+            }
+            else if (property.first == "NTPEnabled")
+            {
+                DHCPConfigTypeJson["UseNTPServers"] = *value;
+            }
+        }
+    };
+    crow::connections::systemBus->async_method_call(
+        std::move(getConfig), "xyz.openbmc_project.Network",
+        "/xyz/openbmc_project/network/config/dhcp",
+        "org.freedesktop.DBus.Properties", "GetAll",
+        "xyz.openbmc_project.Network.DHCPConfiguration");
+}
 
 /**
  * Function that retrieves all properties for given Ethernet Interface
@@ -1154,6 +1208,9 @@
         }
         json_response["SpeedMbps"] = ethData.speed;
         json_response["MACAddress"] = ethData.mac_address;
+        json_response["DHCPv4Configuration"]["DHCPEnabled"] =
+            ethData.DHCPEnabled;
+
         if (!ethData.hostname.empty())
         {
             json_response["HostName"] = ethData.hostname;
@@ -1223,6 +1280,7 @@
                 parseInterfaceData(asyncResp->res.jsonValue, iface_id, ethData,
                                    ipv4Data);
             });
+        getDHCPConfigData(asyncResp);
     }
 
     void doPatch(crow::Response &res, const crow::Request &req,
