force_add_slave was designed to be called right after the link_set_master
call to override our internal cache and not wait for the kernel and register
the slave/master relationship in our internal data-structures. It turns
out the kernel can be faster than us here. So an additional check is needed
to make sure we don't do duplicate operations that would result in the
slave being removed from an internal data-structure.
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
Openvswitch already manage mtu if ovs-mtu is defined.
(Ovs manage mtu in userland, and sync mtu for some interfaces in kernel).
If mtu is changed by address module, before the ovs userland mtu,
this give packets drop.
original commit ported to the python3 branch:
commit bffa619b11ae7aa9e567c26c255c17ac6df2c495
Author: Maximilian Wilhelm <max@rfc2324.org>
Date: Sat Jan 14 19:08:01 2017 +0100
Add option 'veth-peer-name' to veth links and ensure proper configuration.
The option »veth-peer-name« forces an veth peer link to be created with
a specific interface name. As the interface name of the "local" part of
the veth link pair already is defined by the name of the interface stanza
this option is added to, now both sides are clearly named.
As there is a bidirectional dependency of both link pairs - both cannot
exist without the other - this presents a problem when setting up all
interfaces. Depending on which interface is set up first there might be
a problem when only on dependency is specified. Therefore adding the
»veth-peer-name« option to both interface of the veth link pair ensures
that regardless of which side is configured first the peer name will be
set correctly. This intentionally creates a circular dependency which is
handled accordingly.
Fixing the config check for veth link-type while at it :)
Signed-off-by: Maximilian Wilhelm <max@rfc2324.org>
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
Enabling this attribute on a bridge will
enslave a dummy interface to the bridge
example:
auto bridge
iface bridge
bridge-vlan-aware yes
bridge-always-up yes
bridge-ports vni42
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
ifupdown2 now tries to monitor the dhclient call to see if an ip address was
successfully assigned on the requested device. The number of retry can be
customized using the "dhclient_retry_on_failure" policy variable (which defaults to 0)
This commit also add debugging capabilities by automatically enabling sysloging when
configuring dhcp at boot (with PERFMODE option).
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
Seems like the regex module might be behave a little bit different in python3.
The regexes used to validate l2protocol-tunnel were returning incorrect lists:
value=lldp,stp
regex=['', 'l', 'l', 'd', 'p', '', 's', 't', 'p', '']
the patch simplifies the code by using str.translate and str.split
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
In the addressvirtual module we have some code that checks if stale macvlans should
be deleted (when the address-virtual or vrrp keywords are removed from the config).
To find those stale macvlans we basically do a glob search in /sys/class/net/ with
the macvlan prefix (ifname) defined by ifupdown2: '%s-v' % ifaceobj.name[0:13], which
for a device foo would create macvlans named foo-v0...foo-vN.
In this particular case we have a vxlan named: sha3szx4-vpn, which gets matched
and removed without actually checking if this device is a macvlan or not.
This commit adds a link_kind check to ensure that we are only removing macvlans.
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
ES bonds have the same "init state" requirements as CLAG bonds -
1. A bond needs to be designated as an "es-bond" for this purpose.
For clag-bonds we used "clag-id" attr (to designate a bond as a "clag-bond").
For ES bonds we will use "es-sys-mac" attr.
2. Slaves added to an "ES bond" must have protodown-on.
This is again similar to CLAG bonds
3. And vice-versa i.e. when a slave is removed from an "es-bond",
protodown-on must be cleared.
4. When es-sys-mac is first set on a bond, all the bond-slaves must be
placed in "protodown-on" state. This is needed whether FRR is running at that point or not.
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
When --with-defaults is provided we update the stanza-data structure without
making sure we are dealing with a vxlan intf.
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>