Commit Graph

1620 Commits

Author SHA1 Message Date
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
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
Julien Fortin
dc74cedae4 addons: vxlan: ifquery-running: fix incorrect diplayed data
Signed-off-by: Scott Laffer <slaffer@cumulusnetworks.com>
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2020-04-14 18:11:14 +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
9ddfbfff85 ifupdownmain: process addon alias translation right after user config
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2020-04-14 16:33:48 +02:00
Julien Fortin
6bc9fadc44 addons: bond: refactor get_bond_slaves function
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2020-04-14 16:33:48 +02:00
Julien Fortin
1f928890af addons: bond: refactor code to not use python3 set
Python3 sets are using the python hash seed to generate random hashes
which makes the sets ordering different everytime. In our case we need
to honor the user configuration (first device should be enslaved first)

https://docs.python.org/3/using/cmdline.html#envvar-PYTHONHASHSEED

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2020-04-14 16:33:48 +02:00
Julien Fortin
db26516e01 addons: addressvirtual: fix byte/str exception
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2020-04-14 16:29:47 +02:00
Julien Fortin
62d222e3dd update __version__ and copyright year in __init__.py
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2020-04-14 16:27:23 +02:00
Julien Fortin
a4b5439507 addons: dhcp: remove code duplicate
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2020-03-27 15:53:40 +01: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
2c152f8396 addons: address: process MTU before addrgen and adddresses
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2020-03-26 01:04:30 +01:00
Roopa Prabhu
a506093536 ifupdownmain: support for marking interfaces as mgmt interfaces
All interfaces starting with 'eth' are marked with
ifaceLinkPrivFlags.MGMT_INTF flag

This match can be changed by setting a 'main' module
'module_globals' policy attr 'mgmt_intf_prefix'.
example:
   $cat /var/lib/ifupdown2/policy.d/main.json
   {
    "main": {
        "module_globals" : {
            "mgmt_intf_prefix" : "ensp"
        },
        "defaults": {},
        "iface_defaults": {
            "eth0": {
                "exclude-companion": "mgmt"
            }
        }
    }
  }

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2020-03-26 00:59:54 +01:00
Julien Fortin
6d94c17b51 addons: bridge: fix TypeError: sequence item 0: expected string, int found
This is seen when running vids are different than
configured vids on a bridge port.

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2020-03-26 00:52:22 +01:00
Julien Fortin
24084976f7 addons: bridge: set bridge MTU after bridge creation
addons: bridge: get bridge MTU from address policy not bridge

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2020-03-26 00:51:25 +01:00
Julien Fortin
24931ffa21 addons: mstpctl: check mstpctl-stp and bridge-stp and fix bridge cache update
When an stp is enabled on an existing bridge mstpctl attributes are not always
configured by ifreload. This is due to a timing issue (cache) and some issue in
the mstpctl addon.

- Cache: when changing an existing bridge (done via netlink) we wait for the
kernel ack but we don't update our current cache with the new bridge attributes
This is bad because it means that the bridge cache data are stale until we
receive the notification from the kernel.

- Mstp addon: mstpctl-stp was deprecated in favor of bridge-stp, but in some
place, the mstpctl.py code checks for mstpctl-stp but not for bridge-stp. This
commit fixes the area related to this issue but this should be revisited in
a later commit

Ticket: CM-28951
Reviewed By: Roopa
Testing Done: precommit, smoke, evpn-smoke

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2020-03-26 00:39:03 +01:00
Julien Fortin
8598c690e3 lib: nlcache: fix dry_run exception
Ticket: CM-28312
Testing Done: Test from the ticket

error: link_set_bridge_info_data_dry_run() takes exactly 3 arguments (4 given)
error: link_set_brport_with_info_slave_data_dry_run() got an unexpected keyword argument 'kind'

seems like when updating a method, it's associated dry-run method wasn't
updated accordingly. Maybe there is a way to programmatically check that
I will look into it.

warning: bridge: skipping port X invalid ether addr
warning: interface not recognized - please check interface configuration
Won't show on dry-run anymore

Log info for commands executed with utils.exec_command() weren't prefixed with
DRY-RUN.

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2020-03-26 00:38:54 +01:00
Roopa Prabhu
866c818344 addons: address: add support for a separate default mtu policy for eth interfaces
New module global policy mgmt_intf_mtu for mgmt interace mtu:
$cat /var/lib/ifupdown2/policy.d/address.json
{
    "address": {
        "module_globals": {
            "enable_l3_iface_forwarding_checks": "yes",
            "vlan_aware_bridge_address_support": "no",
            "l3_intf_arp_accept": "1",
            "mgmt_intf_mtu": "1500"
        },
        "defaults": {
            "mtu": "9216",
            "ip-forward": "on",
            "ip6-forward": "on"
        }
    }
}

If not specified mgmt_intf_mtu becomes equal to the mtu from defaults
section.

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2020-03-26 00:02:58 +01:00
Julien Fortin
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
Julien Fortin
ff6e951d4f
Merge pull request #143 from aderumier/python3
add openvswitch addons
2020-03-04 16:52:41 +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
5ca7021683 Merge branch 'master' into master-next
* master:
  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-04 16:16:30 +01:00
Julien Fortin
cf908b0a46
Merge pull request #152 from BarbarossaTM/fix-tunnels
addons: tunnel: Update examples to new attr names (#133)
2020-02-26 16:57:36 +01:00
Maximilian Wilhelm
7d6d434f18 addons: tunnel: Update examples to new attr names (#133)
Signed-off-by: Maximilian Wilhelm <max@sdn.clinic>
2020-02-26 15:08:25 +01:00
Julien Fortin
499d05970e
Merge pull request #151 from aderumier/fix-forwarding-3
don't change interface forwarding value if not defined
2020-02-24 23:50:23 +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
Roopa Prabhu
54ada52023 ifupdownmain: support for marking interfaces as mgmt interfaces
All interfaces starting with 'eth' are marked with
ifaceLinkPrivFlags.MGMT_INTF flag

This match can be changed by setting a 'main' module
'module_globals' policy attr 'mgmt_intf_prefix'.
example:
   $cat /var/lib/ifupdown2/policy.d/main.json
   {
    "main": {
        "module_globals" : {
            "mgmt_intf_prefix" : "ensp"
        },
        "defaults": {},
        "iface_defaults": {
            "eth0": {
                "exclude-companion": "mgmt"
            }
        }
    }
  }

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2020-02-24 15:59:48 +01:00
Alexandre Derumier
34de87120a don't change interface forwarding value if not defined
classic ifupdown don't change forwarding value if not defined in /etc/network/interfaces (don't even support it).

Currently ifupdown2 behaviour is to turn forwarding off when not defined. (and break sysctl manual enabling (net.ipv4.ip_forward = 1, net.ipv4.conf.all.forwarding = 1, net.ipv4.conf.default.forwarding = 1
on restart or reload).

Better to not change value when not defined, and keep user manual config.
2020-02-24 15:45:19 +01:00
Julien Fortin
ca45cd9e83 lib: nlcache: fix dry_run exception
error: link_set_bridge_info_data_dry_run() takes exactly 3 arguments (4 given)
error: link_set_brport_with_info_slave_data_dry_run() got an unexpected keyword argument 'kind'

seems like when updating a method, it's associated dry-run method wasn't
updated accordingly. Maybe there is a way to programmatically check that
I will look into it.

warning: bridge: skipping port X invalid ether addr
warning: interface not recognized - please check interface configuration
Won't show on dry-run anymore

Log info for commands executed with utils.exec_command() weren't prefixed with
DRY-RUN.

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2020-02-24 15:01:40 +01:00
Julien Fortin
393524ab41 addons: bridge: set bridge MTU after bridge creation
addons: bridge: get bridge MTU from address policy not bridge

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2020-02-24 14:58:12 +01:00
Julien Fortin
cbda6ddacb addons: address: add support for a separate default mtu policy for eth interfaces
New module global policy mgmt_intf_mtu for mgmt interace mtu:

$ cat /var/lib/ifupdown2/policy.d/address.json
{
    "address": {
        "module_globals": {
            "enable_l3_iface_forwarding_checks": "yes",
            "vlan_aware_bridge_address_support": "no",
            "l3_intf_arp_accept": "1",
            "mgmt_intf_mtu": "1500"
        },
        "defaults": {
            "mtu": "9216",
            "ip-forward": "on",
            "ip6-forward": "on"
        }
    }
}

If not specified mgmt_intf_mtu becomes equal to the mtu from defaults
section.

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
2020-02-24 14:26:31 +01:00
Julien Fortin
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
Alexandre Derumier
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
Julien Fortin
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
Alexandre Derumier
ffc8ba29a0 openvswitch : don't create cache link for ovs tunnel && patch port
They are virtual inside openvswitch
2020-02-17 13:20:17 +01:00
Alexandre Derumier
5a55e3629c openvswitch : manually add link to cache after creation 2020-02-17 12:54:38 +01:00
Alexandre Derumier
213d8a409d add openvswitch addons
This is a reimplementation of ifupdown1 script

https://github.com/openvswitch/ovs/blob/master/debian/openvswitch-switch.README.Debian
2020-02-16 15:04:01 +01:00
Julien Fortin
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
Julien Fortin
79bd5819b9 addons: tunnel: support ifupdown1 tunnel attribute as aliases (fixes #133)
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2020-02-07 18:40:35 +01:00
Julien Fortin
09a6a3fd46 lib: addon: translate aliases to attribute name (fixes #133)
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2020-02-07 18:40:28 +01:00
Julien Fortin
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
Julien Fortin
87f30e59ac
Merge pull request #139 from svenauhagen/bugfix/ipip6
This also adds ipip6 to nlpacket IFLA_INFO_KIND.
2020-02-04 15:46:21 +01:00
Sven Auhagen
cb61aad1d9 This also adds ipip6 to nlpacket IFLA_INFO_KIND. 2020-02-04 13:51:42 +01:00
Julien Fortin
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
Julien Fortin
68ec847b07
Merge pull request #136 from svenauhagen/bugfix/xfrm
This patch fixes the XFRM addon for ifupdown2 version 2.
2020-02-03 17:16:42 +01:00
Sven Auhagen
8dcaeb6439 Add XFRM to IFLA_INFO_KIND and reverse change to iproute2 class. 2020-02-03 17:06:32 +01:00
Sven Auhagen
69015cb30b Merge remote-tracking branch 'upstream/master-next' into bugfix/xfrm 2020-02-03 17:06:15 +01:00
Julien Fortin
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
Julien Fortin
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