diff --git a/src/ethernet_interface.cpp b/src/ethernet_interface.cpp
index 10229ac..8e76931 100644
--- a/src/ethernet_interface.cpp
+++ b/src/ethernet_interface.cpp
@@ -7,6 +7,8 @@
 #include "system_queries.hpp"
 #include "util.hpp"
 
+#include <arpa/inet.h>
+#include <fcntl.h>
 #include <linux/rtnetlink.h>
 #include <net/if.h>
 #include <net/if_arp.h>
@@ -134,6 +136,10 @@
     {
         addStaticNeigh(neigh);
     }
+    for (const auto& [_, staticGateway] : info.staticGateways)
+    {
+        addStaticGateway(staticGateway);
+    }
 }
 
 void EthernetInterface::updateInfo(const InterfaceInfo& info, bool skipSignal)
@@ -224,6 +230,39 @@
     }
 }
 
+void EthernetInterface::addStaticGateway(const StaticGatewayInfo& info)
+{
+    if (!info.gateway)
+    {
+        lg2::error("Missing static gateway on {NET_INTF}", "NET_INTF",
+                   interfaceName());
+        return;
+    }
+
+    IP::Protocol protocolType;
+    if (*info.protocol == "IPv4")
+    {
+        protocolType = IP::Protocol::IPv4;
+    }
+    else if (*info.protocol == "IPv6")
+    {
+        protocolType = IP::Protocol::IPv6;
+    }
+
+    if (auto it = staticGateways.find(*info.gateway);
+        it != staticGateways.end())
+    {
+        it->second->StaticGatewayObj::gateway(*info.gateway);
+    }
+    else
+    {
+        staticGateways.emplace(*info.gateway,
+                               std::make_unique<StaticGateway>(
+                                   bus, std::string_view(objPath), *this,
+                                   *info.gateway, protocolType));
+    }
+}
+
 ObjectPath EthernetInterface::ip(IP::Protocol protType, std::string ipaddress,
                                  uint8_t prefixLength, std::string)
 {
@@ -347,6 +386,43 @@
     return it->second->getObjPath();
 }
 
+ObjectPath EthernetInterface::staticGateway(std::string gateway,
+                                            IP::Protocol protocolType)
+{
+    std::optional<stdplus::InAnyAddr> addr;
+    std::string route;
+    try
+    {
+        addr.emplace(stdplus::fromStr<stdplus::InAnyAddr>(gateway));
+        route = gateway;
+    }
+    catch (const std::exception& e)
+    {
+        lg2::error("Not a valid IP address {GATEWAY}: {ERROR}", "GATEWAY",
+                   gateway, "ERROR", e);
+        elog<InvalidArgument>(Argument::ARGUMENT_NAME("gateway"),
+                              Argument::ARGUMENT_VALUE(gateway.c_str()));
+    }
+
+    auto it = staticGateways.find(route);
+    if (it == staticGateways.end())
+    {
+        it = std::get<0>(staticGateways.emplace(
+            route,
+            std::make_unique<StaticGateway>(bus, std::string_view(objPath),
+                                            *this, gateway, protocolType)));
+    }
+    else
+    {
+        it->second->StaticGatewayObj::gateway(gateway);
+    }
+
+    writeConfigurationFile();
+    manager.get().reloadConfigs();
+
+    return it->second->getObjPath();
+}
+
 bool EthernetInterface::ipv6AcceptRA(bool value)
 {
     if (ipv6AcceptRA() != EthernetInterfaceIntf::ipv6AcceptRA(value))
@@ -788,6 +864,17 @@
         dhcp6["SendHostname"].emplace_back(
             tfStr(dhcp6Conf->sendHostNameEnabled()));
     }
+
+    {
+        auto& sroutes = config.map["Route"];
+        for (const auto& temp : staticGateways)
+        {
+            auto& staticGateway = sroutes.emplace_back();
+            staticGateway["Gateway"].emplace_back(temp.second->gateway());
+            staticGateway["GatewayOnLink"].emplace_back("true");
+        }
+    }
+
     auto path =
         config::pathForIntfConf(manager.get().getConfDir(), interfaceName());
     config.writeFile(path);
diff --git a/src/ethernet_interface.hpp b/src/ethernet_interface.hpp
index c7af241..3140528 100644
--- a/src/ethernet_interface.hpp
+++ b/src/ethernet_interface.hpp
@@ -2,9 +2,11 @@
 #include "dhcp_configuration.hpp"
 #include "ipaddress.hpp"
 #include "neighbor.hpp"
+#include "static_gateway.hpp"
 #include "types.hpp"
 #include "xyz/openbmc_project/Network/IP/Create/server.hpp"
 #include "xyz/openbmc_project/Network/Neighbor/CreateStatic/server.hpp"
+#include "xyz/openbmc_project/Network/StaticGateway/Create/server.hpp"
 
 #include <sdbusplus/bus.hpp>
 #include <sdbusplus/server/object.hpp>
@@ -14,6 +16,7 @@
 #include <xyz/openbmc_project/Collection/DeleteAll/server.hpp>
 #include <xyz/openbmc_project/Network/EthernetInterface/server.hpp>
 #include <xyz/openbmc_project/Network/MACAddress/server.hpp>
+#include <xyz/openbmc_project/Network/StaticGateway/server.hpp>
 #include <xyz/openbmc_project/Network/VLAN/server.hpp>
 #include <xyz/openbmc_project/Object/Delete/server.hpp>
 
@@ -31,6 +34,7 @@
     sdbusplus::xyz::openbmc_project::Network::server::MACAddress,
     sdbusplus::xyz::openbmc_project::Network::IP::server::Create,
     sdbusplus::xyz::openbmc_project::Network::Neighbor::server::CreateStatic,
+    sdbusplus::xyz::openbmc_project::Network::StaticGateway::server::Create,
     sdbusplus::xyz::openbmc_project::Collection::server::DeleteAll>;
 
 using VlanIfaces = sdbusplus::server::object_t<
@@ -45,6 +49,8 @@
     sdbusplus::xyz::openbmc_project::Network::server::EthernetInterface;
 using MacAddressIntf =
     sdbusplus::xyz::openbmc_project::Network::server::MACAddress;
+using StaticGatewayIntf =
+    sdbusplus::xyz::openbmc_project::Network::server::StaticGateway;
 
 using ServerList = std::vector<std::string>;
 using ObjectPath = sdbusplus::message::object_path;
@@ -94,8 +100,13 @@
     std::unordered_map<stdplus::InAnyAddr, std::unique_ptr<Neighbor>>
         staticNeighbors;
 
+    /** @brief Persistent map of static route dbus objects and their names */
+    std::unordered_map<std::string, std::unique_ptr<StaticGateway>>
+        staticGateways;
+
     void addAddr(const AddressInfo& info);
     void addStaticNeigh(const NeighborInfo& info);
+    void addStaticGateway(const StaticGatewayInfo& info);
 
     /** @brief Updates the interface information based on new InterfaceInfo */
     void updateInfo(const InterfaceInfo& info, bool skipSignal = false);
@@ -123,6 +134,14 @@
      */
     ObjectPath neighbor(std::string ipAddress, std::string macAddress) override;
 
+    /** @brief Function to create static route dbus object.
+     *  @param[in] destination - Destination IP address.
+     *  @param[in] gateway - Gateway
+     *  @parma[in] prefixLength - Number of network bits.
+     */
+    ObjectPath staticGateway(std::string gateway,
+                             IP::Protocol protocolType) override;
+
     /** Set value of DHCPEnabled */
     DHCPConf dhcpEnabled() const override;
     DHCPConf dhcpEnabled(DHCPConf value) override;
diff --git a/src/meson.build b/src/meson.build
index ee9778d..1a5084b 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -47,6 +47,7 @@
   'ethernet_interface.cpp',
   'neighbor.cpp',
   'ipaddress.cpp',
+  'static_gateway.cpp',
   'netlink.cpp',
   'network_manager.cpp',
   'rtnetlink.cpp',
diff --git a/src/static_gateway.cpp b/src/static_gateway.cpp
new file mode 100644
index 0000000..f1e9db4
--- /dev/null
+++ b/src/static_gateway.cpp
@@ -0,0 +1,77 @@
+#include "static_gateway.hpp"
+
+#include "ethernet_interface.hpp"
+#include "network_manager.hpp"
+
+#include <phosphor-logging/elog-errors.hpp>
+#include <phosphor-logging/elog.hpp>
+#include <xyz/openbmc_project/Common/error.hpp>
+
+#include <string>
+
+namespace phosphor
+{
+namespace network
+{
+
+static auto makeObjPath(std::string_view root, std::string addr)
+{
+    auto ret = sdbusplus::message::object_path(std::string(root));
+    ret /= addr;
+    return ret;
+}
+
+StaticGateway::StaticGateway(sdbusplus::bus_t& bus, std::string_view objRoot,
+                             stdplus::PinnedRef<EthernetInterface> parent,
+                             std::string gateway, IP::Protocol protocolType) :
+    StaticGateway(bus, makeObjPath(objRoot, gateway), parent, gateway,
+                  protocolType)
+{}
+
+StaticGateway::StaticGateway(sdbusplus::bus_t& bus,
+                             sdbusplus::message::object_path objPath,
+                             stdplus::PinnedRef<EthernetInterface> parent,
+                             std::string gateway, IP::Protocol protocolType) :
+    StaticGatewayObj(bus, objPath.str.c_str(),
+                     StaticGatewayObj::action::defer_emit),
+    parent(parent), objPath(std::move(objPath))
+{
+    StaticGatewayObj::gateway(gateway, true);
+    StaticGatewayObj::protocolType(protocolType, true);
+    emit_object_added();
+}
+
+void StaticGateway::delete_()
+{
+    auto& staticGateways = parent.get().staticGateways;
+    std::unique_ptr<StaticGateway> ptr;
+    for (auto it = staticGateways.begin(); it != staticGateways.end(); ++it)
+    {
+        if (it->second.get() == this)
+        {
+            ptr = std::move(it->second);
+            staticGateways.erase(it);
+            break;
+        }
+    }
+
+    parent.get().writeConfigurationFile();
+    parent.get().manager.get().reloadConfigs();
+}
+
+using sdbusplus::xyz::openbmc_project::Common::Error::NotAllowed;
+using REASON =
+    phosphor::logging::xyz::openbmc_project::Common::NotAllowed::REASON;
+using phosphor::logging::elog;
+
+std::string StaticGateway::gateway(std::string /*gateway*/)
+{
+    elog<NotAllowed>(REASON("Property update is not allowed"));
+}
+
+IP::Protocol StaticGateway::protocolType(IP::Protocol /*protocolType*/)
+{
+    elog<NotAllowed>(REASON("Property update is not allowed"));
+}
+} // namespace network
+} // namespace phosphor
diff --git a/src/static_gateway.hpp b/src/static_gateway.hpp
new file mode 100644
index 0000000..ee79067
--- /dev/null
+++ b/src/static_gateway.hpp
@@ -0,0 +1,74 @@
+#pragma once
+#include "types.hpp"
+
+#include <sdbusplus/bus.hpp>
+#include <sdbusplus/message/native_types.hpp>
+#include <sdbusplus/server/object.hpp>
+#include <stdplus/pinned.hpp>
+#include <xyz/openbmc_project/Network/IP/server.hpp>
+#include <xyz/openbmc_project/Network/StaticGateway/server.hpp>
+#include <xyz/openbmc_project/Object/Delete/server.hpp>
+
+#include <string_view>
+
+namespace phosphor
+{
+namespace network
+{
+
+using StaticGatewayIntf =
+    sdbusplus::xyz::openbmc_project::Network::server::StaticGateway;
+
+using StaticGatewayObj = sdbusplus::server::object_t<
+    StaticGatewayIntf, sdbusplus::xyz::openbmc_project::Object::server::Delete>;
+
+using IP = sdbusplus::xyz::openbmc_project::Network::server::IP;
+
+class EthernetInterface;
+
+/** @class StaticGateway
+ *  @brief OpenBMC network static gateway implementation.
+ *  @details A concrete implementation for the
+ *  xyz.openbmc_project.Network.StaticGateway dbus interface.
+ */
+class StaticGateway : public StaticGatewayObj
+{
+  public:
+    /** @brief Constructor to put object onto bus at a dbus path.
+     *  @param[in] bus - Bus to attach to.
+     *  @param[in] objRoot - Path to attach at.
+     *  @param[in] parent - Parent object.
+     *  @param[in] gateway - Gateway address.
+     */
+    StaticGateway(sdbusplus::bus_t& bus, std::string_view objRoot,
+                  stdplus::PinnedRef<EthernetInterface> parent,
+                  std::string gateway, IP::Protocol protocolType);
+
+    /** @brief Delete this d-bus object.
+     */
+    void delete_() override;
+
+    using StaticGatewayObj::gateway;
+    std::string gateway(std::string) override;
+    using StaticGatewayObj::protocolType;
+    IP::Protocol protocolType(IP::Protocol) override;
+    inline const auto& getObjPath() const
+    {
+        return objPath;
+    }
+
+  private:
+    /** @brief Parent Object. */
+    stdplus::PinnedRef<EthernetInterface> parent;
+
+    /** @brief Dbus object path */
+    sdbusplus::message::object_path objPath;
+
+    StaticGateway(sdbusplus::bus_t& bus,
+                  sdbusplus::message::object_path objPath,
+                  stdplus::PinnedRef<EthernetInterface> parent,
+                  std::string gateway, IP::Protocol protocolType);
+};
+
+} // namespace network
+} // namespace phosphor
diff --git a/src/types.hpp b/src/types.hpp
index 6195c3f..b2e7bd6 100644
--- a/src/types.hpp
+++ b/src/types.hpp
@@ -79,6 +79,21 @@
     }
 };
 
+/** @class StaticGatewayInfo
+ *  @brief Information about a static gateway from the kernel
+ */
+struct StaticGatewayInfo
+{
+    unsigned ifidx;
+    std::optional<std::string> gateway;
+    std::optional<std::string> protocol;
+
+    constexpr bool operator==(const StaticGatewayInfo& rhs) const noexcept
+    {
+        return ifidx == rhs.ifidx && gateway == rhs.gateway;
+    }
+};
+
 /** @brief Contains all of the object information about the interface */
 struct AllIntfInfo
 {
@@ -87,6 +102,7 @@
     std::optional<stdplus::In6Addr> defgw6 = std::nullopt;
     std::unordered_map<stdplus::SubnetAny, AddressInfo> addrs = {};
     std::unordered_map<stdplus::InAnyAddr, NeighborInfo> staticNeighs = {};
+    std::unordered_map<std::string, StaticGatewayInfo> staticGateways = {};
 };
 
 } // namespace phosphor::network
diff --git a/test/test_ethernet_interface.cpp b/test/test_ethernet_interface.cpp
index 72579f3..146fb20 100644
--- a/test/test_ethernet_interface.cpp
+++ b/test/test_ethernet_interface.cpp
@@ -54,6 +54,12 @@
         return interface.ip(addressType, ipaddress, subnetMask, "");
     }
 
+    auto createStaticGatewayObject(const std::string& gateway,
+                                   IP::Protocol protocol)
+    {
+        return interface.staticGateway(gateway, protocol);
+    }
+
     void setNtpServers()
     {
         ServerList ntpServers = {"10.1.1.1", "10.2.2.2", "10.3.3.3"};
@@ -253,5 +259,47 @@
     set_test(DHCPConf::both, /*dhcp4=*/true, /*dhcp6=*/true, /*ra=*/true);
 }
 
+TEST_F(TestEthernetInterface, AddStaticGateway)
+{
+    createStaticGatewayObject("10.10.10.1", IP::Protocol::IPv4);
+    EXPECT_THAT(interface.staticGateways,
+                UnorderedElementsAre(Key(std::string("10.10.10.1"))));
+}
+
+TEST_F(TestEthernetInterface, AddMultipleStaticGateways)
+{
+    createStaticGatewayObject("10.10.10.1", IP::Protocol::IPv4);
+    createStaticGatewayObject("10.20.30.1", IP::Protocol::IPv4);
+    EXPECT_THAT(interface.staticGateways,
+                UnorderedElementsAre(Key(std::string("10.10.10.1")),
+                                     Key(std::string("10.20.30.1"))));
+}
+
+TEST_F(TestEthernetInterface, DeleteStaticGateway)
+{
+    createStaticGatewayObject("10.10.10.1", IP::Protocol::IPv4);
+    createStaticGatewayObject("10.20.30.1", IP::Protocol::IPv4);
+
+    interface.staticGateways.at(std::string("10.10.10.1"))->delete_();
+    interface.staticGateways.at(std::string("10.20.30.1"))->delete_();
+    EXPECT_EQ(interface.staticGateways.empty(), true);
+}
+
+TEST_F(TestEthernetInterface, AddIPv6StaticGateway)
+{
+    createStaticGatewayObject("2002:903:15f:325::1", IP::Protocol::IPv6);
+    EXPECT_THAT(interface.staticGateways,
+                UnorderedElementsAre(Key(std::string("2002:903:15f:325::1"))));
+}
+
+TEST_F(TestEthernetInterface, AddMultipleIPv6StaticGateways)
+{
+    createStaticGatewayObject("2003:903:15f:325::1", IP::Protocol::IPv6);
+    createStaticGatewayObject("2004:903:15f:325::1", IP::Protocol::IPv6);
+    EXPECT_THAT(interface.staticGateways,
+                UnorderedElementsAre(Key(std::string("2003:903:15f:325::1")),
+                                     Key(std::string("2004:903:15f:325::1"))));
+}
+
 } // namespace network
 } // namespace phosphor
