]> git.proxmox.com Git - mirror_ifupdown2.git/log
mirror_ifupdown2.git
4 years agodebian: changelog: update 3.0.0-1 entry
Julien Fortin [Thu, 14 May 2020 00:31:00 +0000 (02:31 +0200)]
debian: changelog: update 3.0.0-1 entry

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
4 years agoadd support for single vxlan device (bridge-vlan-vni-map)
Julien Fortin [Thu, 14 May 2020 00:16:47 +0000 (02:16 +0200)]
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>
4 years agoaddons: bridge: add support for new bridge-always-up attribute
Julien Fortin [Fri, 6 Mar 2020 23:34:41 +0000 (00:34 +0100)]
addons: bridge: add support for new bridge-always-up attribute

Enabling this attribute on a bridge will
enslave a dummy interface to the bridge

example:

auto bridge
iface bridge
      bridge-vlan-aware yes
      bridge-always-up yes
      bridge-ports vni42

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
4 years agoaddons: bond: fix es-sys-mac example
Julien Fortin [Mon, 11 May 2020 12:15:12 +0000 (14:15 +0200)]
addons: bond: fix es-sys-mac example

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
4 years agomain: catch ArgvParseError and don't display traceback
Julien Fortin [Tue, 12 May 2020 16:44:15 +0000 (18:44 +0200)]
main: catch ArgvParseError and don't display traceback

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
4 years agoaddons: dchp: add debug logs and retry mechanism for dhclient (controled by policy)
Julien Fortin [Wed, 13 May 2020 14:58:24 +0000 (16:58 +0200)]
addons: dchp: add debug logs and retry mechanism for dhclient (controled by policy)

ifupdown2 now tries to monitor the dhclient call to see if an ip address was
successfully assigned on the requested device. The number of retry can be
customized using the "dhclient_retry_on_failure" policy variable (which defaults to 0)

This commit also add debugging capabilities by automatically enabling sysloging when
configuring dhcp at boot (with PERFMODE option).

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
4 years agonetworking.service: use start-networking script to control start/stop/reload
Julien Fortin [Wed, 13 May 2020 18:47:47 +0000 (20:47 +0200)]
networking.service: use start-networking script to control start/stop/reload

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
4 years agoifupdownmain: syntax-check: l2protocol-tunnel: replace regex with str.split()
Julien Fortin [Sat, 2 May 2020 17:14:09 +0000 (19:14 +0200)]
ifupdownmain: syntax-check: l2protocol-tunnel: replace regex with str.split()

Seems like the regex module might be behave a little bit different in python3.
The regexes used to validate l2protocol-tunnel were returning incorrect lists:

value=lldp,stp
regex=['', 'l', 'l', 'd', 'p', '', 's', 't', 'p', '']

the patch simplifies the code by using str.translate and str.split

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
4 years agoaddressvirtual: fix argument of type 'IPv4Network' is not iterable
Julien Fortin [Thu, 30 Apr 2020 21:59:35 +0000 (23:59 +0200)]
addressvirtual: fix argument of type 'IPv4Network' is not iterable

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
4 years agoaddons: addressvirtual: add link_kind check before deleting stale macvlan device
Julien Fortin [Wed, 29 Apr 2020 19:28:39 +0000 (21:28 +0200)]
addons: addressvirtual: add link_kind check before deleting stale macvlan device

In the addressvirtual module we have some code that checks if stale macvlans should
be deleted (when the address-virtual or vrrp keywords are removed from the config).
To find those stale macvlans we basically do a glob search in /sys/class/net/ with
the macvlan prefix (ifname) defined by ifupdown2: '%s-v' % ifaceobj.name[0:13], which
for a device foo would create macvlans named foo-v0...foo-vN.

In this particular case we have a vxlan named: sha3szx4-vpn, which gets matched
and removed without actually checking if this device is a macvlan or not.

This commit adds a link_kind check to ensure that we are only removing macvlans.

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
4 years agoifupdownmain: fix NameError: name 'Set' is not defined
Julien Fortin [Wed, 13 May 2020 18:33:16 +0000 (20:33 +0200)]
ifupdownmain: fix NameError: name 'Set' is not defined

Set() is a python2 object, set is the python3 way

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
4 years agoaddons: bond: add support for es-sys-mac and es-bonds
Julien Fortin [Wed, 13 May 2020 18:27:21 +0000 (20:27 +0200)]
addons: bond: add support for es-sys-mac and es-bonds

ES bonds have the same "init state" requirements as CLAG bonds -
1. A bond needs to be designated as an "es-bond" for this purpose.
For clag-bonds we used "clag-id" attr (to designate a bond as a "clag-bond").
For ES bonds we will use "es-sys-mac" attr.

2. Slaves added to an "ES bond" must have protodown-on.
This is again similar to CLAG bonds

3. And vice-versa i.e. when a slave is removed from an "es-bond",
protodown-on must be cleared.

4. When es-sys-mac is first set on a bond, all the bond-slaves must be
placed in "protodown-on" state. This is needed whether FRR is running at that point or not.

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
4 years agoaddons: mstpctl: ifquery: add VXLAN check before processing bpdu-mstpctl attributes
Julien Fortin [Fri, 17 Apr 2020 15:11:54 +0000 (17:11 +0200)]
addons: mstpctl: ifquery: add VXLAN check before processing bpdu-mstpctl attributes

When --with-defaults is provided we update the stanza-data structure without
making sure we are dealing with a vxlan intf.

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
4 years agoaddons: vrf-slave: keep vlan down if lower device has link-down yes
Julien Fortin [Wed, 22 Apr 2020 14:35:18 +0000 (16:35 +0200)]
addons: vrf-slave: keep vlan down if lower device has link-down yes

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
4 years agoaddons: address: mtu: set bridge mtu with policy default
Julien Fortin [Tue, 21 Apr 2020 16:39:05 +0000 (18:39 +0200)]
addons: address: mtu: set bridge mtu with policy default

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
4 years agoMerge pull request #153 from bauen1/add-missing-build-dep
Julien Fortin [Mon, 11 May 2020 22:49:48 +0000 (00:49 +0200)]
Merge pull request #153 from bauen1/add-missing-build-dep

add missing build dependency

4 years agoadd missing build dependency
bauen1 [Mon, 11 May 2020 18:56:34 +0000 (20:56 +0200)]
add missing build dependency

Signed-off-by: bauen1 <j2468h@gmail.com>
4 years agoUpdate README.rst
Julien Fortin [Sat, 25 Apr 2020 13:40:25 +0000 (15:40 +0200)]
Update README.rst

4 years agodebian: control: bump Standards-Version
Julien Fortin [Tue, 14 Apr 2020 17:22:54 +0000 (19:22 +0200)]
debian: control: bump Standards-Version

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
4 years agodebian: changelog: update 3.0.0-1 entry
Julien Fortin [Tue, 14 Apr 2020 17:22:37 +0000 (19:22 +0200)]
debian: changelog: update 3.0.0-1 entry

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
4 years agonlmanager: ipnetwork: don't set prefixlen flag if prefix has default value
Julien Fortin [Tue, 14 Apr 2020 16:19:10 +0000 (18:19 +0200)]
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>
4 years agoaddons: vxlan: ifquery-running: fix incorrect diplayed data
Julien Fortin [Mon, 6 Apr 2020 13:57:38 +0000 (15:57 +0200)]
addons: vxlan: ifquery-running: fix incorrect diplayed data

Signed-off-by: Scott Laffer <slaffer@cumulusnetworks.com>
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
4 years agocompletion: removing argcomplete support
Julien Fortin [Tue, 14 Apr 2020 14:50:04 +0000 (16:50 +0200)]
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>
4 years agoifupdownmain: process addon alias translation right after user config
Julien Fortin [Mon, 13 Apr 2020 13:21:22 +0000 (15:21 +0200)]
ifupdownmain: process addon alias translation right after user config

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
4 years agoaddons: bond: refactor get_bond_slaves function
Julien Fortin [Mon, 13 Apr 2020 13:21:49 +0000 (15:21 +0200)]
addons: bond: refactor get_bond_slaves function

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
4 years agoaddons: bond: refactor code to not use python3 set
Julien Fortin [Mon, 13 Apr 2020 14:03:50 +0000 (16:03 +0200)]
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>
4 years agoaddons: addressvirtual: fix byte/str exception
Julien Fortin [Wed, 8 Apr 2020 16:34:18 +0000 (18:34 +0200)]
addons: addressvirtual: fix byte/str exception

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
4 years agoupdate __version__ and copyright year in __init__.py
Julien Fortin [Tue, 14 Apr 2020 14:27:23 +0000 (16:27 +0200)]
update __version__ and copyright year in __init__.py

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
4 years agoaddons: dhcp: remove code duplicate
Julien Fortin [Fri, 27 Mar 2020 14:53:40 +0000 (15:53 +0100)]
addons: dhcp: remove code duplicate

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
4 years agoMerge branch 'master' into python3
Julien Fortin [Thu, 26 Mar 2020 02:02:53 +0000 (03:02 +0100)]
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

4 years agoaddons: address: process MTU before addrgen and adddresses
Julien Fortin [Thu, 26 Mar 2020 00:04:30 +0000 (01:04 +0100)]
addons: address: process MTU before addrgen and adddresses

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
4 years agoifupdownmain: support for marking interfaces as mgmt interfaces
Roopa Prabhu [Fri, 20 Dec 2019 20:54:39 +0000 (12:54 -0800)]
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>
4 years agoaddons: bridge: fix TypeError: sequence item 0: expected string, int found
Julien Fortin [Wed, 26 Feb 2020 01:39:39 +0000 (02:39 +0100)]
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>
4 years agoaddons: bridge: set bridge MTU after bridge creation
Julien Fortin [Wed, 25 Mar 2020 23:51:25 +0000 (00:51 +0100)]
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>
4 years agoaddons: mstpctl: check mstpctl-stp and bridge-stp and fix bridge cache update
Julien Fortin [Wed, 18 Mar 2020 03:17:18 +0000 (04:17 +0100)]
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>
4 years agolib: nlcache: fix dry_run exception
Julien Fortin [Wed, 19 Feb 2020 14:50:27 +0000 (15:50 +0100)]
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>
4 years agoaddons: address: add support for a separate default mtu policy for eth interfaces
Roopa Prabhu [Mon, 16 Dec 2019 21:08:32 +0000 (13:08 -0800)]
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>
4 years agoMerge pull request #146 from aderumier/bond_primary_reselect
Julien Fortin [Wed, 4 Mar 2020 15:59:35 +0000 (16:59 +0100)]
Merge pull request #146 from aderumier/bond_primary_reselect

addons: bond: add support for bond-primary-reselect attribute

4 years agoMerge pull request #143 from aderumier/python3
Julien Fortin [Wed, 4 Mar 2020 15:52:41 +0000 (16:52 +0100)]
Merge pull request #143 from aderumier/python3

add openvswitch addons

4 years agodebian: changelog: new 2.0.2-1 entry
Julien Fortin [Wed, 4 Mar 2020 15:24:50 +0000 (16:24 +0100)]
debian: changelog: new 2.0.2-1 entry

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
4 years agoMerge branch 'master' into master-next
Julien Fortin [Wed, 4 Mar 2020 15:16:30 +0000 (16:16 +0100)]
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

4 years agoMerge pull request #152 from BarbarossaTM/fix-tunnels
Julien Fortin [Wed, 26 Feb 2020 15:57:36 +0000 (16:57 +0100)]
Merge pull request #152 from BarbarossaTM/fix-tunnels

addons: tunnel: Update examples to new attr names (#133)

4 years agoaddons: tunnel: Update examples to new attr names (#133)
Maximilian Wilhelm [Wed, 26 Feb 2020 14:08:25 +0000 (15:08 +0100)]
addons: tunnel: Update examples to new attr names (#133)

Signed-off-by: Maximilian Wilhelm <max@sdn.clinic>
4 years agoMerge pull request #151 from aderumier/fix-forwarding-3
Julien Fortin [Mon, 24 Feb 2020 22:50:23 +0000 (23:50 +0100)]
Merge pull request #151 from aderumier/fix-forwarding-3

don't change interface forwarding value if not defined

4 years agodebian: changelog: update 3.0.0-1 entry
Julien Fortin [Mon, 24 Feb 2020 15:25:13 +0000 (16:25 +0100)]
debian: changelog: update 3.0.0-1 entry

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
4 years agoifupdownmain: support for marking interfaces as mgmt interfaces
Roopa Prabhu [Fri, 20 Dec 2019 20:54:39 +0000 (12:54 -0800)]
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>
4 years agodon't change interface forwarding value if not defined
Alexandre Derumier [Mon, 24 Feb 2020 14:39:43 +0000 (15:39 +0100)]
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.

4 years agolib: nlcache: fix dry_run exception
Julien Fortin [Wed, 19 Feb 2020 14:50:27 +0000 (15:50 +0100)]
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>
4 years agoaddons: bridge: set bridge MTU after bridge creation
Julien Fortin [Mon, 24 Feb 2020 13:58:12 +0000 (14:58 +0100)]
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>
4 years agoaddons: address: add support for a separate default mtu policy for eth interfaces
Julien Fortin [Mon, 24 Feb 2020 13:26:31 +0000 (14:26 +0100)]
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>
4 years agoMerge branch 'master-next' into python3
Julien Fortin [Mon, 24 Feb 2020 13:17:57 +0000 (14:17 +0100)]
Merge branch 'master-next' into python3

* master-next:
  nlpacket: don't raise an exception on 24 bytes mac address (#140)

4 years agobond: add bond-primary-reselect option
Alexandre Derumier [Fri, 21 Feb 2020 08:13:55 +0000 (09:13 +0100)]
bond: add bond-primary-reselect option

This option exist in ifupdown1/ifenslave,
used for active-backup bond

4 years agonlpacket: don't raise an exception on 24 bytes mac address (#140)
Julien Fortin [Thu, 20 Feb 2020 14:21:31 +0000 (15:21 +0100)]
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>
4 years agoopenvswitch : don't create cache link for ovs tunnel && patch port
Alexandre Derumier [Mon, 17 Feb 2020 12:20:17 +0000 (13:20 +0100)]
openvswitch : don't create cache link for ovs tunnel && patch port

They are virtual inside openvswitch

4 years agoopenvswitch : manually add link to cache after creation
Alexandre Derumier [Mon, 17 Feb 2020 11:53:16 +0000 (12:53 +0100)]
openvswitch : manually add link to cache after creation

4 years agoadd openvswitch addons
Alexandre Derumier [Sun, 16 Feb 2020 13:54:09 +0000 (14:54 +0100)]
add openvswitch addons

This is a reimplementation of ifupdown1 script

https://github.com/openvswitch/ovs/blob/master/debian/openvswitch-switch.README.Debian

4 years agonlpacket: AttributeIPAddress: fix decode handler for Routes
Julien Fortin [Fri, 14 Feb 2020 01:36:36 +0000 (02:36 +0100)]
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>
4 years agoaddons: tunnel: support ifupdown1 tunnel attribute as aliases (fixes #133)
Julien Fortin [Fri, 7 Feb 2020 12:41:09 +0000 (13:41 +0100)]
addons: tunnel: support ifupdown1 tunnel attribute as aliases (fixes #133)

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
4 years agolib: addon: translate aliases to attribute name (fixes #133)
Julien Fortin [Fri, 7 Feb 2020 12:40:31 +0000 (13:40 +0100)]
lib: addon: translate aliases to attribute name (fixes #133)

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
4 years agoMerge branch 'master-next' into python3
Julien Fortin [Tue, 4 Feb 2020 14:47:00 +0000 (15:47 +0100)]
Merge branch 'master-next' into python3

* master-next:
  This also adds ipip6 to nlpacket IFLA_INFO_KIND.

4 years agoMerge pull request #139 from svenauhagen/bugfix/ipip6
Julien Fortin [Tue, 4 Feb 2020 14:46:21 +0000 (15:46 +0100)]
Merge pull request #139 from svenauhagen/bugfix/ipip6

This also adds ipip6 to nlpacket IFLA_INFO_KIND.

4 years agoThis also adds ipip6 to nlpacket IFLA_INFO_KIND.
Sven Auhagen [Tue, 4 Feb 2020 12:51:42 +0000 (13:51 +0100)]
This also adds ipip6 to nlpacket IFLA_INFO_KIND.

4 years agoMerge branch 'master-next' into python3
Julien Fortin [Mon, 3 Feb 2020 16:18:57 +0000 (17:18 +0100)]
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.

4 years agoMerge pull request #136 from svenauhagen/bugfix/xfrm
Julien Fortin [Mon, 3 Feb 2020 16:16:42 +0000 (17:16 +0100)]
Merge pull request #136 from svenauhagen/bugfix/xfrm

This patch fixes the XFRM addon for ifupdown2 version 2.

4 years agoAdd XFRM to IFLA_INFO_KIND and reverse change to iproute2 class.
Sven Auhagen [Mon, 3 Feb 2020 16:06:32 +0000 (17:06 +0100)]
Add XFRM to IFLA_INFO_KIND and reverse change to iproute2 class.

4 years agoMerge remote-tracking branch 'upstream/master-next' into bugfix/xfrm
Sven Auhagen [Mon, 3 Feb 2020 16:06:15 +0000 (17:06 +0100)]
Merge remote-tracking branch 'upstream/master-next' into bugfix/xfrm

4 years agoMerge branch 'master-next' into python3
Julien Fortin [Mon, 3 Feb 2020 15:56:09 +0000 (16:56 +0100)]
Merge branch 'master-next' into python3

* master-next:
  nlmanager: nlpacket: add "ip6ip6" link kind to LINKINFO encode handler

4 years agonlmanager: nlpacket: add "ip6ip6" link kind to LINKINFO encode handler
Julien Fortin [Mon, 3 Feb 2020 14:23:37 +0000 (15:23 +0100)]
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>
4 years agoThis patch fixes the XFRM addon for ifupdown2 version 2.
Sven Auhagen [Mon, 3 Feb 2020 13:23:44 +0000 (14:23 +0100)]
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>
4 years agodebian: add ifupdown2.lintian-overrides
Julien Fortin [Tue, 28 Jan 2020 16:00:50 +0000 (17:00 +0100)]
debian: add ifupdown2.lintian-overrides

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
4 years agopython3: debian: control: update python3:depends
Julien Fortin [Tue, 28 Jan 2020 16:00:18 +0000 (17:00 +0100)]
python3: debian: control: update python3:depends

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
4 years agosetup.py: drop ipaddr dependency
Julien Fortin [Tue, 28 Jan 2020 15:59:40 +0000 (16:59 +0100)]
setup.py: drop ipaddr dependency

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
4 years agomodulebase: fix Invalid python3 Syntax after merge
Julien Fortin [Tue, 28 Jan 2020 11:33:52 +0000 (12:33 +0100)]
modulebase: fix Invalid python3 Syntax after merge

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
4 years agoaddons: dhcp: if mgmt vrf context exec dhclient in default vrf
Roopa Prabhu [Fri, 17 Jan 2020 20:45:39 +0000 (12:45 -0800)]
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>
4 years agopython3: remove str.encode(ascii, ignore) call from python3 tree
Julien Fortin [Tue, 28 Jan 2020 08:15:39 +0000 (09:15 +0100)]
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>
4 years agoMerge branch 'master-next' into python3
Julien Fortin [Tue, 28 Jan 2020 11:00:03 +0000 (12:00 +0100)]
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

4 years agonlpacket: add tunnel link_kind to encode support list
Julien Fortin [Tue, 28 Jan 2020 10:56:19 +0000 (11:56 +0100)]
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>
4 years agoaddons.conf: remove duplicate entry for tunnel pre-up
Julien Fortin [Tue, 28 Jan 2020 10:55:52 +0000 (11:55 +0100)]
addons.conf: remove duplicate entry for tunnel pre-up

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
4 years agoaddons: ethtool: fix: _modinfo dictionary got renamed to modinfo in a merge
Julien Fortin [Mon, 27 Jan 2020 19:15:49 +0000 (20:15 +0100)]
addons: ethtool: fix: _modinfo dictionary got renamed to modinfo in a merge

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
4 years agopython3: addons: address: update IPNetwork call after master-next merge
Julien Fortin [Tue, 21 Jan 2020 08:34:57 +0000 (09:34 +0100)]
python3: addons: address: update IPNetwork call after master-next merge

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
4 years agoMerge branch 'master-next' into python3
Julien Fortin [Tue, 21 Jan 2020 08:33:20 +0000 (09:33 +0100)]
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

4 years agoaddons: address: convert ip addresses from statemanager to IPNetwork objects
Julien Fortin [Fri, 3 Jan 2020 12:23:47 +0000 (13:23 +0100)]
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>
4 years agomain: add extra log info to output the exit status
Julien Fortin [Wed, 15 Jan 2020 15:21:17 +0000 (16:21 +0100)]
main: add extra log info to output the exit status

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
4 years agoaddons: ethtool: add support for "ethtool_ignore_errors" policy
Julien Fortin [Tue, 21 Jan 2020 08:20:41 +0000 (09:20 +0100)]
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>
4 years agoLinkUtils: mac_str_to_int: fix string to int conversion
Julien Fortin [Tue, 21 Jan 2020 08:15:58 +0000 (09:15 +0100)]
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>
4 years agoaddons: dhcp: if mgmt vrf context exec dhclient in default vrf
Roopa Prabhu [Mon, 13 Jan 2020 19:17:26 +0000 (11:17 -0800)]
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>
4 years agopython3: ipnetwork: create new ipnetwork object from existing ones
Julien Fortin [Tue, 21 Jan 2020 07:56:41 +0000 (08:56 +0100)]
python3: ipnetwork: create new ipnetwork object from existing ones

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
4 years agopython3: addons: addressvirtual: convert user ip addr to ipnetwork format
Julien Fortin [Tue, 21 Jan 2020 07:56:10 +0000 (08:56 +0100)]
python3: addons: addressvirtual: convert user ip addr to ipnetwork format

4 years agopython3: update debian files to build python3 deb
Julien Fortin [Wed, 8 Jan 2020 11:22:58 +0000 (12:22 +0100)]
python3: update debian files to build python3 deb

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
4 years agopython3: replacing ipaddr with custom ipnetwork.IPNetwork object
Julien Fortin [Tue, 7 Jan 2020 15:58:56 +0000 (16:58 +0100)]
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>
4 years agopython3: ethtool: port offload code to python3
Julien Fortin [Thu, 2 Jan 2020 14:53:12 +0000 (15:53 +0100)]
python3: ethtool: port offload code to python3

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
4 years agoMerge branch 'master-next' into python3
Julien Fortin [Thu, 2 Jan 2020 14:50:51 +0000 (15:50 +0100)]
Merge branch 'master-next' into python3

* master-next:
  argv: move --nldebug option to common_argparse to avoid exception in ifreload
  debian: changelog: new 2.0.1-1 entry
  argv: add new command line argument --nldebug
  This commit adds the feature to change offloads for nics. Currently GRO, LRO GSO, TSO, UFO, TX and RX Offload are supported.

4 years agoargv: move --nldebug option to common_argparse to avoid exception in ifreload
Julien Fortin [Tue, 31 Dec 2019 19:25:44 +0000 (20:25 +0100)]
argv: move --nldebug option to common_argparse to avoid exception in ifreload

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
4 years agodebian: changelog: new 2.0.1-1 entry 2.0.1-1
Julien Fortin [Tue, 31 Dec 2019 14:21:36 +0000 (15:21 +0100)]
debian: changelog: new 2.0.1-1 entry

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
4 years agoargv: add new command line argument --nldebug
Julien Fortin [Mon, 23 Dec 2019 13:40:42 +0000 (14:40 +0100)]
argv: add new command line argument --nldebug

if --nldebug is provided, netlink debug message will be printed

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
4 years agoMerge branch 'master' into master-next
Julien Fortin [Mon, 30 Dec 2019 14:59:15 +0000 (15:59 +0100)]
Merge branch 'master' into master-next

* master:
  This commit adds the feature to change offloads for nics. Currently GRO, LRO GSO, TSO, UFO, TX and RX Offload are supported.

4 years agoMerge pull request #118 from svenauhagen/feature/offload
Julien Fortin [Mon, 30 Dec 2019 14:36:19 +0000 (15:36 +0100)]
Merge pull request #118 from svenauhagen/feature/offload

This commit adds the feature to change offloads for nics

4 years agopython3: fixes for batman_adv, ppp and xfrm addons
Julien Fortin [Tue, 17 Dec 2019 17:27:22 +0000 (18:27 +0100)]
python3: fixes for batman_adv, ppp and xfrm addons

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
4 years agodebian: postinst: remove apt install, add log message instead
Julien Fortin [Tue, 17 Dec 2019 17:26:58 +0000 (18:26 +0100)]
debian: postinst: remove apt install, add log message instead

4 years agodebian: postinst: add work-around to manually install python3-ipaddr
Julien Fortin [Tue, 17 Dec 2019 16:37:40 +0000 (17:37 +0100)]
debian: postinst: add work-around to manually install python3-ipaddr

python3 ipaddress behave differently from python2-ipaddr, this is
a serious problem for us since it breaks most of the ip addresses
code. The work around install the python3-ipaddr via pip3 (and
installs pip3 if necessary). The workaround will stay in the code
util the ipaddress issue is fixed.

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>