diff --git a/src/network_manager.cpp b/src/network_manager.cpp
index 3dd171a..2634e11 100644
--- a/src/network_manager.cpp
+++ b/src/network_manager.cpp
@@ -131,6 +131,13 @@
 
 void Manager::createInterface(const UndiscoveredInfo& info, bool enabled)
 {
+    if (!info.intf.name)
+    {
+        auto msg = fmt::format("Can't create interface without name: {}",
+                               info.intf.idx);
+        log<level::ERR>(msg.c_str(), entry("IFIDX=%u", info.intf.idx));
+        return;
+    }
     removeInterface(info.intf);
     config::Parser config(config::pathForIntfConf(confDir, *info.intf.name));
     auto intf = std::make_unique<EthernetInterface>(
@@ -148,18 +155,24 @@
 {
     if (info.flags & IFF_LOOPBACK)
     {
+        ignoredIntf.emplace(info.idx);
         return;
     }
-    if (!info.name)
+    if (info.name)
     {
-        throw std::invalid_argument("Interface missing name");
-    }
-    const auto& ignored = internal::getIgnoredInterfaces();
-    if (ignored.find(*info.name) != ignored.end())
-    {
-        auto msg = fmt::format("Ignoring interface {}\n", *info.name);
-        log<level::INFO>(msg.c_str());
-        return;
+        const auto& ignored = internal::getIgnoredInterfaces();
+        if (ignored.find(*info.name) != ignored.end())
+        {
+            static std::unordered_set<std::string> ignored;
+            if (!ignored.contains(*info.name))
+            {
+                ignored.emplace(*info.name);
+                auto msg = fmt::format("Ignoring interface {}\n", *info.name);
+                log<level::INFO>(msg.c_str());
+            }
+            ignoredIntf.emplace(info.idx);
+            return;
+        }
     }
 
     auto it = systemdNetworkdEnabled.find(info.idx);
@@ -207,6 +220,7 @@
     else
     {
         undiscoveredIntfInfo.erase(info.idx);
+        ignoredIntf.erase(info.idx);
     }
     if (nit != interfaces.end())
     {
@@ -229,7 +243,7 @@
     {
         it->second.addrs.insert_or_assign(info.ifaddr, info);
     }
-    else
+    else if (!ignoredIntf.contains(info.ifidx))
     {
         throw std::runtime_error(
             fmt::format("Interface `{}` not found for addr", info.ifidx));
@@ -264,7 +278,7 @@
     {
         it->second.staticNeighs.insert_or_assign(*info.addr, info);
     }
-    else
+    else if (!ignoredIntf.contains(info.ifidx))
     {
         throw std::runtime_error(
             fmt::format("Interface `{}` not found for neigh", info.ifidx));
@@ -331,7 +345,7 @@
             },
             addr);
     }
-    else
+    else if (!ignoredIntf.contains(ifidx))
     {
         auto msg = fmt::format("Interface `{}` not found for gw", ifidx);
         log<level::ERR>(msg.c_str(), entry("IFIDX=%u", ifidx));
diff --git a/src/network_manager.hpp b/src/network_manager.hpp
index 3f0eaab..74e4fb1 100644
--- a/src/network_manager.hpp
+++ b/src/network_manager.hpp
@@ -196,6 +196,7 @@
         std::unordered_map<InAddrAny, NeighborInfo> staticNeighs = {};
     };
     std::unordered_map<unsigned, UndiscoveredInfo> undiscoveredIntfInfo;
+    std::unordered_set<unsigned> ignoredIntf;
 
     /** @brief Map of enabled interfaces */
     std::unordered_map<unsigned, bool> systemdNetworkdEnabled;
