diff --git a/plugins/module_utils/network/eos/facts/interfaces/interfaces.py b/plugins/module_utils/network/eos/facts/interfaces/interfaces.py index e285a3c02..f18fba88a 100644 --- a/plugins/module_utils/network/eos/facts/interfaces/interfaces.py +++ b/plugins/module_utils/network/eos/facts/interfaces/interfaces.py @@ -96,12 +96,8 @@ def render_config(self, spec, conf): shutdown = utils.parse_conf_cmd_arg(conf, "shutdown", False) config["enabled"] = shutdown if shutdown is False else True config["mtu"] = utils.parse_conf_arg(conf, "mtu") - config["mode"] = utils.parse_conf_cmd_arg( - conf, - "switchport", - "layer2", - "layer3", - ) + routed_port = utils.parse_conf_cmd_arg(conf, "no switchport", True) + config["mode"] = "layer3" if routed_port else "layer2" state = utils.parse_conf_arg(conf, "speed") if state: