]> git.proxmox.com Git - mirror_ifupdown2.git/log
mirror_ifupdown2.git
18 months agoaddons: address: fix merge-indentation issue master 3.2.0-pmx1
Julien Fortin [Wed, 10 May 2023 15:30:27 +0000 (17:30 +0200)]
addons: address: fix merge-indentation issue

Signed-off-by: Julien Fortin <jfortin@nvidia.com>
18 months agodebian: changelog: new entry: 3.2.0
Julien Fortin [Thu, 4 May 2023 11:18:09 +0000 (13:18 +0200)]
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>
18 months agonlcache: remove special SIGINT handling
Julien Fortin [Mon, 24 Oct 2022 20:21:07 +0000 (22:21 +0200)]
nlcache: remove special SIGINT handling

capturing sigint was causing ifquery to hang indefinitely on ctrl-c

Signed-off-by: Julien Fortin <jfortin@nvidia.com>
18 months agonlcache: merge existing MTU into new netlink object (vlan/vxlan) before caching
Julien Fortin [Mon, 15 Aug 2022 16:33:05 +0000 (18:33 +0200)]
nlcache: merge existing MTU into new netlink object (vlan/vxlan) before caching

This patch fixes the gap in the vlan and vxlan code

Signed-off-by: Julien Fortin <jfortin@nvidia.com>
18 months agoifupdownmain: skipping admin down on deleted vlans
Julien Fortin [Fri, 16 Dec 2022 14:59:18 +0000 (15:59 +0100)]
ifupdownmain: skipping admin down on deleted vlans

Signed-off-by: Julien Fortin <jfortin@nvidia.com>
18 months agoifupdownmain: down ops on vrf-slave should set the slave admin down
Julien Fortin [Fri, 31 Mar 2023 13:59:42 +0000 (15:59 +0200)]
ifupdownmain: down ops on vrf-slave should set the slave admin down

Signed-off-by: Julien Fortin <jfortin@nvidia.com>
18 months agoaddons: address: process hwaddress before processing ip addresses
Julien Fortin [Tue, 20 Sep 2022 00:29:10 +0000 (02:29 +0200)]
addons: address: process hwaddress before processing ip addresses

Signed-off-by: Julien Fortin <jfortin@nvidia.com>
18 months agolib: nlcache: merge existing MTU into new netlink object before caching
Julien Fortin [Fri, 12 Aug 2022 13:58:02 +0000 (15:58 +0200)]
lib: nlcache: merge existing MTU into new netlink object before caching

Signed-off-by: Julien Fortin <jfortin@nvidia.com>
18 months agoSONAR: mstpctl: Merge if statement with the enclosing one
Julien Fortin [Tue, 31 May 2022 13:39:21 +0000 (15:39 +0200)]
SONAR: mstpctl: Merge if statement with the enclosing one

Signed-off-by: Julien Fortin <jfortin@nvidia.com>
18 months agosonarlink: remove unused variable
Julien Fortin [Tue, 14 Feb 2023 12:40:32 +0000 (13:40 +0100)]
sonarlink: remove unused variable

Signed-off-by: Julien Fortin <jfortin@nvidia.com>
18 months agoaddons: bond: set protodown off on bond slave before bond is deleted
Julien Fortin [Wed, 3 May 2023 14:40:09 +0000 (16:40 +0200)]
addons: bond: set protodown off on bond slave before bond is deleted

Signed-off-by: Julien Fortin <jfortin@nvidia.com>
18 months agoSONAR: addons: bond: Merge if statements with the enclosing ones
Julien Fortin [Mon, 30 May 2022 20:47:58 +0000 (22:47 +0200)]
SONAR: addons: bond: Merge if statements with the enclosing ones

Signed-off-by: Julien Fortin <jfortin@nvidia.com>
18 months agoaddons: bond: ignore exception raised during bond-slave speed check
Julien Fortin [Wed, 3 May 2023 14:37:51 +0000 (16:37 +0200)]
addons: bond: ignore exception raised during bond-slave speed check

Signed-off-by: Julien Fortin <jfortin@nvidia.com>
18 months agoaddons: bond: make sure bond speed and slaves (swps) speed are matching
Julien Fortin [Wed, 3 May 2023 14:35:28 +0000 (16:35 +0200)]
addons: bond: make sure bond speed and slaves (swps) speed are matching

Signed-off-by: Julien Fortin <jfortin@nvidia.com>
18 months agoSONAR: fix iface.py: Import only needed names or import the module and then use its...
Julien Fortin [Mon, 30 May 2022 17:13:05 +0000 (19:13 +0200)]
SONAR: fix iface.py: Import only needed names or import the module and then use its members.

Signed-off-by: Julien Fortin <jfortin@nvidia.com>
18 months agoaddons: bond: allow bond creation without slaves
Julien Fortin [Wed, 21 Dec 2022 17:47:00 +0000 (18:47 +0100)]
addons: bond: allow bond creation without slaves

Signed-off-by: Julien Fortin <jfortin@nvidia.com>
18 months agoSONAR: addressvirtual: print exception message in exception handler
Julien Fortin [Mon, 30 May 2022 20:43:40 +0000 (22:43 +0200)]
SONAR: addressvirtual: print exception message in exception handler

Signed-off-by: Julien Fortin <jfortin@nvidia.com>
18 months agoSONAR: addressvirtual: Merge if statement with the enclosing one
Julien Fortin [Mon, 30 May 2022 20:40:48 +0000 (22:40 +0200)]
SONAR: addressvirtual: Merge if statement with the enclosing one

Signed-off-by: Julien Fortin <jfortin@nvidia.com>
18 months agoSONAR: addressvirtual: Rename method "addr_metric_support"
Julien Fortin [Mon, 30 May 2022 20:35:45 +0000 (22:35 +0200)]
SONAR: addressvirtual: Rename method "addr_metric_support"

Rename method "addr_metric_support" to prevent any misunderstanding/clash
with field "ADDR_METRIC_SUPPORT" defined on line 80

Signed-off-by: Julien Fortin <jfortin@nvidia.com>
18 months agosonarlink: use opposite operator != instead of 'not'
Julien Fortin [Tue, 14 Feb 2023 12:32:57 +0000 (13:32 +0100)]
sonarlink: use opposite operator != instead of 'not'

Signed-off-by: Julien Fortin <jfortin@nvidia.com>
18 months agoSONAR: addons: address: Merge if statement with the enclosing one
Julien Fortin [Mon, 30 May 2022 20:15:48 +0000 (22:15 +0200)]
SONAR: addons: address: Merge if statement with the enclosing one

Signed-off-by: Julien Fortin <jfortin@nvidia.com>
18 months agoadd support for systemd logging
Julien Fortin [Wed, 3 May 2023 14:19:57 +0000 (16:19 +0200)]
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>
18 months agoSONAR: Specify an exception class to catch or reraise the exception
Julien Fortin [Wed, 3 May 2023 14:13:45 +0000 (16:13 +0200)]
SONAR: Specify an exception class to catch or reraise the exception

Signed-off-by: Julien Fortin <jfortin@nvidia.com>
18 months agoMerge pull request #256 from tomvil/feat/ethtool_set_ring_max_value
Julien Fortin [Wed, 3 May 2023 18:25:58 +0000 (20:25 +0200)]
Merge pull request #256 from tomvil/feat/ethtool_set_ring_max_value

addons: Allow to set `max` value in `--set-ring` option

19 months agoMerge pull request #258 from aderumier/vlanprotocol-query-check
Julien Fortin [Thu, 20 Apr 2023 12:01:39 +0000 (14:01 +0200)]
Merge pull request #258 from aderumier/vlanprotocol-query-check

vlan: query_check: check vlan-protocol for not dotted interface

19 months agovlan: query_check: check vlan-protocol for not dotted interface
Alexandre Derumier [Thu, 20 Apr 2023 09:48:11 +0000 (11:48 +0200)]
vlan: query_check: check vlan-protocol for not dotted interface

/etc/network/interfaces
-----------------------
auto eth0.100
iface eth0.100
        vlan-protocol 802.1ad

current
-------
ifquery -a -c

auto eth0.100
iface eth0.100                                                      [pass]

new
---
ifquery -a -c

auto eth0.100
iface eth0.100                                                      [pass]
        vlan-protocol 802.1ad                                       [pass]

19 months agoaddons: Allow to set `max` value in `--set-ring` option
tomvil [Tue, 11 Apr 2023 12:07:41 +0000 (15:07 +0300)]
addons: Allow to set `max` value in `--set-ring` option

This makes some automation cases much easier

```
auto eth0
iface eth0 inet dhcp
  ring-rx max
  ring-tx max

Ring parameters for eth0:
Pre-set maximums:
RX: 4096
RX Mini: n/a
RX Jumbo: n/a
TX: 4096
Current hardware settings:
RX: 4096
RX Mini: n/a
RX Jumbo: n/a
TX: 4096
```

Signed-off-by: tomvil <tomas.vilemaitis@gmail.com>
19 months agoMerge pull request #255 from tomvil/master
Julien Fortin [Thu, 30 Mar 2023 16:45:02 +0000 (18:45 +0200)]
Merge pull request #255 from tomvil/master

addons: Add `--set-ring` option to ethtool

19 months agoremove extra line from ethtool.py
tomvil [Mon, 27 Mar 2023 16:25:31 +0000 (19:25 +0300)]
remove extra line from ethtool.py

19 months agoaddons: Add `--set-ring` option to ethtool
tomvil [Mon, 27 Mar 2023 15:45:40 +0000 (18:45 +0300)]
addons: Add `--set-ring` option to ethtool

example:
```
auto eth0
iface eth0 inet dhcp
  ring-tx 1024
  ring-rx 1024
```

Signed-off-by: Tomas Vilemaitis
21 months agoscheduler: env variable not properly set for user commands
Julien Fortin [Wed, 25 Jan 2023 14:31:41 +0000 (15:31 +0100)]
scheduler: env variable not properly set for user commands

Fixes #218

Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2 years agoMerge pull request #246 from aderumier/ovsfakebridge2
Julien Fortin [Fri, 2 Sep 2022 10:44:05 +0000 (12:44 +0200)]
Merge pull request #246 from aderumier/ovsfakebridge2

addons: openvswitch : add support for fakebridge.

2 years agoaddons: openvswitch : add support for fakebridge.
alexandre derumier [Thu, 1 Sep 2022 17:18:21 +0000 (19:18 +0200)]
addons: openvswitch : add support for fakebridge.

Fake bridge are are ovsbridge child of a parent bridge with a specific vlan tag.

```
auto br-parent
iface br-parent inet manual
        ovs_type OVSBridge

auto br-fakev10
iface br-fakev10 inet manual
        ovs_type OVSBridge
        ovs_bridge br-parent
        ovs_options br-parent 10

```

2 years agoMerge pull request #242 from talber-nvidia/fix-empty-output-from-subprocess
Julien Fortin [Wed, 6 Jul 2022 17:20:37 +0000 (19:20 +0200)]
Merge pull request #242 from talber-nvidia/fix-empty-output-from-subprocess

Fix the return value of utils._execute_subprocess

2 years agoFix the return value of utils._execute_subprocess
Tal Berlowitz [Wed, 6 Jul 2022 15:08:13 +0000 (18:08 +0300)]
Fix the return value of utils._execute_subprocess

If the output of the subprocess is empty, then an empty <bytes> object
is returned (b''), and not decoded into an empty <string> object.
This may result in errors such as:
    info[109734]: executing /bin/ip -6 addr show eth0
    networking[109734]: error: eth0: cannot use a string pattern on a
        bytes-like object
    error[109734]: eth0: cannot use a string pattern on a bytes-like object

2 years agoMerge pull request #239 from sohorx/fix/distutils_dependency
Julien Fortin [Tue, 31 May 2022 13:30:39 +0000 (15:30 +0200)]
Merge pull request #239 from sohorx/fix/distutils_dependency

distutils: fix dependency and lib replacement

2 years agoMerge branch 'master' into fix/distutils_dependency
Julien Fortin [Tue, 31 May 2022 13:30:16 +0000 (15:30 +0200)]
Merge branch 'master' into fix/distutils_dependency

2 years agoMerge pull request #238 from sohorx/fix/gvgen_dependency
Julien Fortin [Tue, 31 May 2022 13:28:20 +0000 (15:28 +0200)]
Merge pull request #238 from sohorx/fix/gvgen_dependency

gvgen: fix module dependency

2 years agodistutils: fix dependency and lib replacement
Adrien Banlin [Tue, 31 May 2022 12:57:12 +0000 (14:57 +0200)]
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
8126ef0c00eb8e2faae2cf1ca9fbaf25c10582cd 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/

2 years agogvgen: fix module dependency
Adrien Banlin [Tue, 31 May 2022 08:40:36 +0000 (10:40 +0200)]
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.

2 years agoMerge pull request #237 from svenauhagen/bugfix/bondarpcheck
Julien Fortin [Sat, 28 May 2022 12:02:49 +0000 (14:02 +0200)]
Merge pull request #237 from svenauhagen/bugfix/bondarpcheck

addons: bond: fix ifquery for IFLA_BOND_ARP_IP_TARGET

2 years agosonar: lib: nlcache: catch exception only once
Julien Fortin [Tue, 26 Apr 2022 10:03:01 +0000 (12:03 +0200)]
sonar: lib: nlcache: catch exception only once

Catch this exception only once;
it is already handled by a previous except clause

Ticket: #3035926

Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2 years agoupdate contact info and copyright dates
Julien Fortin [Sat, 28 May 2022 09:40:16 +0000 (11:40 +0200)]
update contact info and copyright dates

Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2 years agograph: fix GvGen import
Julien Fortin [Fri, 6 Aug 2021 13:06:20 +0000 (15:06 +0200)]
graph: fix GvGen import

Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2 years agograph: import gvgen class into ifupdown2 package
Julien Fortin [Thu, 5 Aug 2021 16:48:23 +0000 (18:48 +0200)]
graph: import gvgen class into ifupdown2 package

python2's ifupdown2 used python-gvgen to output the dependency graph in dot
format. There's not python3 version of that package available in debian.
Resulting in: error: main exception: name 'GvGen' is not defined

The package is in fact a single class that is already compatible with python3
According to the license (MIT) we can pull in the code in our own tree.

Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2 years agoaddons: tunnel: support non-disruptive config change
Julien Fortin [Fri, 27 May 2022 12:54:41 +0000 (14:54 +0200)]
addons: tunnel: support non-disruptive config change

Current design destroys existing tunnel when a config
change is detected. This behaviour causes traffic loss.

Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2 years agoaddons: bridge: skip bridge mac check and force mac-set on bridge creation
Julien Fortin [Fri, 27 May 2022 12:33:56 +0000 (14:33 +0200)]
addons: bridge: skip bridge mac check and force mac-set on bridge creation

Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2 years agoaddons: bridge: fix bridge/vxlan learning sync mechanism
Julien Fortin [Tue, 22 Mar 2022 11:52:32 +0000 (12:52 +0100)]
addons: bridge: fix bridge/vxlan learning sync mechanism

Old code was a bit messy and all over the place. This
resulted in a loophole breaking sync between bridge-learning
and vxlan-learning. This patch simplifies the existing code
and fixes the bug.

Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2 years agoaddons: bridge: fix sync between bridge-learning and vxlan-learning
Julien Fortin [Fri, 20 Aug 2021 15:45:51 +0000 (17:45 +0200)]
addons: bridge: fix sync between bridge-learning and vxlan-learning

if not specified by the user vxlan brport learning is controlled by the
bridge_vxlan_port_learning policy (on by default).

4.4 introduced vxlan-learning off via policy. The syncing code between
bridge-learning and vxlan-learning was incomplete and was written at the
time when we didn't have a default vxlan-learning policy. This patch fixes
the sync-ing gap and makes sure vxlan-learning is sync'd with bridge-learning
which wasn't always the case before.

for every vxlan brport BRPORT_LEARNING is turned on

Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2 years agoaddons: bond: set IFLA_MASTER when updating bond settings
Julien Fortin [Fri, 27 May 2022 12:21:06 +0000 (14:21 +0200)]
addons: bond: set IFLA_MASTER when updating bond settings

On bond creation and update, ifupdown2 directly caches the netlink
object sent to the kernel. If the bond already exists it overrides
the existing cached object. If the existing bond was enslaved to a
bridge, some bridge vlan data would get purged because the new
netlink object didn't have the IFLA_MASTER attribute (thus tricking
the cache into thinking that the bond got unslaved from the bridge).

Here is a snippet of the bond013 /en/i config in the first topology:

    auto bond013
    iface bond013
        bond-slaves swp1s3
        es-sys-mac 44:38:39:FF:00:02
        bridge-vids 101-144
        bond-lacp-bypass-allow yes
        mstpctl-portadminedge yes
        mstpctl-bpduguard yes

And here in the second topology:

    auto bond013
    iface bond013
          bond-slaves swp1s3
          es-sys-mac 44:38:39:FF:00:01
          bridge-vids 201-210
          bond-lacp-bypass-allow yes
          mstpctl-portadminedge yes
          mstpctl-bpduguard yes

Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2 years agoaddons: bond: set protodown off on unslaved evpn-mh bond slave
Julien Fortin [Tue, 29 Mar 2022 18:08:04 +0000 (20:08 +0200)]
addons: bond: set protodown off on unslaved evpn-mh bond slave

Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2 years agobond: support for protodown reason bit settings for clag/frr
Julien Fortin [Fri, 27 May 2022 12:14:39 +0000 (14:14 +0200)]
bond: support for protodown reason bit settings for clag/frr

Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2 years agoaddons: bond: fix ifquery for IFLA_BOND_ARP_IP_TARGET
Sven Auhagen [Fri, 27 May 2022 12:03:32 +0000 (14:03 +0200)]
addons: bond: fix ifquery for IFLA_BOND_ARP_IP_TARGET

adding correct support for multiple ip in bond-arp-ip-target

Signed-off-by: Sven Auhagen <sven.auhagen@voleatech.de>
2 years agolog_error/log_warn: fix stack and format traceback
Julien Fortin [Fri, 27 May 2022 10:33:39 +0000 (12:33 +0200)]
log_error/log_warn: fix stack and format traceback

since we added the debug_handler we are not setting any level
on the root logger, the level is set for each individual handler

log_error and log_warning were using traceback.print_stack and print_exc
which and also only checked the rooter logger's level via getEffectiveLevel

Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2 years agoaddons: vxlan: remote-ip: purge entry removed by user
Julien Fortin [Fri, 25 Mar 2022 13:13:42 +0000 (14:13 +0100)]
addons: vxlan: remote-ip: purge entry removed by user

Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2 years agoaddons: vxlan: vxlan-vni: support vni change on existing config
Julien Fortin [Tue, 22 Feb 2022 11:31:21 +0000 (12:31 +0100)]
addons: vxlan: vxlan-vni: support vni change on existing config

Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2 years agoaddons: vxlan: add support for l3vxi via vxlan-vni
Julien Fortin [Fri, 27 May 2022 10:12:17 +0000 (12:12 +0200)]
addons: vxlan: add support for l3vxi via vxlan-vni

Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2 years agosonar: addons: addressvirtual: Replace this formatting argument with a tuple
Julien Fortin [Tue, 26 Apr 2022 10:09:24 +0000 (12:09 +0200)]
sonar: addons: addressvirtual: Replace this formatting argument with a tuple

Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2 years agoaddons: Fix vrrp addrgenmode
Trey Aspelund [Tue, 29 Mar 2022 15:20:12 +0000 (11:20 -0400)]
addons: Fix vrrp addrgenmode

Prior commit (from me) that changed ipv6_addrgenmode for VRRP macvlan
interfaces from RANDOM --> NONE incorrectly disabled this for vrrp6.
The IPv6 link-local address is used as the SIP for vrrp6 hellos, so we
need to make sure that we are only setting addrgenmode to NONE for vrrp4.

Signed-off-by: Trey Aspelund <taspelund@nvidia.com>
Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2 years agoaddons: set addrgenmode to none for vrrp macvlan
Trey Aspelund [Fri, 15 Oct 2021 16:53:20 +0000 (12:53 -0400)]
addons: set addrgenmode to none for vrrp macvlan

A VRRP macvlan interface should only have addresses matching the
VIP defined by the user.  This change ensures we set ipv6 addrgenmode
to none, that way there won't be any unexpected (from user standpoint)
ipv6 link-local addresses to cause confusion or erroneous Type-2 EVPN
routes (in the case of advertise-default-gw with VRRP instead of VRR)
that advertise IP addresses that don't represent a VIP.

Signed-off-by: Trey Aspelund <taspelund@nvidia.com>
Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2 years agoaddons: address: ifquery-running: add hwaddress support
Julien Fortin [Thu, 5 Aug 2021 09:28:33 +0000 (11:28 +0200)]
addons: address: ifquery-running: add hwaddress support

Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2 years agoaddons: address: policy: l3_intf_arp_accept accept arp_accept value
Julien Fortin [Fri, 27 May 2022 09:58:34 +0000 (11:58 +0200)]
addons: address: policy: l3_intf_arp_accept accept arp_accept value

the policy l3_intf_arp_accept now accepts boolean value True(1)/False(0) as well
as normal arp_accept values

Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2 years agosbin: start-networking: remove dhclient lease files on shutdown
Julien Fortin [Thu, 26 May 2022 10:35:18 +0000 (12:35 +0200)]
sbin: start-networking: remove dhclient lease files on shutdown

Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2 years agolog: use default chmod for os.mkdir
Julien Fortin [Thu, 26 May 2022 10:29:13 +0000 (12:29 +0200)]
log: use default chmod for os.mkdir

Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2 years agoupdate ifupdown2 debug logging to /var/log/ifupdown2
Julien Fortin [Fri, 12 Nov 2021 12:30:08 +0000 (13:30 +0100)]
update ifupdown2 debug logging to /var/log/ifupdown2

Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2 years agolog: add extra try except when removing log dirs and fix eni.d cp
Julien Fortin [Tue, 28 Dec 2021 21:47:48 +0000 (22:47 +0100)]
log: add extra try except when removing log dirs and fix eni.d cp

The extra try/except are necessary just in case something goes wrong
we still want to go through the entire list of extra log dir present
on the system.

Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2 years agoifupdown2.conf: add persistent debug logging feature
Julien Fortin [Mon, 16 Aug 2021 13:02:10 +0000 (15:02 +0200)]
ifupdown2.conf: add persistent debug logging feature

enable persistent ifupdown2 debug logs
ifupdown2 will keep debug logs in /etc/network/ifupdown2/logs
by default the last 42 configurations logs will be kept.
 yes     - (default) enable persistent logging (42 configs)
 no      - disable persistent logging
 [2-9]+  - specify how many configuration logs should be stored
enable_persistent_debug_logging=yes

Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2 years agosonar: addons: vrf: debug log formatting issue
Julien Fortin [Tue, 26 Apr 2022 10:06:13 +0000 (12:06 +0200)]
sonar: addons: vrf: debug log formatting issue

Sonar error:
"Replace this formatting argument with a tuple."

Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2 years agoaddons: vrf: unable to create vrf-max-count (missing +1)
Julien Fortin [Wed, 6 Apr 2022 14:45:44 +0000 (16:45 +0200)]
addons: vrf: unable to create vrf-max-count (missing +1)

A missing "+1" in a loop condition prevents ifupdown2 from creating
N vrfs up to vrf-max-count. We are stuck at vrf-max-count - 1

Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2 years agoaddons: vlan: validate vlan interface name
Julien Fortin [Thu, 5 Aug 2021 17:03:51 +0000 (19:03 +0200)]
addons: vlan: validate vlan interface name

we have an automation test that adds a vrf named "VRF.TEST":

$ ifquery -a
auto VRF.TEST
iface VRF.TEST
    vrf-table auto

$ ifup -a
error: could not determine vlanid
warning: error while writing to file /sys/class/net/VRF.TEST/mtu: [Errno 22] Invalid argument
$

Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2 years agoaddons: mstpctl: forcevers: add valid vals: stp/mstp
Julien Fortin [Wed, 13 Apr 2022 14:57:14 +0000 (16:57 +0200)]
addons: mstpctl: forcevers: add valid vals: stp/mstp

Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2 years agoaddons: bridge: vni's portmcrouter shouldn't reset to default if policy is set
Julien Fortin [Wed, 10 Nov 2021 21:42:41 +0000 (22:42 +0100)]
addons: bridge: vni's portmcrouter shouldn't reset to default if policy is set

Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2 years agoaddons: bridge: prevent multiple vxlans to be added to the same VLAN
Julien Fortin [Wed, 13 Apr 2022 22:18:14 +0000 (00:18 +0200)]
addons: bridge: prevent multiple vxlans to be added to the same VLAN

Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2 years agoaddons: bridge: l2 vni evpn: don't warn for static vxlans
Julien Fortin [Tue, 22 Mar 2022 11:52:12 +0000 (12:52 +0100)]
addons: bridge: l2 vni evpn: don't warn for static vxlans

Due to missing checks, ifupdown2 may display the following warning for
static vxlan configs.

"warning: possible mis-configuration detected: l2-vni configured
with bridge-learning ON while EVPN is also configured - these two
parameters conflict with each other."

Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2 years agoaddons: bridge: syntax-check: user defined vni per svi limit
Julien Fortin [Thu, 27 Jan 2022 00:21:42 +0000 (01:21 +0100)]
addons: bridge: syntax-check: user defined vni per svi limit

error: vx-1002: misconfiguration detected: maximum vni allowed per bridge (bridge) svi (1000) is limited to 1 (policy: 'bridge_vni_per_svi_limit')

Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2 years agoaddons: bridge: bridge-portmcrouter: reset to default 1 (automatic) if config is...
Julien Fortin [Wed, 6 Oct 2021 12:13:08 +0000 (14:13 +0200)]
addons: bridge: bridge-portmcrouter: reset to default 1 (automatic) if config is removed

Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2 years agoaddons: bridge: bridge-hashmax: upper limit of validrange to 65536
Julien Fortin [Thu, 21 Oct 2021 16:07:59 +0000 (18:07 +0200)]
addons: bridge: bridge-hashmax: upper limit of validrange to 65536

Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2 years agoaddons: bond: ifquery-check: es-sys-mac value is not part of netlink dump for non...
Julien Fortin [Tue, 15 Mar 2022 16:38:56 +0000 (17:38 +0100)]
addons: bond: ifquery-check: es-sys-mac value is not part of netlink dump for non-root run

For some reason es-sys-mac (IFLA_BOND_AD_ACTOR_SYSTEM) is not part
of the netlink dump if requested by non-root user. This commit adds
a log info and will ignore es-sys-mac in that case.

Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2 years agobond: ifquery-check: translate user config es-sys-mac before comparing to netlink...
Julien Fortin [Mon, 15 Nov 2021 14:30:55 +0000 (15:30 +0100)]
bond: ifquery-check: translate user config es-sys-mac before comparing to netlink cache

Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2 years agoaddons: address: clear stale svi fdb entries when svi mac is changed
Julien Fortin [Mon, 18 Apr 2022 23:36:03 +0000 (01:36 +0200)]
addons: address: clear stale svi fdb entries when svi mac is changed

Three issues:
- when `hwaddress` is removed from an SVI (on top of a bridge), the svi
mac is not resetted back to the bridge mac: fixed
- when `hwaddress` is used on an svi, stale fdb enties were added with the
bridge mac: fixed
- on ifdown we were leaving a leftover fdb entry on the deleted svi: fixed

Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2 years agoaddons: bond: fix ifquery for IFLA_BOND_ARP_IP_TARGET
Julien Fortin [Tue, 24 May 2022 22:44:28 +0000 (00:44 +0200)]
addons: bond: fix ifquery for IFLA_BOND_ARP_IP_TARGET

dropping support for multiple ip in bond-arp-ip-target

Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2 years agoMerge pull request #138 from svenauhagen/feature/bondarpcheck
Julien Fortin [Tue, 24 May 2022 22:23:47 +0000 (00:23 +0200)]
Merge pull request #138 from svenauhagen/feature/bondarpcheck

This patch adds the ability to use an ARP IP for the bond check.

2 years agoaddons: bridge: allow vlan sub interface in vlan-aware bridge (fixes #92)
Julien Fortin [Tue, 24 May 2022 20:50:52 +0000 (22:50 +0200)]
addons: bridge: allow vlan sub interface in vlan-aware bridge (fixes #92)

New bridge policy:
allow-vlan-sub-interface-in-vlan-aware-bridge (default True)

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2 years agoaddons: address: log error but continue when adding addresses (fixes #130)
Julien Fortin [Tue, 24 May 2022 20:05:16 +0000 (22:05 +0200)]
addons: address: log error but continue when adding addresses (fixes #130)

Signed-off-by: bauen1 <j2468h@gmail.com>
Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2 years agoMerge pull request #234 from sohorx/fix/dhcp_client_wait
Julien Fortin [Tue, 24 May 2022 10:47:48 +0000 (12:47 +0200)]
Merge pull request #234 from sohorx/fix/dhcp_client_wait

dhcp: fix dhclient client killed on no wait

2 years agoaddons: dhcp: move policy log info to debug
Julien Fortin [Wed, 18 May 2022 15:25:32 +0000 (17:25 +0200)]
addons: dhcp: move policy log info to debug

Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2 years agodhcp: fix dhclient client killed on no wait
Adrien Banlin [Mon, 2 May 2022 10:24:58 +0000 (12:24 +0200)]
dhcp: fix dhclient client killed on no wait

When a policy dhcp-wait is false the dhcp client is run directly in
background.

But, in most cases, the client won't have the time to find an address
before a check occur.

This is making the client being killed nearly every time.

The obvious solution here is to not check ips differences when no-wait
is asked by the policy.

2 years agoThis patch adds the ability to use an ARP IP for the bond check.
Sven Auhagen [Fri, 29 Apr 2022 09:37:05 +0000 (11:37 +0200)]
This patch adds the ability to use an ARP IP for the bond check.

It is only valid for balance-rr and balance-xor.

One Example is:

auto bond0
iface bond0 inet
        bond-slaves ens21 ens22
        bond-mode balance-rr
        bond-arp-interval 100
        bond-arp-ip-target 8.8.8.8
        address 10.10.10.1/24

Signed-off-by: Sven Auhagen <sven.auhagen@voleatech.de>
2 years agoMerge pull request #190 from tjjh89017/fix_systemd_start_order
Julien Fortin [Fri, 29 Apr 2022 14:48:42 +0000 (16:48 +0200)]
Merge pull request #190 from tjjh89017/fix_systemd_start_order

networking.service: fix start networking.service before network is marked online

2 years agoaddons: address: dad-interval: adding log.info before sleep (#232)
Julien Fortin [Fri, 29 Apr 2022 14:20:17 +0000 (16:20 +0200)]
addons: address: dad-interval: adding log.info before sleep (#232)

Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2 years agoMerge pull request #232 from sohorx/dad_handling_per_itf
Julien Fortin [Fri, 29 Apr 2022 14:18:26 +0000 (16:18 +0200)]
Merge pull request #232 from sohorx/dad_handling_per_itf

Dad handling per itf

2 years agoaddress: check interface exists before settling dad
Adrien Banlin [Fri, 8 Apr 2022 13:46:52 +0000 (15:46 +0200)]
address: check interface exists before settling dad

2 years agoaddons: address: update modinfo for dad attributes
Adrien Banlin [Fri, 25 Mar 2022 11:51:19 +0000 (12:51 +0100)]
addons: address: update modinfo for dad attributes

Help infos came from the ifupdown (original) manual.

2 years agoaddons: address: up: wait on dad when needed
Adrien Banlin [Fri, 25 Mar 2022 11:49:37 +0000 (12:49 +0100)]
addons: address: up: wait on dad when needed

2 years agoaddons: address: add a settle dad method
Adrien Banlin [Fri, 25 Mar 2022 11:47:31 +0000 (12:47 +0100)]
addons: address: add a settle dad method

_settle_dad will allow ifupdown2 to wait on ipv6 dad tentative.

2 years agoaddons: address: disable dad on no attempts
Adrien Banlin [Fri, 25 Mar 2022 11:36:41 +0000 (12:36 +0100)]
addons: address: disable dad on no attempts

2 years agoaddons: address: add dad handling module global
Adrien Banlin [Mon, 4 Apr 2022 15:10:21 +0000 (17:10 +0200)]
addons: address: add dad handling module global

Upon ipv6_dad_handling_enabled module global parameter set to true, the
address addon will handle ipv6 dad tentatives by either
* set nodad when adding an ipv6 address
* waiting for dad to finish or warn of a timeout

This handling should be quick close to the ifupdown process.

2 years agonlcache: add nodad parameter to addr_add
Adrien Banlin [Fri, 25 Mar 2022 11:23:43 +0000 (12:23 +0100)]
nlcache: add nodad parameter to addr_add

2 years agonlpacket: change IFA_FLAGS to a FourByte attribute
Adrien Banlin [Fri, 25 Mar 2022 11:18:20 +0000 (12:18 +0100)]
nlpacket: change IFA_FLAGS to a FourByte attribute

AttributeGeneric cannot be used unless having it's length defined.

This change allow address flags such as optimistic, nodad or others
to be set with the add_attribute packet method.

2 years agoMerge pull request #231 from CumulusNetworks/revert-230-dad_handling
Julien Fortin [Fri, 25 Mar 2022 13:30:10 +0000 (14:30 +0100)]
Merge pull request #231 from CumulusNetworks/revert-230-dad_handling

Revert "Dad handling"