1
0
mirror of https://github.com/CumulusNetworks/ifupdown2.git synced 2024-05-06 15:54:50 +00:00
Commit Graph

153 Commits

Author SHA1 Message Date
Julien Fortin
e15c8287cc SCALE: addressvirtual: replace glob.glob with listdir
using glob.glob is way to costly, use os.listdir to increase
performances.

Test with timeit show the following for 10k loop:
time_glob executed in 39.16788899600215 seconds
time_listdir executed in 5.625843115005409 seconds

Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2023-12-20 17:51:06 +01:00
Julien Fortin
f494105031 addons: addressvirtual: stale mac address detection was missing vrr without ip
The stale mac verification code was only working for the following syntax:

address-virtual MAC IP
and not
address-virtual MAC

Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2023-12-20 17:49:24 +01:00
Julien Fortin
d9bacfc2a7 netlink: keeping link down after mac change if 'link-down yes' is specified
Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2023-12-20 17:47:09 +01:00
Julien Fortin
e7ecc5ddcd addons: address: new attribute: disable-ipv6
"disable-ipv6": {
                "help": "disable IPv6",
                "validvals": ['on', 'off', 'yes', 'no', '0', '1'],
                "default": "no",
                "aliases": ["disable-ip6"]
            }

Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2023-12-20 17:44:38 +01:00
Julien Fortin
582b0acb9e addons: address: new policy default_loopback_scope
The loopback addresses on VRF devices is added with scope global.
The scope must be host to prevent the kernel using the address on external routing/addresses.

Since this change is CL specific we need to control this behavior via policy.
We will re-evaluate later if we make this the default behavior for upstream as well.

Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2023-12-20 17:40:08 +01:00
Mark Featherston
ccc6ac8fa5 debian: postinst: source /etc/network/interfaces.d/ in generated config 2023-12-08 11:07:57 -07:00
Julien Fortin
909ff39554 debian: changelog: new entry: 3.2.0
* Fix: Sonarqube issues
  * Fix: ifquery hangs indefinitely on ^C
  * Fix: Skipping admin down on deleted vlans
  * Fix: Merge existing MTU into new netlink object
  * Fix: scheduler: env variable not properly set for user commands (fixes #218)
  * Fix: ifquery-check: vlan-protocol for dotted interfaces
  * Fix: Down ops on vrf-slave should set the slave admin down
  * New: Allow bond creation without slaves
  * New: Add `--set-ring` option to ethtool
  * New: Openvswitch : add support for fakebridge
  * New: add support for systemd logging (--systemd)
  * New: Process hwaddress before processing ip addresses
  * New: Set protodown off on bond slave before bond is deleted
  * New: Make sure bond speed and slaves (swps) speed are matching

Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2023-05-04 13:21:55 +02:00
Julien Fortin
a51aad8d60 add support for systemd logging
New CLI option: --systemd
will enabled journalctl logging when ifupdown2 is run in a systemd context

Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2023-05-04 13:21:55 +02:00
Julien Fortin
95e4669536 Merge branch 'master' into fix/distutils_dependency 2022-05-31 15:30:16 +02:00
Adrien Banlin
793fb44ab0 distutils: fix dependency and lib replacement
As of now, the distutils is deprecated with removal planned for
python 3.12.

The recommended way is to use setuptools which is an enhanced
alternative to distutils maintained by the python packaging authority.

This commit replace with setuptools the distutil import inserted in the
8126ef0c00 commit.

This commit also update the debian control runtime dependency.

distutils: https://docs.python.org/3/library/distutils.html
setuptools: https://setuptools.pypa.io/en/latest/
2022-05-31 14:57:12 +02:00
Adrien Banlin
b4cfbc67bf gvgen: fix module dependency
gvgen module require the six module from python3-six package.

This new dependency is only necessary for python2/python3 cross
compatibility on dict.iteritems() (py2) vs dict.items() (py3).

ifupdown2 does not support python2 so we could replace every iteritems
occurrences to it's python3 format but this means the gvgen module will
diff from upstream.

The simplest way is to make ifupdown depends on python3-six.
2022-05-31 10:59:43 +02:00
Julien Fortin
dee2c49d58 update contact info and copyright dates
Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2022-05-28 11:40:16 +02:00
Julien Fortin
bb29085200 Merge pull request #190 from tjjh89017/fix_systemd_start_order
networking.service: fix start networking.service before network is marked online
2022-04-29 16:48:42 +02:00
Tobias Mädel
bcd450241f debian: Run ifupdown2 after udev has settled 2021-09-27 16:58:28 +02:00
Julien Fortin
a1d6115e35 debian: changelog: new 3.1.0-1 entry
Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2021-07-05 19:35:41 +02:00
tjjh89017
912b8697d4 networking.service: fix start networking.service before network is marked online
In debian 10, ifupdown2 didn't ensure that it will start before network.target and network-online.target.
after local-fs.target because ifupdown2 need to read config file from local filesystem
Other network services will not start after networking.service and fail because no interface is up.
(e.g isc-dhcp-server, tftp-hpa)
2021-01-20 17:22:24 +08:00
Piotr Ożarowski
288a88d3e4 bump minimum required debhelper version to 9.20160709
this is required by "--with systemd" in debian/rules
2020-09-16 01:10:00 +02:00
Julien Fortin
c7a0cd032c debian: changelog: updating 3.0.0-1 changelog entry
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2020-08-06 14:38:41 +02:00
Julien Fortin
ca43693778 addons: vxlan: new attribute: vxlan-mcastgrp-map
"vxlan-mcastgrp-map": {
    "help": "vxlan multicast group for single-vxlan device",
    "validvals": ["<number-ipv4-list>"],
    "example": ["vxlan-mcastgrp-map 1000=239.1.1.100 1001=239.1.1.200"],
}

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2020-08-06 14:32:07 +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
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
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 bffa619b11
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
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
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
9808982edf addons: bond: add support for es-sys-mac and es-bonds
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>
2020-05-13 20:27:21 +02:00
bauen1
95f029fde1 add missing build dependency
Signed-off-by: bauen1 <j2468h@gmail.com>
2020-05-11 20:56:37 +02:00
Julien Fortin
ff68815574 debian: control: bump Standards-Version
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2020-04-14 19:22:54 +02:00
Julien Fortin
74bac7e553 debian: changelog: update 3.0.0-1 entry
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2020-04-14 19:22:37 +02:00
Julien Fortin
62d960cc1b completion: removing argcomplete support
this feature doesn't seem to be working anyway. This can be revisited in the
future but this allows us to drop the python3-argcomplete dependency for now

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2020-04-14 16:50:04 +02:00
Julien Fortin
16de4e7988 Merge branch 'master' into python3
* master:
  addons: address: process MTU before addrgen and adddresses
  ifupdownmain: support for marking interfaces as mgmt interfaces
  addons: bridge: fix TypeError: sequence item 0: expected string, int found
  addons: bridge: set bridge MTU after bridge creation addons: bridge: get bridge MTU from address policy not bridge
  addons: mstpctl: check mstpctl-stp and bridge-stp and fix bridge cache update
  lib: nlcache: fix dry_run exception
  addons: address: add support for a separate default mtu policy for eth interfaces
  debian: changelog: new 2.0.2-1 entry
  addons: ethtool: add support for "ethtool_ignore_errors" policy
  LinkUtils: mac_str_to_int: fix string to int conversion
  addons: dhcp: if mgmt vrf context exec dhclient in default vrf
2020-03-26 03:02:53 +01:00
Julien Fortin
f43edf057e debian: changelog: new 2.0.2-1 entry
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2020-03-04 16:24:50 +01:00
Julien Fortin
5b3907dc6b debian: changelog: update 3.0.0-1 entry
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2020-02-24 16:25:13 +01:00
Julien Fortin
e79ed23595 debian: add ifupdown2.lintian-overrides
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2020-01-28 17:00:50 +01:00
Julien Fortin
880645f250 python3: debian: control: update python3:depends
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2020-01-28 17:00:18 +01:00
Julien Fortin
516fd7266f python3: update debian files to build python3 deb
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2020-01-08 12:22:58 +01:00
Julien Fortin
3aa8da8a6c Merge branch 'master-next' into python3
* master-next:
  argv: move --nldebug option to common_argparse to avoid exception in ifreload
  debian: changelog: new 2.0.1-1 entry
  argv: add new command line argument --nldebug
  This commit adds the feature to change offloads for nics. Currently GRO, LRO GSO, TSO, UFO, TX and RX Offload are supported.
2020-01-02 15:50:51 +01:00
Julien Fortin
e65fae4889 debian: changelog: new 2.0.1-1 entry
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2019-12-31 15:25:07 +01:00
Julien Fortin
d053bb48c5 debian: postinst: remove apt install, add log message instead 2019-12-17 18:26:58 +01:00
Julien Fortin
8248d0befc debian: postinst: add work-around to manually install python3-ipaddr
python3 ipaddress behave differently from python2-ipaddr, this is
a serious problem for us since it breaks most of the ip addresses
code. The work around install the python3-ipaddr via pip3 (and
installs pip3 if necessary). The workaround will stay in the code
util the ipaddress issue is fixed.

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2019-12-17 17:38:25 +01:00
Julien Fortin
45864399b0 Revert "python3: ipaddress is now part of the standard library (removing python-ipaddr)"
This reverts commit 5dded70eaa.
2019-12-17 17:35:51 +01:00
Julien Fortin
5dded70eaa python3: ipaddress is now part of the standard library (removing python-ipaddr)
IPNetwork doesn't exists anymore and is replaced by ip_network. IPv?Network (4 and 6)
objects take an optional argument "strict" that defaults to True. If strict is set
and the ip address has the host bit set it will raise an exception. This is bad
for ifupdown2, so we need to replace all calls to IPNetwork and IPv?Network with
function who will set strict to False. That way we can limit the number of changes
for this patch.

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2019-12-17 17:27:51 +01:00
Julien Fortin
7e9990b1e8 setup.py: bump version to 3.0.0 and update changelog
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2019-12-17 17:23:13 +01:00
Julien Fortin
223ba5af1d ifupdown2 2.0.0-1
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2019-12-17 13:46:18 +01:00
Julien Fortin
5fb588fc9a debian: changelog: add empty 1.2.9-1 entry for next release
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2019-07-12 12:47:06 +04:00