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

60 Commits

Author SHA1 Message Date
66eb9ce3c5 addons: vxlan: add support for new attribute: vxlan-remoteip-map
syntax:
vxlan-remoteip-map 1000-1005=10.0.0.1,10.0.0.42-10.0.0.45,10.0.0.90-10.0.0.95
vxlan-remoteip-map vni-range=ip-range,comma-separated

Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2021-06-30 23:42:48 +02:00
e521508b41 addons: vxlan: support ToS and udpcsum 2021-04-29 20:16:46 -06:00
038136754c addons: bond: bond mac should always be inherited from it's first slave
check if the bond mac address is correctly inherited from it's
first slave. There's a case where that might not be happening:
$ ip link show swp1 | grep ether
   link/ether 08:00:27:04:d8:01 brd ff:ff:ff:ff:ff:ff
$ ip link show swp2 | grep ether
   link/ether 08:00:27:04:d8:02 brd ff:ff:ff:ff:ff:ff
$ ip link add dev bond0 type bond
$ ip link set dev swp1 master bond0
$ ip link set dev swp2 master bond0
$ ip link show bond0 | grep ether
   link/ether 08:00:27:04:d8:01 brd ff:ff:ff:ff:ff:ff
$ ip link add dev bond1 type bond
$ ip link set dev swp1 master bond1
$ ip link show swp1 | grep ether
   link/ether 08:00:27:04:d8:01 brd ff:ff:ff:ff:ff:ff
$ ip link show swp2 | grep ether
   link/ether 08:00:27:04:d8:01 brd ff:ff:ff:ff:ff:ff
$ ip link show bond0 | grep ether
   link/ether 08:00:27:04:d8:01 brd ff:ff:ff:ff:ff:ff
$ ip link show bond1 | grep ether
   link/ether 08:00:27:04:d8:01 brd ff:ff:ff:ff:ff:ff
$
ifupdown2 will automatically correct and fix this unexpected behavior

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2021-01-25 21:37:36 +01:00
28bf72d8cb addons: vlan: new attribute: vlan-bridge-binding
From Mike Manning:
In the case of vlan filtering on bridges, the bridge may also have the
corresponding vlan devices as upper devices. Currently the link state
of vlan devices is transferred from the lower device. So this is up if
the bridge is in admin up state and there is at least one bridge port
that is up, regardless of the vlan that the port is a member of.

The link state of the vlan device may need to track only the state of
the subset of ports that are also members of the corresponding vlan,
rather than that of all ports.

Add a flag to specify a vlan bridge binding mode, by which the link
state is no longer automatically transferred from the lower device,
but is instead determined by the bridge ports that are members of the
vlan.
----

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2021-01-25 21:30:40 +01:00
0044f105ef nlmanager: fix IPAddress's repr, which must return a str
Signed-off-by: Alexandre Bruyelles <abruyelles@odiso.com>
2020-08-27 12:13:55 +02:00
0c019b802d Merge branch 'master' into issue-43/support-for-vxlan-ipv6-attributes 2020-07-01 16:55:38 +02:00
3218f49d81 use "except Exception:" instead of "except:"
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2020-06-24 01:12:24 +02:00
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
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
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
580a567b25 addressvirtual: fix argument of type 'IPv4Network' is not iterable
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2020-05-13 20:41:28 +02:00
bc2cf49ade nlmanager: ipnetwork: don't set prefixlen flag if prefix has default value
nlmanager: ipnetwork: fix 'IPv4Address' object has no attribute 'split' exception

nlpacket: use IP[v4|6]Address object when network mask is not provided or needed

nlpacket: AttributeIPAddress: fix decode handler for Routes

    During the python2 to 3 migration there was some refactoring
    Seems like some code specific to Route-decoding was removed
    This patch is fixing the issue by re-adding this code and
    tweaking it a little bit (to make it nice and clean :))

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2020-04-14 18:19:10 +02:00
9a23f45770 Merge pull request #146 from aderumier/bond_primary_reselect
addons: bond: add support for bond-primary-reselect attribute
2020-03-04 16:59:35 +01:00
ff6e951d4f Merge pull request #143 from aderumier/python3
add openvswitch addons
2020-03-04 16:52:41 +01:00
533ffabe78 Merge branch 'master-next' into python3
* master-next:
  nlpacket: don't raise an exception on 24 bytes mac address (#140)
2020-02-24 14:17:57 +01:00
716316cf3b bond: add bond-primary-reselect option
This option exist in ifupdown1/ifenslave,
used for active-backup bond
2020-02-21 09:13:55 +01:00
46c2e97909 nlpacket: don't raise an exception on 24 bytes mac address (#140)
This is a place holder until a proper fix is added.

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2020-02-20 15:21:31 +01:00
5a55e3629c openvswitch : manually add link to cache after creation 2020-02-17 12:54:38 +01:00
49cb2925f1 nlpacket: AttributeIPAddress: fix decode handler for Routes
During the python2 to 3 migration there was some refactoring
Seems like some code specific to Route-decoding was removed
This patch is fixing the issue by re-adding this code and
tweaking it a little bit (to make it nice and clean :))

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2020-02-14 02:44:56 +01:00
7050c6fc73 Merge branch 'master-next' into python3
* master-next:
  This also adds ipip6 to nlpacket IFLA_INFO_KIND.
2020-02-04 15:47:00 +01:00
cb61aad1d9 This also adds ipip6 to nlpacket IFLA_INFO_KIND. 2020-02-04 13:51:42 +01:00
07325f6b5e Merge branch 'master-next' into python3
* master-next:
  Add XFRM to IFLA_INFO_KIND and reverse change to iproute2 class.
  This patch fixes the XFRM addon for ifupdown2 version 2. The nlpacket for XFRM had a bug, I also changed iproute2 to add the XFRM interface to the local cache after creation. Since XFRM has no IFLA_LINKINFO I made the argument optional. Otherwise no further operation will be done like adding an IP.
2020-02-03 17:18:57 +01:00
8dcaeb6439 Add XFRM to IFLA_INFO_KIND and reverse change to iproute2 class. 2020-02-03 17:06:32 +01:00
69015cb30b Merge remote-tracking branch 'upstream/master-next' into bugfix/xfrm 2020-02-03 17:06:15 +01:00
f60f58374d Merge branch 'master-next' into python3
* master-next:
  nlmanager: nlpacket: add "ip6ip6" link kind to LINKINFO encode handler
2020-02-03 16:56:09 +01:00
51d0d2e477 nlmanager: nlpacket: add "ip6ip6" link kind to LINKINFO encode handler
Alternative to patch proposed in PR#137

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2020-02-03 15:23:37 +01:00
6552d825e0 This patch fixes the XFRM addon for ifupdown2 version 2.
The nlpacket for XFRM had a bug, I also changed iproute2 to add
the XFRM interface to the local cache after creation.
Since XFRM has no IFLA_LINKINFO I made the argument optional.
Otherwise no further operation will be done like adding an IP.

I also removed an unecessary variable in the addon.

Signed-off-by: Sven Auhagen <sven.auhagen@voleatech,de>
2020-02-03 14:23:44 +01:00
0c6b76af51 Merge branch 'master-next' into python3
* master-next:
  nlpacket: add tunnel link_kind to encode support list
  addons.conf: remove duplicate entry for tunnel pre-up
2020-01-28 12:00:03 +01:00
040192991d nlpacket: add tunnel link_kind to encode support list
fixing: TypeError: cannot concatenate 'str' and 'NoneType' objects

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2020-01-28 11:56:19 +01:00
bc7effff52 python3: ipnetwork: create new ipnetwork object from existing ones
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2020-01-21 08:56:41 +01:00
0e936c3ffa python3: replacing ipaddr with custom ipnetwork.IPNetwork object
As mentioned in a previous commit:
python3 ipaddress behave differently from python2-ipaddr, this is
a serious problem for us since it breaks most of the ip addresses
code.

>>> import ipaddress
>>> ipaddress.ip_network("10.10.10.242/10", False)
IPv4Network('10.0.0.0/10')

This is a problem for us, so we need to use a custom IPNetwork object.
Our custom IPNetwork object uses ipaddress.IPAddress under the hood

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2020-01-08 11:09:08 +01:00
45864399b0 Revert "python3: ipaddress is now part of the standard library (removing python-ipaddr)"
This reverts commit 5dded70eaa1be660f80ebb50bfdb35e86d7e1fac.
2019-12-17 17:35:51 +01:00
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
eea20c9dff python3: nlpacket: encode_ipv4: convert to string before converting to bytes
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2019-12-17 17:19:12 +01:00
c8eec61e41 python3: nlpacket: importing python3 fixes from nlmanager repo
more fixes for strings/bytes, netlink packet pack/unpack and
python3 floating division

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2019-12-17 17:16:30 +01:00
997910cd2a python3: nlmanager: fix sequence.next() call
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2019-12-17 17:09:17 +01:00
fefbda193d python3: nlpacket: LINKINFO: info_kind as a string not bytes
The rest of the code expects link kind to be a string(str) and not bytes

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2019-12-17 17:02:34 +01:00
2ead3536f2 python3: nlpacket: LINKINFO: workaround: converting strings to bytes and ignoring NoneType
Not sure why there's NoneType objects here...

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2019-12-17 17:01:18 +01:00
90f5a2d19e python3: nlpacket: BRPORT: decode: convert data to byte before unpacking
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2019-12-17 17:01:00 +01:00
c9496c0ae4 python3: nlpacket: fix str vs bytes errors
python2 uses strings but python3 mainly uses bytes, and it's a mess...

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2019-12-17 16:59:56 +01:00
3b01ed7618 python3: 2to3 changes
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2019-12-17 16:55:49 +01:00
35681c0608 python3: shebang update
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2019-12-17 16:40:10 +01:00
223ba5af1d ifupdown2 2.0.0-1
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2019-12-17 13:46:18 +01:00
986965c169 nlmanager: nlmanager: retry binding tx_socket up to NLMANAGER_BIND_RETRY times
NLMANAGER_BIND_RETRY env variable defaults to 4242

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2019-09-18 12:49:42 +02:00
f279a8ef8f Merge pull request #111 from svenauhagen/feature/xfrm
This commit adds support for the new IPSec Interface XFRM.
2019-06-07 00:22:39 +08:00
255ffb1fc3 addons: bridge: set bridge mtu on device creation
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2019-06-06 19:18:29 +08:00
ca42da726a This release adds support for the new IPSec Interface XFRM.
It is available since Kernel 4.19 and has two parmeters:

1. XFRM ID to map to an SA/SAs
2. Underlying Interface if you want to take advantage of IPSec Hardware Offload

Otherwise it is treated as a normal interface and not like a tunnel (VTI).

I added two attributes to the interface to configure it and otherwise use it as a normal interface.
One example is:

auto ipsec1
iface ipsec1 inet
	xfrm-physdev lo
	xfrmid 1
2019-06-05 11:05:33 +02:00
dbc23e6cbf nlpacket: vxlan: encode: fix payload length
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2019-04-22 10:53:59 +08:00
b994bd3977 addons: addressvirtual: vrrp: fix multiline-merge attribute detection
Now we support the following config:
auto swp1
iface swp1
      vrrp 3 50.0.1.1/24
      vrrp 3 2001:50:0:1::1/64
      vrrp 3 2001:50:0:42::1/64

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2019-04-22 10:53:01 +08:00
ec25a08c3a addons: vxlan: add support for vxlan-ttl attribute
New vxlan-ttl attribute: specifies the TTL value to use in outgoing
packets. Valid values: range 1..255 or auto (0)

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2019-04-22 10:48:36 +08:00