diff --git a/redfish-core/lib/ethernet.hpp b/redfish-core/lib/ethernet.hpp
index a5e397f..74f544c 100644
--- a/redfish-core/lib/ethernet.hpp
+++ b/redfish-core/lib/ethernet.hpp
@@ -1716,6 +1716,39 @@
     }
 }
 
+inline void afterDelete(const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
+                        const std::string& ifaceId,
+                        const boost::system::error_code& ec,
+                        const sdbusplus::message_t& m)
+{
+    if (!ec)
+    {
+        return;
+    }
+    const sd_bus_error* dbusError = m.get_error();
+    if (dbusError == nullptr)
+    {
+        messages::internalError(asyncResp->res);
+        return;
+    }
+    BMCWEB_LOG_DEBUG << "DBus error: " << dbusError->name;
+
+    if (std::string_view("org.freedesktop.DBus.Error.UnknownObject") ==
+        dbusError->name)
+    {
+        messages::resourceNotFound(asyncResp->res, "EthernetInterface",
+                                   ifaceId);
+        return;
+    }
+    if (std::string_view("org.freedesktop.DBus.Error.UnknownMethod") ==
+        dbusError->name)
+    {
+        messages::resourceCannotBeDeleted(asyncResp->res);
+        return;
+    }
+    messages::internalError(asyncResp->res);
+}
+
 inline void requestEthernetInterfacesRoutes(App& app)
 {
     BMCWEB_ROUTE(app, "/redfish/v1/Managers/bmc/EthernetInterfaces/")
@@ -1949,6 +1982,27 @@
             }
             });
         });
+
+    BMCWEB_ROUTE(app, "/redfish/v1/Managers/bmc/EthernetInterfaces/<str>/")
+        .privileges(redfish::privileges::deleteEthernetInterface)
+        .methods(boost::beast::http::verb::delete_)(
+            [&app](const crow::Request& req,
+                   const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
+                   const std::string& ifaceId) {
+        if (!redfish::setUpRedfishRoute(app, req, asyncResp))
+        {
+            return;
+        }
+
+        crow::connections::systemBus->async_method_call(
+            [asyncResp, ifaceId](const boost::system::error_code& ec,
+                                 const sdbusplus::message_t& m) {
+            afterDelete(asyncResp, ifaceId, ec, m);
+            },
+            "xyz.openbmc_project.Network",
+            std::string("/xyz/openbmc_project/network/") + ifaceId,
+            "xyz.openbmc_project.Object.Delete", "Delete");
+        });
 }
 
 } // namespace redfish
