diff --git a/debian/changelog b/debian/changelog index e6570a4..7ed6b94 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,6 +2,7 @@ ifupdown2 (1.2.0) UNRELEASED; urgency=medium * Package architecture refactoring and cleanups * Package can be build/install as debian, pip or rpm package * Makefile to easily perform tasks (i.e.: install, build, test, upload..) + * VRF slaves: add support for link-down yes * Closes #48: Run up/down on "manual" interfaces, but ignore any errors. * Closes #58: ifupdown2.conf: vlan_aware_bridge_address_support on/off * Traditional bridge support for mstpctl attr: (portautoedge, portrestrrole) diff --git a/ifupdown2/addons/vrf.py b/ifupdown2/addons/vrf.py index 7c98d9a..7cba995 100644 --- a/ifupdown2/addons/vrf.py +++ b/ifupdown2/addons/vrf.py @@ -495,7 +495,7 @@ class vrf(moduleBase): master_exists = False else: master_exists = False - if master_exists: + if master_exists and not ifaceobj.link_privflags & ifaceLinkPrivFlags.KEEP_LINK_DOWN: netlink.link_set_updown(ifacename, "up") else: self.log_error('vrf %s not around, skipping vrf config' @@ -673,6 +673,9 @@ class vrf(moduleBase): if ifaceobj.link_type == ifaceLinkType.LINK_MASTER: for s in config_slaves: try: + for slave_ifaceobj in ifaceobj_getfunc(s) or []: + if ifaceobj.link_privflags & ifaceLinkPrivFlags.KEEP_LINK_DOWN: + raise Exception('%s: slave configured with link-down yes') netlink.link_set_updown(s, "up") except Exception, e: self.logger.debug('%s: %s' % (ifaceobj.name, str(e))) @@ -774,7 +777,9 @@ class vrf(moduleBase): if add_slaves: self._add_vrf_slaves(ifaceobj, ifaceobj_getfunc) self._set_vrf_dev_processed_flag(ifaceobj) - netlink.link_set_updown(ifaceobj.name, "up") + + if not ifaceobj.link_privflags & ifaceLinkPrivFlags.KEEP_LINK_DOWN: + netlink.link_set_updown(ifaceobj.name, "up") except Exception, e: self.log_error('%s: %s' %(ifaceobj.name, str(e)), ifaceobj)