diff --git a/src/dhcp_configuration.cpp b/src/dhcp_configuration.cpp
index 154bbee..5907f4a 100644
--- a/src/dhcp_configuration.cpp
+++ b/src/dhcp_configuration.cpp
@@ -23,15 +23,16 @@
 using namespace sdbusplus::xyz::openbmc_project::Common::Error;
 
 Configuration::Configuration(sdbusplus::bus_t& bus,
-                             stdplus::const_zstring objPath, Manager& parent) :
+                             stdplus::const_zstring objPath,
+                             stdplus::PinnedRef<Manager> parent) :
     Iface(bus, objPath.c_str(), Iface::action::defer_emit),
-    bus(bus), manager(parent)
+    manager(parent)
 {
     config::Parser conf;
     std::filesystem::directory_entry newest_file;
     time_t newest_time = 0;
     for (const auto& dirent :
-         std::filesystem::directory_iterator(manager.getConfDir()))
+         std::filesystem::directory_iterator(manager.get().getConfDir()))
     {
         struct stat st = {};
         stat(dirent.path().native().c_str(), &st);
@@ -65,8 +66,8 @@
 
     auto name = ConfigIntf::sendHostNameEnabled(value);
 
-    manager.writeToConfigurationFile();
-    manager.reloadConfigs();
+    manager.get().writeToConfigurationFile();
+    manager.get().reloadConfigs();
 
     return name;
 }
@@ -79,8 +80,8 @@
     }
 
     auto name = ConfigIntf::hostNameEnabled(value);
-    manager.writeToConfigurationFile();
-    manager.reloadConfigs();
+    manager.get().writeToConfigurationFile();
+    manager.get().reloadConfigs();
 
     return name;
 }
@@ -93,8 +94,8 @@
     }
 
     auto ntp = ConfigIntf::ntpEnabled(value);
-    manager.writeToConfigurationFile();
-    manager.reloadConfigs();
+    manager.get().writeToConfigurationFile();
+    manager.get().reloadConfigs();
 
     return ntp;
 }
@@ -107,8 +108,8 @@
     }
 
     auto dns = ConfigIntf::dnsEnabled(value);
-    manager.writeToConfigurationFile();
-    manager.reloadConfigs();
+    manager.get().writeToConfigurationFile();
+    manager.get().reloadConfigs();
 
     return dns;
 }
diff --git a/src/dhcp_configuration.hpp b/src/dhcp_configuration.hpp
index 98f8e46..964b7d5 100644
--- a/src/dhcp_configuration.hpp
+++ b/src/dhcp_configuration.hpp
@@ -1,6 +1,7 @@
 #pragma once
 #include <sdbusplus/bus.hpp>
 #include <sdbusplus/server/object.hpp>
+#include <stdplus/pinned.hpp>
 #include <stdplus/zstring.hpp>
 #include <xyz/openbmc_project/Network/DHCPConfiguration/server.hpp>
 
@@ -27,20 +28,13 @@
 class Configuration : public Iface
 {
   public:
-    Configuration() = default;
-    Configuration(const Configuration&) = delete;
-    Configuration& operator=(const Configuration&) = delete;
-    Configuration(Configuration&&) = delete;
-    Configuration& operator=(Configuration&&) = delete;
-    virtual ~Configuration() = default;
-
     /** @brief Constructor to put object onto bus at a dbus path.
      *  @param[in] bus - Bus to attach to.
      *  @param[in] objPath - Path to attach at.
      *  @param[in] parent - Parent object.
      */
     Configuration(sdbusplus::bus_t& bus, stdplus::const_zstring objPath,
-                  Manager& parent);
+                  stdplus::PinnedRef<Manager> parent);
 
     /** @brief If true then DNS servers received from the DHCP server
      *         will be used and take precedence over any statically
@@ -83,11 +77,8 @@
     using ConfigIntf::sendHostNameEnabled;
 
   private:
-    /** @brief sdbusplus DBus bus connection. */
-    sdbusplus::bus_t& bus;
-
     /** @brief Network Manager object. */
-    phosphor::network::Manager& manager;
+    stdplus::PinnedRef<Manager> manager;
 };
 
 } // namespace dhcp
diff --git a/src/ethernet_interface.cpp b/src/ethernet_interface.cpp
index 102173f..5e61cbd 100644
--- a/src/ethernet_interface.cpp
+++ b/src/ethernet_interface.cpp
@@ -69,7 +69,8 @@
     return ret;
 }
 
-EthernetInterface::EthernetInterface(sdbusplus::bus_t& bus, Manager& manager,
+EthernetInterface::EthernetInterface(stdplus::PinnedRef<sdbusplus::bus_t> bus,
+                                     stdplus::PinnedRef<Manager> manager,
                                      const AllIntfInfo& info,
                                      std::string_view objRoot,
                                      const config::Parser& config,
@@ -79,7 +80,8 @@
 {
 }
 
-EthernetInterface::EthernetInterface(sdbusplus::bus_t& bus, Manager& manager,
+EthernetInterface::EthernetInterface(stdplus::PinnedRef<sdbusplus::bus_t> bus,
+                                     stdplus::PinnedRef<Manager> manager,
                                      const AllIntfInfo& info,
                                      std::string&& objPath,
                                      const config::Parser& config,
@@ -270,7 +272,7 @@
     }
 
     writeConfigurationFile();
-    manager.reloadConfigs();
+    manager.get().reloadConfigs();
 
     return it->second->getObjPath();
 }
@@ -326,7 +328,7 @@
     }
 
     writeConfigurationFile();
-    manager.reloadConfigs();
+    manager.get().reloadConfigs();
 
     return it->second->getObjPath();
 }
@@ -336,7 +338,7 @@
     if (ipv6AcceptRA() != EthernetInterfaceIntf::ipv6AcceptRA(value))
     {
         writeConfigurationFile();
-        manager.reloadConfigs();
+        manager.get().reloadConfigs();
     }
     return value;
 }
@@ -346,7 +348,7 @@
     if (dhcp4() != EthernetInterfaceIntf::dhcp4(value))
     {
         writeConfigurationFile();
-        manager.reloadConfigs();
+        manager.get().reloadConfigs();
     }
     return value;
 }
@@ -356,7 +358,7 @@
     if (dhcp6() != EthernetInterfaceIntf::dhcp6(value))
     {
         writeConfigurationFile();
-        manager.reloadConfigs();
+        manager.get().reloadConfigs();
     }
     return value;
 }
@@ -378,7 +380,7 @@
     if (old4 != new4 || old6 != new6 || oldra != newra)
     {
         writeConfigurationFile();
-        manager.reloadConfigs();
+        manager.get().reloadConfigs();
     }
     return value;
 }
@@ -423,10 +425,10 @@
     {
         // We only need to bring down the interface, networkd will always bring
         // up managed interfaces
-        manager.addReloadPreHook(
+        manager.get().addReloadPreHook(
             [ifname = interfaceName()]() { system::setNICUp(ifname, false); });
     }
-    manager.reloadConfigs();
+    manager.get().reloadConfigs();
 
     return value;
 }
@@ -453,7 +455,7 @@
         EthernetInterfaceIntf::staticNameServers(value);
 
         writeConfigurationFile();
-        manager.reloadConfigs();
+        manager.get().reloadConfigs();
     }
     catch (const InternalFailure& e)
     {
@@ -479,14 +481,15 @@
 ServerList EthernetInterface::getNTPServerFromTimeSyncd()
 {
     ServerList servers; // Variable to capture the NTP Server IPs
-    auto method = bus.new_method_call(TIMESYNCD_SERVICE, TIMESYNCD_SERVICE_PATH,
-                                      PROPERTY_INTERFACE, METHOD_GET);
+    auto method =
+        bus.get().new_method_call(TIMESYNCD_SERVICE, TIMESYNCD_SERVICE_PATH,
+                                  PROPERTY_INTERFACE, METHOD_GET);
 
     method.append(TIMESYNCD_INTERFACE, "LinkNTPServers");
 
     try
     {
-        auto reply = bus.call(method);
+        auto reply = bus.get().call(method);
         std::variant<ServerList> response;
         reply.read(response);
         servers = std::get<ServerList>(response);
@@ -523,14 +526,14 @@
 
     using type = std::vector<std::tuple<int32_t, std::vector<uint8_t>>>;
     std::variant<type> name; // Variable to capture the DNS property
-    auto method = bus.new_method_call(RESOLVED_SERVICE, OBJ_PATH.c_str(),
-                                      PROPERTY_INTERFACE, METHOD_GET);
+    auto method = bus.get().new_method_call(RESOLVED_SERVICE, OBJ_PATH.c_str(),
+                                            PROPERTY_INTERFACE, METHOD_GET);
 
     method.append(RESOLVED_INTERFACE, "DNS");
 
     try
     {
-        auto reply = bus.call(method);
+        auto reply = bus.get().call(method);
         reply.read(name);
     }
     catch (const sdbusplus::exception_t& e)
@@ -552,7 +555,8 @@
 {
     auto intfName = fmt::format(FMT_COMPILE("{}.{}"), interfaceName(), id);
     auto idStr = std::to_string(id);
-    if (manager.interfaces.find(intfName) != manager.interfaces.end())
+    if (manager.get().interfaces.find(intfName) !=
+        manager.get().interfaces.end())
     {
         log<level::ERR>("VLAN already exists", entry("VLANID=%u", id));
         elog<InvalidArgument>(Argument::ARGUMENT_NAME("VLANId"),
@@ -582,7 +586,7 @@
         bus, manager, info, objRoot, config::Parser(), nicEnabled());
     ObjectPath ret = vlanIntf->objPath;
 
-    manager.interfaces.emplace(intfName, std::move(vlanIntf));
+    manager.get().interfaces.emplace(intfName, std::move(vlanIntf));
 
     // write the device file for the vlan interface.
     config::Parser config;
@@ -590,10 +594,11 @@
     netdev["Name"].emplace_back(intfName);
     netdev["Kind"].emplace_back("vlan");
     config.map["VLAN"].emplace_back()["Id"].emplace_back(std::move(idStr));
-    config.writeFile(config::pathForIntfDev(manager.getConfDir(), intfName));
+    config.writeFile(
+        config::pathForIntfDev(manager.get().getConfDir(), intfName));
 
     writeConfigurationFile();
-    manager.reloadConfigs();
+    manager.get().reloadConfigs();
 
     return ret;
 }
@@ -605,7 +610,7 @@
         EthernetInterfaceIntf::staticNTPServers(value);
 
         writeConfigurationFile();
-        manager.reloadConfigs();
+        manager.get().reloadConfigs();
     }
     catch (InternalFailure& e)
     {
@@ -653,7 +658,7 @@
                                              : (dhcp6() ? "ipv6" : "false"));
         {
             auto& vlans = network["VLAN"];
-            for (const auto& [_, intf] : manager.interfaces)
+            for (const auto& [_, intf] : manager.get().interfaces)
             {
                 if (intf->vlan && intf->vlan->parentIdx == ifIdx)
                 {
@@ -722,7 +727,7 @@
     {
         auto& dhcp = config.map["DHCP"].emplace_back();
         dhcp["ClientIdentifier"].emplace_back("mac");
-        const auto& conf = manager.getDHCPConf();
+        const auto& conf = manager.get().getDHCPConf();
         auto dns_enabled = conf.dnsEnabled() ? "true" : "false";
         dhcp["UseDNS"].emplace_back(dns_enabled);
         dhcp["UseDomains"].emplace_back(dns_enabled);
@@ -732,7 +737,8 @@
         dhcp["SendHostname"].emplace_back(conf.sendHostNameEnabled() ? "true"
                                                                      : "false");
     }
-    auto path = config::pathForIntfConf(manager.getConfDir(), interfaceName());
+    auto path =
+        config::pathForIntfConf(manager.get().getConfDir(), interfaceName());
     config.writeFile(path);
     auto msg = fmt::format("Wrote networkd file: {}", path.native());
     log<level::INFO>(msg.c_str(), entry("FILE=%s", path.c_str()));
@@ -774,7 +780,7 @@
     if (newMAC != oldMAC)
     {
         // Update everything that depends on the MAC value
-        for (const auto& [_, intf] : manager.interfaces)
+        for (const auto& [_, intf] : manager.get().interfaces)
         {
             if (intf->vlan && intf->vlan->parentIdx == ifIdx)
             {
@@ -784,11 +790,11 @@
         MacAddressIntf::macAddress(validMAC);
 
         writeConfigurationFile();
-        manager.addReloadPreHook([interface]() {
+        manager.get().addReloadPreHook([interface]() {
             // The MAC and LLADDRs will only update if the NIC is already down
             system::setNICUp(interface, false);
         });
-        manager.reloadConfigs();
+        manager.get().reloadConfigs();
     }
 
 #ifdef HAVE_UBOOT_ENV
@@ -816,7 +822,7 @@
     addrs.clear();
 
     writeConfigurationFile();
-    manager.reloadConfigs();
+    manager.get().reloadConfigs();
 }
 
 std::string EthernetInterface::defaultGateway(std::string gateway)
@@ -843,7 +849,7 @@
     EthernetInterfaceIntf::defaultGateway(gateway);
 
     writeConfigurationFile();
-    manager.reloadConfigs();
+    manager.get().reloadConfigs();
 
     return gateway;
 }
@@ -872,14 +878,14 @@
     EthernetInterfaceIntf::defaultGateway6(gateway);
 
     writeConfigurationFile();
-    manager.reloadConfigs();
+    manager.get().reloadConfigs();
 
     return gateway;
 }
 
 EthernetInterface::VlanProperties::VlanProperties(
     sdbusplus::bus_t& bus, stdplus::const_zstring objPath,
-    const InterfaceInfo& info, EthernetInterface& eth) :
+    const InterfaceInfo& info, stdplus::PinnedRef<EthernetInterface> eth) :
     VlanIfaces(bus, objPath.c_str(), VlanIfaces::action::defer_emit),
     parentIdx(*info.parent_idx), eth(eth)
 {
@@ -889,24 +895,24 @@
 
 void EthernetInterface::VlanProperties::delete_()
 {
-    auto intf = eth.interfaceName();
+    auto intf = eth.get().interfaceName();
 
     // Remove all configs for the current interface
-    const auto& confDir = eth.manager.getConfDir();
+    const auto& confDir = eth.get().manager.get().getConfDir();
     std::error_code ec;
     std::filesystem::remove(config::pathForIntfConf(confDir, intf), ec);
     std::filesystem::remove(config::pathForIntfDev(confDir, intf), ec);
 
-    if (eth.ifIdx > 0)
+    if (eth.get().ifIdx > 0)
     {
-        eth.manager.interfacesByIdx.erase(eth.ifIdx);
+        eth.get().manager.get().interfacesByIdx.erase(eth.get().ifIdx);
     }
-    auto it = eth.manager.interfaces.find(intf);
+    auto it = eth.get().manager.get().interfaces.find(intf);
     auto obj = std::move(it->second);
-    eth.manager.interfaces.erase(it);
+    eth.get().manager.get().interfaces.erase(it);
 
     // Write an updated parent interface since it has a VLAN entry
-    for (const auto& [_, intf] : eth.manager.interfaces)
+    for (const auto& [_, intf] : eth.get().manager.get().interfaces)
     {
         if (intf->ifIdx == parentIdx)
         {
@@ -914,17 +920,17 @@
         }
     }
 
-    if (eth.ifIdx > 0)
+    if (eth.get().ifIdx > 0)
     {
         // We need to forcibly delete the interface as systemd does not
-        eth.manager.addReloadPostHook(
-            [idx = eth.ifIdx]() { system::deleteIntf(idx); });
+        eth.get().manager.get().addReloadPostHook(
+            [idx = eth.get().ifIdx]() { system::deleteIntf(idx); });
 
         // Ignore the interface so the reload doesn't re-query it
-        eth.manager.ignoredIntf.emplace(eth.ifIdx);
+        eth.get().manager.get().ignoredIntf.emplace(eth.get().ifIdx);
     }
 
-    eth.manager.reloadConfigs();
+    eth.get().manager.get().reloadConfigs();
 }
 
 } // namespace network
diff --git a/src/ethernet_interface.hpp b/src/ethernet_interface.hpp
index a1e9975..b66030a 100644
--- a/src/ethernet_interface.hpp
+++ b/src/ethernet_interface.hpp
@@ -8,6 +8,7 @@
 #include <optional>
 #include <sdbusplus/bus.hpp>
 #include <sdbusplus/server/object.hpp>
+#include <stdplus/pinned.hpp>
 #include <stdplus/zstring_view.hpp>
 #include <string>
 #include <vector>
@@ -63,12 +64,8 @@
 class EthernetInterface : public Ifaces
 {
   public:
-    EthernetInterface() = delete;
-    EthernetInterface(const EthernetInterface&) = delete;
-    EthernetInterface& operator=(const EthernetInterface&) = delete;
     EthernetInterface(EthernetInterface&&) = delete;
     EthernetInterface& operator=(EthernetInterface&&) = delete;
-    virtual ~EthernetInterface() = default;
 
     /** @brief Constructor to put object onto bus at a dbus path.
      *  @param[in] bus - Bus to attach to.
@@ -79,12 +76,13 @@
      *  @param[in] vlan - The id of the vlan if configured
      *  @param[in] enabled - Determine if systemd-networkd is managing this link
      */
-    EthernetInterface(sdbusplus::bus_t& bus, Manager& manager,
+    EthernetInterface(stdplus::PinnedRef<sdbusplus::bus_t> bus,
+                      stdplus::PinnedRef<Manager> manager,
                       const AllIntfInfo& info, std::string_view objRoot,
                       const config::Parser& config, bool enabled);
 
     /** @brief Network Manager object. */
-    Manager& manager;
+    stdplus::PinnedRef<Manager> manager;
 
     /** @brief Persistent map of IPAddress dbus objects and their names */
     std::unordered_map<IfAddr, std::unique_ptr<IPAddress>> addrs;
@@ -220,7 +218,7 @@
     virtual ServerList getNameServerFromResolvd();
 
     /** @brief Persistent sdbusplus DBus bus connection. */
-    sdbusplus::bus_t& bus;
+    stdplus::PinnedRef<sdbusplus::bus_t> bus;
 
     /** @brief Dbus object path */
     std::string objPath;
@@ -231,10 +229,11 @@
     struct VlanProperties : VlanIfaces
     {
         VlanProperties(sdbusplus::bus_t& bus, stdplus::const_zstring objPath,
-                       const InterfaceInfo& info, EthernetInterface& eth);
+                       const InterfaceInfo& info,
+                       stdplus::PinnedRef<EthernetInterface> eth);
         void delete_() override;
         unsigned parentIdx;
-        EthernetInterface& eth;
+        stdplus::PinnedRef<EthernetInterface> eth;
     };
     std::optional<VlanProperties> vlan;
 
@@ -242,7 +241,8 @@
     friend class TestNetworkManager;
 
   private:
-    EthernetInterface(sdbusplus::bus_t& bus, Manager& manager,
+    EthernetInterface(stdplus::PinnedRef<sdbusplus::bus_t> bus,
+                      stdplus::PinnedRef<Manager> manager,
                       const AllIntfInfo& info, std::string&& objPath,
                       const config::Parser& config, bool enabled);
 
diff --git a/src/inventory_mac.cpp b/src/inventory_mac.cpp
index fb38d72..7eaa3c4 100644
--- a/src/inventory_mac.cpp
+++ b/src/inventory_mac.cpp
@@ -337,9 +337,10 @@
     }
 }
 
-std::unique_ptr<Runtime> watch(sdbusplus::bus_t& bus, Manager& m)
+std::unique_ptr<Runtime> watch(stdplus::PinnedRef<sdbusplus::bus_t> bus,
+                               stdplus::PinnedRef<Manager> m)
 {
-    manager = &m;
+    manager = &m.get();
     std::ifstream in(configFile);
     nlohmann::json configJson;
     in >> configJson;
diff --git a/src/inventory_mac.hpp b/src/inventory_mac.hpp
index 72b312d..1b6aa8b 100644
--- a/src/inventory_mac.hpp
+++ b/src/inventory_mac.hpp
@@ -1,6 +1,7 @@
 #pragma once
 #include <memory>
 #include <sdbusplus/bus.hpp>
+#include <stdplus/pinned.hpp>
 
 namespace phosphor::network
 {
@@ -14,7 +15,8 @@
 {
     virtual ~Runtime() = default;
 };
-std::unique_ptr<Runtime> watch(sdbusplus::bus_t& bus, Manager& m);
+std::unique_ptr<Runtime> watch(stdplus::PinnedRef<sdbusplus::bus_t> bus,
+                               stdplus::PinnedRef<Manager> m);
 
 } // namespace inventory
 } // namespace phosphor::network
diff --git a/src/ipaddress.cpp b/src/ipaddress.cpp
index 07e37e4..62ac220 100644
--- a/src/ipaddress.cpp
+++ b/src/ipaddress.cpp
@@ -46,7 +46,7 @@
 };
 
 IPAddress::IPAddress(sdbusplus::bus_t& bus, std::string_view objRoot,
-                     EthernetInterface& parent, IfAddr addr,
+                     stdplus::PinnedRef<EthernetInterface> parent, IfAddr addr,
                      AddressOrigin origin) :
     IPAddress(bus, makeObjPath(objRoot, addr), parent, addr, origin)
 {
@@ -54,7 +54,7 @@
 
 IPAddress::IPAddress(sdbusplus::bus_t& bus,
                      sdbusplus::message::object_path objPath,
-                     EthernetInterface& parent, IfAddr addr,
+                     stdplus::PinnedRef<EthernetInterface> parent, IfAddr addr,
                      AddressOrigin origin) :
     IPIfaces(bus, objPath.str.c_str(), IPIfaces::action::defer_emit),
     parent(parent), objPath(std::move(objPath))
@@ -94,23 +94,24 @@
         log<level::ERR>("Tried to delete a non-static address"),
             entry("ADDRESS=%s", address().c_str()),
             entry("PREFIX=%" PRIu8, prefixLength()),
-            entry("INTERFACE=%s", parent.interfaceName().c_str());
+            entry("INTERFACE=%s", parent.get().interfaceName().c_str());
         elog<InternalFailure>();
     }
 
     std::unique_ptr<IPAddress> ptr;
-    for (auto it = parent.addrs.begin(); it != parent.addrs.end(); ++it)
+    auto& addrs = parent.get().addrs;
+    for (auto it = addrs.begin(); it != addrs.end(); ++it)
     {
         if (it->second.get() == this)
         {
             ptr = std::move(it->second);
-            parent.addrs.erase(it);
+            addrs.erase(it);
             break;
         }
     }
 
-    parent.writeConfigurationFile();
-    parent.manager.reloadConfigs();
+    parent.get().writeConfigurationFile();
+    parent.get().manager.get().reloadConfigs();
 }
 
 } // namespace network
diff --git a/src/ipaddress.hpp b/src/ipaddress.hpp
index 05aafbd..743025b 100644
--- a/src/ipaddress.hpp
+++ b/src/ipaddress.hpp
@@ -4,6 +4,7 @@
 #include <sdbusplus/bus.hpp>
 #include <sdbusplus/message/native_types.hpp>
 #include <sdbusplus/server/object.hpp>
+#include <stdplus/pinned.hpp>
 #include <string_view>
 #include <xyz/openbmc_project/Network/IP/server.hpp>
 #include <xyz/openbmc_project/Object/Delete/server.hpp>
@@ -30,13 +31,6 @@
 class IPAddress : public IPIfaces
 {
   public:
-    IPAddress() = delete;
-    IPAddress(const IPAddress&) = delete;
-    IPAddress& operator=(const IPAddress&) = delete;
-    IPAddress(IPAddress&&) = delete;
-    IPAddress& operator=(IPAddress&&) = delete;
-    virtual ~IPAddress() = default;
-
     /** @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.
@@ -45,7 +39,8 @@
      *  @param[in] origin - origin of ipaddress(dhcp/static/SLAAC/LinkLocal).
      */
     IPAddress(sdbusplus::bus_t& bus, std::string_view objRoot,
-              EthernetInterface& parent, IfAddr addr, IP::AddressOrigin origin);
+              stdplus::PinnedRef<EthernetInterface> parent, IfAddr addr,
+              IP::AddressOrigin origin);
 
     std::string address(std::string ipAddress) override;
     uint8_t prefixLength(uint8_t) override;
@@ -70,13 +65,14 @@
 
   private:
     /** @brief Parent Object. */
-    EthernetInterface& parent;
+    stdplus::PinnedRef<EthernetInterface> parent;
 
     /** @brief Dbus object path */
     sdbusplus::message::object_path objPath;
 
     IPAddress(sdbusplus::bus_t& bus, sdbusplus::message::object_path objPath,
-              EthernetInterface& parent, IfAddr addr, IP::AddressOrigin origin);
+              stdplus::PinnedRef<EthernetInterface> parent, IfAddr addr,
+              IP::AddressOrigin origin);
 };
 
 } // namespace network
diff --git a/src/neighbor.cpp b/src/neighbor.cpp
index 6b8d853..959f524 100644
--- a/src/neighbor.cpp
+++ b/src/neighbor.cpp
@@ -21,16 +21,16 @@
 }
 
 Neighbor::Neighbor(sdbusplus::bus_t& bus, std::string_view objRoot,
-                   EthernetInterface& parent, InAddrAny addr, ether_addr lladdr,
-                   State state) :
+                   stdplus::PinnedRef<EthernetInterface> parent, InAddrAny addr,
+                   ether_addr lladdr, State state) :
     Neighbor(bus, makeObjPath(objRoot, addr), parent, addr, lladdr, state)
 {
 }
 
 Neighbor::Neighbor(sdbusplus::bus_t& bus,
                    sdbusplus::message::object_path objPath,
-                   EthernetInterface& parent, InAddrAny addr, ether_addr lladdr,
-                   State state) :
+                   stdplus::PinnedRef<EthernetInterface> parent, InAddrAny addr,
+                   ether_addr lladdr, State state) :
     NeighborObj(bus, objPath.str.c_str(), NeighborObj::action::defer_emit),
     parent(parent), objPath(std::move(objPath))
 {
@@ -42,7 +42,7 @@
 
 void Neighbor::delete_()
 {
-    auto& neighbors = parent.staticNeighbors;
+    auto& neighbors = parent.get().staticNeighbors;
     std::unique_ptr<Neighbor> ptr;
     for (auto it = neighbors.begin(); it != neighbors.end(); ++it)
     {
@@ -54,8 +54,8 @@
         }
     }
 
-    parent.writeConfigurationFile();
-    parent.manager.reloadConfigs();
+    parent.get().writeConfigurationFile();
+    parent.get().manager.get().reloadConfigs();
 }
 
 using sdbusplus::xyz::openbmc_project::Common::Error::NotAllowed;
diff --git a/src/neighbor.hpp b/src/neighbor.hpp
index 37f8d17..861a1ec 100644
--- a/src/neighbor.hpp
+++ b/src/neighbor.hpp
@@ -4,6 +4,7 @@
 #include <sdbusplus/bus.hpp>
 #include <sdbusplus/message/native_types.hpp>
 #include <sdbusplus/server/object.hpp>
+#include <stdplus/pinned.hpp>
 #include <string_view>
 #include <xyz/openbmc_project/Network/Neighbor/server.hpp>
 #include <xyz/openbmc_project/Object/Delete/server.hpp>
@@ -28,15 +29,6 @@
 class Neighbor : public NeighborObj
 {
   public:
-    using State = NeighborIntf::State;
-
-    Neighbor() = delete;
-    Neighbor(const Neighbor&) = delete;
-    Neighbor& operator=(const Neighbor&) = delete;
-    Neighbor(Neighbor&&) = delete;
-    Neighbor& operator=(Neighbor&&) = delete;
-    virtual ~Neighbor() = default;
-
     /** @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.
@@ -46,8 +38,8 @@
      *  @param[in] state - The state of the neighbor entry.
      */
     Neighbor(sdbusplus::bus_t& bus, std::string_view objRoot,
-             EthernetInterface& parent, InAddrAny addr, ether_addr lladdr,
-             State state);
+             stdplus::PinnedRef<EthernetInterface> parent, InAddrAny addr,
+             ether_addr lladdr, State state);
 
     /** @brief Delete this d-bus object.
      */
@@ -67,14 +59,14 @@
 
   private:
     /** @brief Parent Object. */
-    EthernetInterface& parent;
+    stdplus::PinnedRef<EthernetInterface> parent;
 
     /** @brief Dbus object path */
     sdbusplus::message::object_path objPath;
 
     Neighbor(sdbusplus::bus_t& bus, sdbusplus::message::object_path objPath,
-             EthernetInterface& parent, InAddrAny addr, ether_addr lladdr,
-             State state);
+             stdplus::PinnedRef<EthernetInterface> parent, InAddrAny addr,
+             ether_addr lladdr, State state);
 };
 
 } // namespace network
diff --git a/src/network_manager.cpp b/src/network_manager.cpp
index 557e826..060242c 100644
--- a/src/network_manager.cpp
+++ b/src/network_manager.cpp
@@ -14,6 +14,7 @@
 #include <phosphor-logging/elog-errors.hpp>
 #include <phosphor-logging/log.hpp>
 #include <sdbusplus/message.hpp>
+#include <stdplus/pinned.hpp>
 #include <xyz/openbmc_project/Common/error.hpp>
 
 constexpr char SYSTEMD_BUSNAME[] = "org.freedesktop.systemd1";
@@ -39,13 +40,14 @@
     "link',interface='org.freedesktop.DBus.Properties',member='"
     "PropertiesChanged',arg0='org.freedesktop.network1.Link',";
 
-Manager::Manager(sdbusplus::bus_t& bus, DelayedExecutor& reload,
-                 stdplus::zstring_view objPath,
+Manager::Manager(stdplus::PinnedRef<sdbusplus::bus_t> bus,
+                 DelayedExecutor& reload, stdplus::zstring_view objPath,
                  const std::filesystem::path& confDir) :
     ManagerIface(bus, objPath.c_str(), ManagerIface::action::defer_emit),
     reload(reload), bus(bus), objPath(std::string(objPath)), confDir(confDir),
     systemdNetworkdEnabledMatch(
-        bus, enabledMatch, [&](sdbusplus::message_t& m) {
+        bus, enabledMatch,
+        [man = stdplus::PinnedRef(*this)](sdbusplus::message_t& m) {
             std::string intf;
             std::unordered_map<std::string, std::variant<std::string>> values;
             try
@@ -64,7 +66,7 @@
                 }
                 auto ifidx = DecodeInt<unsigned, 10>{}(obj.substr(sep + 3));
                 const auto& state = std::get<std::string>(it->second);
-                handleAdminState(state, ifidx);
+                man.get().handleAdminState(state, ifidx);
             }
             catch (const std::exception& e)
             {
@@ -92,9 +94,10 @@
         reloadPreHooks.clear();
         try
         {
-            auto method = bus.new_method_call(NETWORKD_BUSNAME, NETWORKD_PATH,
-                                              NETWORKD_INTERFACE, "Reload");
-            bus.call_noreply(method);
+            bus.get()
+                .new_method_call(NETWORKD_BUSNAME, NETWORKD_PATH,
+                                 NETWORKD_INTERFACE, "Reload")
+                .call();
             log<level::INFO>("Reloaded systemd-networkd");
         }
         catch (const sdbusplus::exception_t& ex)
@@ -122,11 +125,12 @@
         links;
     try
     {
-        auto rsp =
-            bus.new_method_call("org.freedesktop.network1",
-                                "/org/freedesktop/network1",
-                                "org.freedesktop.network1.Manager", "ListLinks")
-                .call();
+        auto rsp = bus.get()
+                       .new_method_call("org.freedesktop.network1",
+                                        "/org/freedesktop/network1",
+                                        "org.freedesktop.network1.Manager",
+                                        "ListLinks")
+                       .call();
         rsp.read(links);
     }
     catch (const sdbusplus::exception::SdBusError& e)
@@ -138,8 +142,8 @@
         unsigned ifidx = std::get<0>(link);
         auto obj = fmt::format("/org/freedesktop/network1/link/_3{}", ifidx);
         auto req =
-            bus.new_method_call("org.freedesktop.network1", obj.c_str(),
-                                "org.freedesktop.DBus.Properties", "Get");
+            bus.get().new_method_call("org.freedesktop.network1", obj.c_str(),
+                                      "org.freedesktop.DBus.Properties", "Get");
         req.append("org.freedesktop.network1.Link", "AdministrativeState");
         auto rsp = req.call();
         std::variant<std::string> val;
diff --git a/src/network_manager.hpp b/src/network_manager.hpp
index 890a837..490c4bc 100644
--- a/src/network_manager.hpp
+++ b/src/network_manager.hpp
@@ -11,6 +11,7 @@
 #include <sdbusplus/bus.hpp>
 #include <sdbusplus/bus/match.hpp>
 #include <sdbusplus/message/native_types.hpp>
+#include <stdplus/pinned.hpp>
 #include <stdplus/zstring_view.hpp>
 #include <string>
 #include <string_view>
@@ -41,8 +42,6 @@
 class Manager : public ManagerIface
 {
   public:
-    Manager(const Manager&) = delete;
-    Manager& operator=(const Manager&) = delete;
     Manager(Manager&&) = delete;
     Manager& operator=(Manager&&) = delete;
 
@@ -52,7 +51,7 @@
      *  @param[in] objPath - Path to attach at.
      *  @param[in] confDir - Network Configuration directory path.
      */
-    Manager(sdbusplus::bus_t& bus, DelayedExecutor& reload,
+    Manager(stdplus::PinnedRef<sdbusplus::bus_t> bus, DelayedExecutor& reload,
             stdplus::zstring_view objPath,
             const std::filesystem::path& confDir);
 
@@ -133,7 +132,7 @@
     DelayedExecutor& reload;
 
     /** @brief Persistent sdbusplus DBus bus connection. */
-    sdbusplus::bus_t& bus;
+    stdplus::PinnedRef<sdbusplus::bus_t> bus;
 
     /** @brief BMC network reset - resets network configuration for BMC. */
     void reset() override;
diff --git a/src/network_manager_main.cpp b/src/network_manager_main.cpp
index 170241d..dc562cb 100644
--- a/src/network_manager_main.cpp
+++ b/src/network_manager_main.cpp
@@ -17,6 +17,7 @@
 #include <sdeventplus/event.hpp>
 #include <sdeventplus/source/signal.hpp>
 #include <sdeventplus/utility/timer.hpp>
+#include <stdplus/pinned.hpp>
 #include <stdplus/signal.hpp>
 
 using phosphor::logging::level;
@@ -65,11 +66,11 @@
     stdplus::signal::block(SIGTERM);
     sdeventplus::source::Signal(event, SIGTERM, termCb).set_floating(true);
 
-    auto bus = sdbusplus::bus::new_default();
+    stdplus::Pinned bus = sdbusplus::bus::new_default();
     bus.attach_event(event.get(), SD_EVENT_PRIORITY_NORMAL);
     sdbusplus::server::manager_t objManager(bus, DEFAULT_OBJPATH);
 
-    TimerExecutor reload(event, std::chrono::seconds(3));
+    stdplus::Pinned<TimerExecutor> reload(event, std::chrono::seconds(3));
     Manager manager(bus, reload, DEFAULT_OBJPATH, "/etc/systemd/network");
     netlink::Server svr(event, manager);
 
diff --git a/src/system_configuration.cpp b/src/system_configuration.cpp
index bccdb02..58b6dfc 100644
--- a/src/system_configuration.cpp
+++ b/src/system_configuration.cpp
@@ -2,6 +2,7 @@
 
 #include <phosphor-logging/elog-errors.hpp>
 #include <phosphor-logging/log.hpp>
+#include <stdplus/pinned.hpp>
 #include <xyz/openbmc_project/Common/error.hpp>
 
 namespace phosphor
@@ -22,40 +23,43 @@
     "interface='org.freedesktop.DBus.Properties',member='PropertiesChanged',"
     "arg0='org.freedesktop.hostname1'";
 
-SystemConfiguration::SystemConfiguration(sdbusplus::bus_t& bus,
-                                         stdplus::const_zstring objPath) :
+SystemConfiguration::SystemConfiguration(
+    stdplus::PinnedRef<sdbusplus::bus_t> bus, stdplus::const_zstring objPath) :
     Iface(bus, objPath.c_str(), Iface::action::defer_emit),
-    bus(bus), hostnamePropMatch(bus, propMatch, [&](sdbusplus::message_t& m) {
-        std::string intf;
-        std::unordered_map<std::string, std::variant<std::string>> values;
-        try
-        {
-            m.read(intf, values);
-            auto it = values.find("Hostname");
-            if (it == values.end())
+    bus(bus),
+    hostnamePropMatch(
+        bus, propMatch,
+        [sc = stdplus::PinnedRef(*this)](sdbusplus::message_t& m) {
+            std::string intf;
+            std::unordered_map<std::string, std::variant<std::string>> values;
+            try
             {
-                return;
+                m.read(intf, values);
+                auto it = values.find("Hostname");
+                if (it == values.end())
+                {
+                    return;
+                }
+                sc.get().Iface::hostName(std::get<std::string>(it->second));
             }
-            Iface::hostName(std::get<std::string>(it->second));
-        }
-        catch (const std::exception& e)
-        {
-            log<level::ERR>(
-                fmt::format("Hostname match parsing failed: {}", e.what())
-                    .c_str(),
-                entry("ERROR=%s", e.what()));
-        }
-    })
+            catch (const std::exception& e)
+            {
+                log<level::ERR>(
+                    fmt::format("Hostname match parsing failed: {}", e.what())
+                        .c_str(),
+                    entry("ERROR=%s", e.what()));
+            }
+        })
 {
     try
     {
         std::variant<std::string> name;
         auto req =
-            bus.new_method_call(HOSTNAMED_SVC, HOSTNAMED_OBJ,
-                                "org.freedesktop.DBus.Properties", "Get");
+            bus.get().new_method_call(HOSTNAMED_SVC, HOSTNAMED_OBJ,
+                                      "org.freedesktop.DBus.Properties", "Get");
 
         req.append(HOSTNAMED_INTF, "Hostname");
-        auto reply = bus.call(req);
+        auto reply = req.call();
         reply.read(name);
         SystemConfigIntf::hostName(std::get<std::string>(name), true);
     }
@@ -76,10 +80,10 @@
     }
     try
     {
-        auto method = bus.new_method_call(HOSTNAMED_SVC, HOSTNAMED_OBJ,
-                                          HOSTNAMED_INTF, "SetStaticHostname");
+        auto method = bus.get().new_method_call(
+            HOSTNAMED_SVC, HOSTNAMED_OBJ, HOSTNAMED_INTF, "SetStaticHostname");
         method.append(name, /*interactive=*/false);
-        bus.call_noreply(method);
+        bus.get().call_noreply(method);
         return SystemConfigIntf::hostName(std::move(name));
     }
     catch (const std::exception& e)
diff --git a/src/system_configuration.hpp b/src/system_configuration.hpp
index b3d91d3..4eceec0 100644
--- a/src/system_configuration.hpp
+++ b/src/system_configuration.hpp
@@ -3,6 +3,7 @@
 #include <sdbusplus/bus.hpp>
 #include <sdbusplus/bus/match.hpp>
 #include <sdbusplus/server/object.hpp>
+#include <stdplus/pinned.hpp>
 #include <stdplus/zstring.hpp>
 #include <string>
 #include <xyz/openbmc_project/Network/SystemConfiguration/server.hpp>
@@ -27,19 +28,16 @@
 class SystemConfiguration : public Iface
 {
   public:
-    SystemConfiguration() = default;
-    SystemConfiguration(const SystemConfiguration&) = delete;
-    SystemConfiguration& operator=(const SystemConfiguration&) = delete;
     SystemConfiguration(SystemConfiguration&&) = delete;
     SystemConfiguration& operator=(SystemConfiguration&&) = delete;
-    virtual ~SystemConfiguration() = default;
 
     /** @brief Constructor to put object onto bus at a dbus path.
      *  @param[in] bus - Bus to attach to.
      *  @param[in] objPath - Path to attach at.
      *  @param[in] parent - Parent object.
      */
-    SystemConfiguration(sdbusplus::bus_t& bus, stdplus::const_zstring objPath);
+    SystemConfiguration(stdplus::PinnedRef<sdbusplus::bus_t> bus,
+                        stdplus::const_zstring objPath);
 
     /** @brief set the hostname of the system.
      *  @param[in] name - host name of the system.
@@ -48,7 +46,7 @@
 
   private:
     /** @brief Persistent sdbusplus DBus bus connection. */
-    sdbusplus::bus_t& bus;
+    stdplus::PinnedRef<sdbusplus::bus_t> bus;
 
     /** @brief Monitor for hostname changes */
     sdbusplus::bus::match_t hostnamePropMatch;
