diff --git a/src/inet/networklayer/configurator/ipv4/Ipv4NetworkConfigurator.cc b/src/inet/networklayer/configurator/ipv4/Ipv4NetworkConfigurator.cc index bca01580da3..da72a9b0e05 100644 --- a/src/inet/networklayer/configurator/ipv4/Ipv4NetworkConfigurator.cc +++ b/src/inet/networklayer/configurator/ipv4/Ipv4NetworkConfigurator.cc @@ -243,8 +243,11 @@ void Ipv4NetworkConfigurator::configureRoutingTable(Node *node) auto route = check_and_cast(routingTable->getRoute(i)); if (route->getSourceType() == IRoute::MANUAL && route->getSource() == this) { auto predicate = [&] (const Ipv4Route *other) { return equalRoutes(route, other); }; - if (std::find_if(node->staticRoutes.begin(), node->staticRoutes.end(), predicate) != node->staticRoutes.end()) + if (contains(node->configuredNetworkInterfaces, route->getInterface()) && + std::find_if(node->staticRoutes.begin(), node->staticRoutes.end(), predicate) != node->staticRoutes.end()) + { i++; + } else { EV_DETAIL << "Removing route" << EV_FIELD(route) << EV_FIELD(nodePath) << endl; routingTable->deleteRoute(route);