Commit Graph

1580 Commits

Author SHA1 Message Date
Julien Fortin
caac1e90b0 addons: vxlan: single-vxlan: remove local ip cidr before executing iproute2 link add
When creating a single-vxlan device we were sending local tunnel ip address with ip
network prefix. This patch avoid the following error:

error: cmd '/bin/ip link add dev vxlan0 type vxlan external local 27.0.0.9/32 dstport 4789' failed: returned 1 (Error: any valid address is expected rather than "27.0.0.9/32".
)

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2020-08-06 14:17:08 +02:00
Julien Fortin
366da8b334 addons: vrf: removing link-down after slave is removed from a VRF
This was added back when ifupdown2 was using brctl to del bridges.
brctl doesn't allow deleting a bridge if the bridge is still admin up.
Now that we moved to netlink this is not needed anymore.

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2020-08-06 14:06:31 +02:00
lcawley
f343240c18 addons: ethtool: add support for 200G and 400G link speeds
Signed-off-by: lcawley <lcawley@cumulusnetworks.com>
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2020-08-06 14:02:15 +02:00
Julien Fortin
1b51e5a6d6 addons: dhcp: skipping dhcp configuration if link-down yes
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2020-08-06 13:59:41 +02:00
Julien Fortin
5358dfceb8 addons: dhcp: don't raise an exception after dhcp retry-failure
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2020-08-06 13:57:32 +02:00
Julien Fortin
086351cb7e addons: bridge: remove bridge-mcmi range check
The kernel doesn't seem to enforce any specific range, ifupdown2
shouldn't either.

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2020-08-06 13:57:13 +02:00
Jasperswaagman
6adcd9fe68
Update bridge.py
Readds the `none` value as a valid value for bridge-ports.
2020-07-29 18:01:12 +02:00
Julien Fortin
6d4fd3f017
Merge pull request #154 from CumulusNetworks/issue-43/support-for-vxlan-ipv6-attributes
addons: vxlan: add support for ipv6 attributes svcnodeip6 and mcastgrp6
2020-07-01 16:55:50 +02:00
Julien Fortin
0c019b802d
Merge branch 'master' into issue-43/support-for-vxlan-ipv6-attributes 2020-07-01 16:55:38 +02:00
Julien Fortin
ba3c32b097 debian: control: dropping build-depends: dh-systemd
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2020-06-24 01:44:30 +02:00
Julien Fortin
c4b60e1542 debian: update changelog entry and control: standards-version
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2020-06-24 01:35:16 +02:00
Julien Fortin
3218f49d81 use "except Exception:" instead of "except:"
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2020-06-24 01:12:24 +02:00
Julien Fortin
efa80e3043 addons: dhcp: don't enable syslog for ifquery
Ticket: CM-29849
Reviewed By: Roopa

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2020-06-23 17:46:48 +02:00
Julien Fortin
c742bf43eb Merge branch 'master' of github.com:CumulusNetworks/ifupdown2
* 'master' of github.com:CumulusNetworks/ifupdown2:
  Updated additional packages requirements
2020-06-19 16:42:16 +02:00
Julien Fortin
0eae03e867
Merge pull request #168 from netfreak98/patch-1
Updated additional packages requirements (python3)
2020-06-18 18:58:52 +02:00
Julien Fortin
0e159829a6 lib: iproute2: re-add missing bridge_vlan_add_vid_list method
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2020-06-18 18:18:00 +02:00
Julien Fortin
5f6de69fd3 lockfile: return a specific exit code when another instance is already running
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2020-06-18 18:17:12 +02:00
Julien Fortin
7b56575ebd nlcache: force_add_slave: don't update internal data-structure if not needed
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>
2020-06-18 18:16:34 +02:00
Julien Fortin
c44a7a3635 template engine: decode bytes into str
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2020-06-18 18:16:02 +02:00
Julien Fortin
4a888991da main: re-add lockFile check to avoid concurrent execution
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2020-06-18 18:15:24 +02:00
Julien Fortin
47090bf6df lib: iproute2: don't flush macvlan addresses but only removed addrs
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2020-06-18 18:13:46 +02:00
Julien Fortin
f00d0dcd8c addons: dhcp: enable syslog at boot & fix syslog log-level
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2020-06-18 17:48:18 +02:00
Julien Fortin
5cf3c6a196 main: nlcache: don't run netlink cleanup if it was never initialized
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2020-06-18 17:37:14 +02:00
netfreak98
2da842a9d7
Updated additional packages requirements 2020-06-18 14:56:57 +02:00
Julien Fortin
09cdf1c6dd
Merge pull request #167 from aderumier/ovs_mtu3
address: don't process_mtu for openvswitch interfaces
2020-06-05 13:34:56 +02:00
Alexandre Derumier
8994bdd39a address: don't process_mtu for openvswitch interfaces
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.
2020-06-05 08:07:04 +02:00
Julien Fortin
e665b9f166
Merge pull request #164 from aderumier/ovs_ports
addons: openvswitch: allow multiple ovs-ports + glob/regex
2020-05-29 15:02:53 +02:00
Alexandre Derumier
6cdb2b3d22 addons: openvswitch: allow multiple ovs-ports + glob/regex 2020-05-28 11:21:55 +02:00
Julien Fortin
76bb5414c0 README: add Alexandre Derumier in the contributor's list
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2020-05-27 15:55:41 +02:00
Julien Fortin
e7bb27f5fe
Merge pull request #162 from aderumier/buffer_fix
nllistener: increase netlink buffer to 64k
2020-05-27 15:53:51 +02:00
Alexandre Derumier
523b347ad4 nllistener: increase netlink buffer to 64k
Currently 4k buffer is too small to handle some netlink messages

(Like bridge vlans for example, with 32k messages detected).
2020-05-27 15:49:49 +02:00
Julien Fortin
05e825a486 debian: changelog: update 3.0.0-1 entry for "ovs-ports-condone-regex" attribute
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2020-05-17 19:07:34 +02:00
Julien Fortin
8ac72bb5b7 Merge branch 'master' of github.com:CumulusNetworks/ifupdown2
* 'master' of github.com:CumulusNetworks/ifupdown2:
  addon: openvswitch : add ovs-ports-condone-regex option
  allow systemd to execute the helper script
2020-05-17 19:06:25 +02:00
Julien Fortin
4612f28b57
Merge pull request #157 from aderumier/ovs-fix
addon: openvswitch : add ovs-ports-condone-regex option
2020-05-17 19:05:12 +02:00
Julien Fortin
214cefb325 veth-peer-name: check if dependent interface exists in /e/n/i
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2020-05-17 19:01:35 +02:00
Alexandre Derumier
5efdf225e1 addon: openvswitch : add ovs-ports-condone-regex option
Like for bridge, add a option to skip delete a regex list of interfaces.
(can be usefull for hypervisor, when vm interfaces are dynamically plugged)
2020-05-16 08:11:22 +02:00
Julien Fortin
60edf8f14d
Merge pull request #155 from bauen1/fix-start-networking-script
allow systemd to execute the helper script
2020-05-15 17:51:29 +02:00
Julien Fortin
100fab20b6 addons: link: use iproute2 to create custom devices (fixes #156)
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2020-05-15 17:49:56 +02:00
bauen1
5cbe13d17a
allow systemd to execute the helper script 2020-05-15 17:16:04 +02:00
Julien Fortin
406583375e addons: vxlan: add support for ipv6 attributes svcnodeip6 and mcastgrp6
vxlan-svcnodeip6": {
    "help": "vxlan svc node ip",
    "validvals": ["<ipv6>"],
    "example": ["vxlan-svcnodeip6 2001:DB8:8086:6502::"]
}

"vxlan-mcastgrp6": {
    "help": "vxlan multicast group",
    "validvals": ["<ip6>"],
    "example": ["vxlan-mcastgrp ff02::15c"],
}

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2020-05-15 04:32:38 +02:00
Julien Fortin
5890ab714e addons: link: porting 'veth-peer-name' attribute to python3 branch
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>
2020-05-14 04:08:04 +02:00
Julien Fortin
8a78cd07bc addons: bridge: fix NoneType is not iterable exception
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2020-05-14 02:55:30 +02:00
Julien Fortin
5564426d05 debian: changelog: update 3.0.0-1 entry
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2020-05-14 02:31:00 +02:00
Julien Fortin
e537a6e6d6 add support for single vxlan device (bridge-vlan-vni-map)
new attribute:

"bridge-vlan-vni-map": {
    "help": "Single vxlan support",
    "example": "bridge-vlan-vni-map 1000-1001=1000-1001",
}

example of config:

auto bridge
iface bridge
      bridge-vlan-aware yes
      bridge-ports vxlan0 swp1
      bridge-stp on
      bridge-vids 1000-1001
      bridge-pvid 1

auto vxlan0
iface vxlan0
      vxlan-local-tunnelip 27.0.0.9
      bridge-learning off
      # vlan 1000-1001 maps to vni 1000-1001
      bridge-vlan-vni-map 1000-1001=1000-1001

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2020-05-14 02:18:39 +02:00
Julien Fortin
7840bd2c09 addons: bridge: add support for new bridge-always-up attribute
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>
2020-05-14 02:05:52 +02:00
Julien Fortin
4b706d71e2 addons: bond: fix es-sys-mac example
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2020-05-14 02:00:33 +02:00
Julien Fortin
b8ab3d5d7b main: catch ArgvParseError and don't display traceback
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2020-05-14 01:59:53 +02:00
Julien Fortin
4d9f4e59f3 addons: dchp: add debug logs and retry mechanism for dhclient (controled by policy)
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>
2020-05-14 01:53:22 +02:00
Julien Fortin
9b451d11dc networking.service: use start-networking script to control start/stop/reload
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2020-05-13 20:47:47 +02:00
Julien Fortin
3101ff1d6f ifupdownmain: syntax-check: l2protocol-tunnel: replace regex with str.split()
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>
2020-05-13 20:42:19 +02:00