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

1399 Commits

Author SHA1 Message Date
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
Sven Auhagen
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
Julien Fortin
e79ed23595 debian: add ifupdown2.lintian-overrides
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2020-01-28 17:00:50 +01:00
Julien Fortin
880645f250 python3: debian: control: update python3:depends
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2020-01-28 17:00:18 +01:00
Julien Fortin
4616c2add2 setup.py: drop ipaddr dependency
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2020-01-28 16:59:40 +01:00
Julien Fortin
4d3cdf73c9 modulebase: fix Invalid python3 Syntax after merge
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2020-01-28 12:33:52 +01:00
Roopa Prabhu
13d85ea31a addons: dhcp: if mgmt vrf context exec dhclient in default vrf
Ticket: CM-27644

If we are running in mgmt vrf context and vrf is not specified
on the dhcp interface, use ip vrf exec to start dhclient in the
default context

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
2020-01-28 12:04:22 +01:00
Julien Fortin
55dab2f772 python3: remove str.encode(ascii, ignore) call from python3 tree
because of this line the string was converted to bytes and would
cause side effects.

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2020-01-28 12:02:10 +01:00
Julien Fortin
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
Julien Fortin
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
Julien Fortin
da5b9a569c addons.conf: remove duplicate entry for tunnel pre-up
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2020-01-28 11:55:52 +01:00
Julien Fortin
2771a88e13 addons: ethtool: fix: _modinfo dictionary got renamed to modinfo in a merge
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2020-01-27 20:15:49 +01:00
Julien Fortin
a3f9506e37 python3: addons: address: update IPNetwork call after master-next merge
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2020-01-21 09:34:57 +01:00
Julien Fortin
4955b6017a Merge branch 'master-next' into python3
* master-next:
  addons: address: convert ip addresses from statemanager to IPNetwork objects
  main: add extra log info to output the exit status
2020-01-21 09:33:20 +01:00
Julien Fortin
67c84dad3f addons: address: convert ip addresses from statemanager to IPNetwork objects
Ticket: CM-27841
Reviewed By: Roopa
Testing Done: tests from the CM

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2020-01-21 09:30:26 +01:00
Julien Fortin
9873823902 main: add extra log info to output the exit status
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2020-01-21 09:29:09 +01:00
Julien Fortin
c1b6ffc78c addons: ethtool: add support for "ethtool_ignore_errors" policy
The goal of this policy is to ignore ethtool related errors, this is
useful for specific scenario like VMs.
This policy is off by default. To turn it on simply set:

"module_globals" : {
    "ethtool_ignore_errors": true
}

under the ethtool top object.

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2020-01-21 09:20:41 +01:00
Julien Fortin
22c85b2da9 LinkUtils: mac_str_to_int: fix string to int conversion
The previous implementation failed to properly convert
mac address with missing leading-zeros.

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2020-01-21 09:15:58 +01:00
Roopa Prabhu
9d817e967e addons: dhcp: if mgmt vrf context exec dhclient in default vrf
If we are running in mgmt vrf context and vrf is not specified
on the dhcp interface, use ip vrf exec to start dhclient in the
default context

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2020-01-21 09:09:57 +01:00
Julien Fortin
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
Julien Fortin
7a6d8252cc python3: addons: addressvirtual: convert user ip addr to ipnetwork format 2020-01-21 08:56:10 +01:00
Julien Fortin
516fd7266f python3: update debian files to build python3 deb
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2020-01-08 12:22:58 +01:00