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

1654 Commits

Author SHA1 Message Date
2558bf4fad Merge pull request #238 from sohorx/fix/gvgen_dependency
gvgen: fix module dependency
2022-05-31 15:28:20 +02:00
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
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/
2022-05-31 14:57:12 +02:00
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
6bcb49088b Merge pull request #237 from svenauhagen/bugfix/bondarpcheck
addons: bond: fix ifquery for IFLA_BOND_ARP_IP_TARGET
2022-05-28 14:02:49 +02:00
10ddf286f3 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>
2022-05-28 12:14:33 +02:00
dee2c49d58 update contact info and copyright dates
Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2022-05-28 11:40:16 +02:00
a98b38984c graph: fix GvGen import
Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2022-05-27 15:00:33 +02:00
b0a7a8bb3e 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>
2022-05-27 15:00:05 +02:00
70263054b3 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>
2022-05-27 14:54:41 +02:00
46be384512 addons: bridge: skip bridge mac check and force mac-set on bridge creation
Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2022-05-27 14:33:56 +02:00
6861404b8e 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>
2022-05-27 14:30:35 +02:00
ab287bc42c 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>
2022-05-27 14:29:56 +02:00
1ac64c41d7 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>
2022-05-27 14:21:06 +02:00
97789789f0 addons: bond: set protodown off on unslaved evpn-mh bond slave
Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2022-05-27 14:16:50 +02:00
6a61093d73 bond: support for protodown reason bit settings for clag/frr
Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2022-05-27 14:14:39 +02:00
897298631f 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>
2022-05-27 14:03:32 +02:00
0ca32fb5f7 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>
2022-05-27 12:33:39 +02:00
35a4278ffb addons: vxlan: remote-ip: purge entry removed by user
Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2022-05-27 12:17:59 +02:00
2fbbfa7211 addons: vxlan: vxlan-vni: support vni change on existing config
Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2022-05-27 12:17:16 +02:00
0500d5d882 addons: vxlan: add support for l3vxi via vxlan-vni
Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2022-05-27 12:12:17 +02:00
d3796ff12d sonar: addons: addressvirtual: Replace this formatting argument with a tuple
Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2022-05-27 12:09:52 +02:00
2f72e99a4d 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>
2022-05-27 12:05:03 +02:00
46579015f5 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>
2022-05-27 12:04:14 +02:00
63155c61d3 addons: address: ifquery-running: add hwaddress support
Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2022-05-27 12:00:25 +02:00
8126ef0c00 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>
2022-05-27 11:58:34 +02:00
89df6ae095 sbin: start-networking: remove dhclient lease files on shutdown
Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2022-05-26 12:35:18 +02:00
6bd1ac25a8 log: use default chmod for os.mkdir
Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2022-05-26 12:29:13 +02:00
d2f2cc01e5 update ifupdown2 debug logging to /var/log/ifupdown2
Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2022-05-26 12:27:05 +02:00
dd29350f7f 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>
2022-05-26 12:26:17 +02:00
29ed5855ba 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>
2022-05-26 12:25:49 +02:00
5e3ea6fc62 sonar: addons: vrf: debug log formatting issue
Sonar error:
"Replace this formatting argument with a tuple."

Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2022-05-26 12:20:54 +02:00
265bf3d3b0 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>
2022-05-26 12:20:54 +02:00
82b0d9217e 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>
2022-05-26 12:19:34 +02:00
441d92a35d addons: mstpctl: forcevers: add valid vals: stp/mstp
Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2022-05-26 12:16:39 +02:00
9348b2a9e3 addons: bridge: vni's portmcrouter shouldn't reset to default if policy is set
Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2022-05-26 12:13:53 +02:00
2fdc881411 addons: bridge: prevent multiple vxlans to be added to the same VLAN
Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2022-05-26 12:11:29 +02:00
c198e7ba05 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>
2022-05-26 12:09:19 +02:00
1c4c1f5783 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>
2022-05-26 12:08:10 +02:00
36ac58231f addons: bridge: bridge-portmcrouter: reset to default 1 (automatic) if config is removed
Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2022-05-26 12:06:53 +02:00
b2b8a2e6f4 addons: bridge: bridge-hashmax: upper limit of validrange to 65536
Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2022-05-26 12:06:53 +02:00
3199dd8a0d 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>
2022-05-26 12:04:23 +02:00
e21ee6df28 bond: ifquery-check: translate user config es-sys-mac before comparing to netlink cache
Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2022-05-26 12:04:20 +02:00
4e0f16d0cf 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>
2022-05-26 12:04:17 +02:00
30f615f2d6 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>
2022-05-25 00:44:28 +02:00
ddb633fe44 Merge pull request #138 from svenauhagen/feature/bondarpcheck
This patch adds the ability to use an ARP IP for the bond check.
2022-05-25 00:23:47 +02:00
10d57d9aaa 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>
2022-05-24 22:50:52 +02:00
e90c33ca6a 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>
2022-05-24 22:05:16 +02:00
66381bcd32 Merge pull request #234 from sohorx/fix/dhcp_client_wait
dhcp: fix dhclient client killed on no wait
2022-05-24 12:47:48 +02:00
09334e7713 addons: dhcp: move policy log info to debug
Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2022-05-23 16:07:58 +02:00
d0efa7d5f3 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.
2022-05-02 12:30:02 +02:00