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

1527 Commits

Author SHA1 Message Date
03cd34767b Merge pull request #220 from Manawyrm/wait-for-udev
debian: Run ifupdown2 after udev has settled
2022-01-28 16:37:15 +01:00
f89c3bd9e2 Merge pull request #219 from Carbenium/source-directory
networkinterfaces: support source-directory statement
2022-01-06 14:53:26 +01:00
0b48d2cf7c implement code review 2022-01-06 12:52:27 +01:00
9a810db109 networkinterfaces: support relative paths in source/source-directory statements
According to interfaces(5) [1]:
When sourcing files or directories, if a path doesn't have a leading slash, it's considered relative to the directory containing the file in which the keyword is placed. In the example above, if the file is located at /etc/network/interfaces, paths to the included files are understood to be under /etc/network.

Adapt the implementation to adhere to the documented behaviour.

[1] https://manpages.debian.org/buster/ifupdown/interfaces.5.en.html
2022-01-06 12:27:38 +01:00
0845cc57b2 networkinterfaces: support source-directory statement
ifupdown supports the "source-directory" statement that include the content of the specified directory.
See [1] for details.
Implement the statement to improve compatibility with ifupdown.

Fixes #191

[1] https://manpages.debian.org/buster/ifupdown/interfaces.5.en.html
2022-01-06 12:09:07 +01:00
b5bed16cbe Merge pull request #225 from devicenull/master
Sort filenames in interfaces.d so they're parsed in a consistent order
2022-01-05 18:12:19 +01:00
bb23b2f274 Sort filenames in interface.d so they're parsed in a consistent order 2022-01-05 11:28:19 -05:00
e495ed1740 Merge pull request #224 from polz113/polz113-xmit-hash-policy-vlan-srcmac
Update bond.py - add xmit-hash-policy vlan+srcmac
2022-01-05 16:24:01 +01:00
9a26f48f99 Add support for xmit-hash-policy vlan+srcmac
Add support for xmit-hash-policy 5 - vlan+srcmac, added in Linux 5.12.
2022-01-05 13:51:15 +01:00
5a3a162880 Merge pull request #223 from kvadrage/tunnel_tos_ttl_fix
addons: tunnel: add tunnel-tos attribute and "inherit" support
2021-12-06 15:59:33 +01:00
d290cfe8e7 addons: tunnel: new attribute: tunnel-tos
'tunnel-tos': {
    'help': 'TOS for tunnel packets (range 0..255), 1=inherit',
    "validrange": ["0", "255"],
    'validvals': ['<number>', 'inherit'],
    'required': False,
    'example': ['tunnel-tos inherit'],
    "aliases": ["tos"]
}

Signed-off-by: Alexander Petrovskiy <alexpe@nvidia.com>
2021-12-01 18:36:44 +03:00
4efd36fab0 addons: tunnel: add 'inherit' value to 'tunnel-ttl' attribute
Signed-off-by: Alexander Petrovskiy <alexpe@nvidia.com>
2021-12-01 17:43:29 +03:00
7d14f4d4e9 Merge pull request #170 from Jasperswaagman/master
Add none as valid value for bridge-ports on a bridge interface
2021-11-10 18:12:17 +01:00
1c1f8d4b12 Merge pull request #221 from li-kunkun/fix-default-route-add
Fix adding a static IPv6 default route failed on RA networks
2021-10-28 17:35:51 +02:00
cfc34b5b21 Fix adding a static IPv6 default route failed on RA networks
There may be adding a static IPv6 default route failed on networks where
router advertisements are also present.

The flow of up an interface is this:
1. ip link set dev $interface up
2. set sysctl config
3. config ip addr
4. config default ip route

After setting the link up, the kernel might learning an address and a
default route from RA before the default route config. The default route
will fail to be added. If the RA route is expired, and not be refreshed
for some reasons,the system looses IPv6 network connectivity.

Proposed fix is to use "route replace" instead of "route add". When the
RA learned route is still present it gets replaced, when it is not present
the route gets added.

Signed-off-by: Kunkun Li <likunkun@bytedance.com>
2021-10-25 17:08:31 +08:00
bcd450241f debian: Run ifupdown2 after udev has settled 2021-09-27 16:58:28 +02:00
970c72e437 addons: vxlan: fix lib.addon.Vxlan import (fixes: #217)
Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2021-08-26 13:44:05 +02:00
1bb6e6f0fb nlcache: fix TypeError: argument of type 'IPNetwork' is not iterable
Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2021-07-30 11:58:54 +02:00
c2b847f7af addons: introduces old_ifaceobjs to get_dependent_ifacenames
Other addon modules need to access the list of old ifaceobjs

Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2021-07-06 12:46:02 +02:00
15666526bf usercmd: fix TypeError: unsupported operand type(s) for |: '_Environ' and 'dict'
Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2021-07-06 12:38:44 +02:00
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
acfdbff891 nlcache: clean duplicated code (link_add)
Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2021-07-05 17:00:44 +02:00
b334df6e88 nlcache: update link_set_bridge_info_data_dry_run
Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2021-07-05 16:59:28 +02:00
9a6a305084 cleanups - upstream sync
Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2021-07-02 18:20:42 +02:00
ba5437b9ec nlcache: addr_add: convert pointtopoint and broadcast attribute to ipaddress obj
the following config was broken:

auto swp1
iface swp1
      address 10.128.141.37/26
      broadcast 10.128.141.63

error: netlink: swp1: cannot add address 10.128.141.37/26 dev swp1: 'str' object has no attribute 'packed'

Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2021-07-02 18:15:00 +02:00
f8ed376891 lib: nlcache: new netlink API "link_add" (waits for link creation)
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2021-07-02 18:11:09 +02:00
790a55e93e addons: link: ifquery-check now validates admin state
[12:57:29] root:~ # ifquery -a
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp

auto swp1
iface swp1
        post-up ip link set dev swp1 down

auto swp2
iface swp2
        link-down yes

auto swp3
iface swp3
        link-down no

auto swp4
iface swp4

[12:57:29] root:~ #
[12:57:29] root:~ #
[12:57:30] root:~ #
[12:57:30] root:~ # ifquery -ac
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp                                                [pass]

auto swp1
iface swp1 (link is down)                                           [fail]
        post-up ip link set dev swp1 down                               []

auto swp2
iface swp2                                                          [pass]
        link-down yes                                               [pass]

auto swp3
iface swp3                                                          [pass]
        link-down no                                                [pass]

auto swp4
iface swp4

[12:57:31] root:~ #

Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2021-07-02 18:07:34 +02:00
859b8643b6 nlcache: link_set_address: override cache after mac address change is aacked
after a successful mac change we should override our cache so that we don't
keep stale values in cache (in case the cache is queried before the kernel
notification arrives)

Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2021-07-02 15:24:00 +02:00
9b23b7c684 iproute2: svd: convert vnifilter attr to boolean to cover all case
Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2021-07-01 19:59:25 +02:00
9ca87c5e8b addons: vxlan: ifquery-check: mcastgrp-map: use bridge vni show
Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2021-07-01 19:54:09 +02:00
3376c23335 addons: vxlan: remove stale code (bridge fdb show call)
Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2021-07-01 19:53:38 +02:00
b3a93dfce1 addons: vxlan: fix name 'vni_mcastgrp_map' is not defined
Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2021-07-01 19:53:04 +02:00
d910b87c50 addons: vxlan: mcastgrp-map: remove validval attribute
Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2021-07-01 19:51:45 +02:00
e7ecab23d9 addons: vxlan: refactoring code to allow updating an existing SVD
Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2021-07-01 19:51:12 +02:00
20aabf550c addons: vxlan: fix mcast group get api during vni filter set
the mcast group set code was not using the right api
to get mcast groups.

Signed-off-by: Roopa Prabhu <roopa@nvidia.com>
Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2021-07-01 19:48:24 +02:00
238e048507 addons: vxlan: remoteip-map: check user config against old config and not running state
'bridge flood macs are deleted everytime ifreload is triggered even without any changes to e/n/i config'
this was happening because ifupdown2 was checking the live fdb entries and calculating the delta between
the new and old config. Now we are simply checking the old and new ifupdown2 (/e/n/i) config to avoid
messing with macs added by the control plane

Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2021-07-01 19:47:44 +02:00
d4403f1e77 addons: vxlan: ifquery-check: don't check fdb running state if mcastgrp-map or remoteip map are not configured
fdb entries can be added by FRR, so we won't be checking the running
state if there's no record of a user configuration in /e/n/i

Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2021-07-01 19:47:08 +02:00
2b867068c6 addons: vxlan: allow svd config update
Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2021-07-01 19:46:32 +02:00
8743434a25 addons: vxlan: add null list check when mcastgrp map not present
Signed-off-by: Roopa Prabhu <roopa@nvidia.com>
2021-07-01 19:45:43 +02:00
782aff35ce addons: vxlan: support for vxlan-support-mix-dev-types policy (default yes)
Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2021-07-01 19:08:55 +02:00
db4371de3c addons: vxlan: error out when an unsupported mix of SVD and TVDs are configured
Currently mixing SVDs and TVDs on the same system is not supported,
regardless of whether they are in the same vlan-aware bridge or
across different ones. NVUE will configure all VNIs as SVDs by
default so this would hopefully only arise if a user edits
/etc/network/interfaces and manages their configuration with ifupdown2.

Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2021-07-01 19:08:04 +02:00
eff6613023 lib: iproute2: fix missing bridge_vni_del function
Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2021-07-01 19:05:36 +02:00
abb7644b9c lib: iproute2: batch vni filter commands
Signed-off-by: Roopa Prabhu <roopa@nvidia.com>
Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2021-07-01 19:04:55 +02:00
af8d5db22b addons: vxlan: use new vni filter api to set mcast groups per vni
Signed-off-by: Roopa Prabhu <roopa@nvidia.com>
Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2021-07-01 19:00:17 +02:00
8acbc3c523 ifupdown2: lib: dont bring down link during vni filter changes
Signed-off-by: Roopa Prabhu <roopa@nvidia.com>
Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2021-07-01 18:40:52 +02:00
1b7f1f34e4 addons: vxlan: add 'Exception' to try/catch
Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2021-07-01 18:13:55 +02:00
e79cf84297 addons: bridge-vlan-vni-map: add vlan reserved check
Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2021-07-01 17:59:39 +02:00
ec5fde2532 addons: bridge: bridge-vlan-vni-map: add more details log error when finding duplicated vnis
Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2021-07-01 17:58:34 +02:00
af3034111f addons: bridge: bridge-vlan-vni-map: fix consecutive vni ids mapped to incorrect range vids
Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2021-07-01 17:57:59 +02:00
13ecedd2f7 addons: bridge: add batching commands for vids add/del
Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2021-07-01 17:56:11 +02:00