]> git.proxmox.com Git - mirror_ifupdown2.git/log
mirror_ifupdown2.git
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 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 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 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 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 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 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: 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 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 agoifupdown2 2.0.0-1
Julien Fortin [Tue, 17 Dec 2019 00:04:54 +0000 (01:04 +0100)]
ifupdown2 2.0.0-1

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
4 years agoMerge pull request #121 from aderumier/arpaccept
Julien Fortin [Thu, 24 Oct 2019 23:21:29 +0000 (16:21 -0700)]
Merge pull request #121 from aderumier/arpaccept

add arp-accept option.

4 years agoifupdownmain: detect interfaces no longer configured but pick up by regexes
Julien Fortin [Tue, 17 Sep 2019 17:56:16 +0000 (19:56 +0200)]
ifupdownmain: detect interfaces no longer configured but pick up by regexes

This patch will detect interfaces that were removed from /etc/network/interfaces
but still got pick up by a regex (i.e. bridge-port vni*) and manually remove
those interfaces from internal data-structures (i.e. dependency graph).

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
4 years agoifupdown: log: drop comments
Julien Fortin [Wed, 14 Aug 2019 15:44:33 +0000 (17:44 +0200)]
ifupdown: log: drop comments

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
4 years agoaddons: address: if hwaddress changed delete old fdb entry
Julien Fortin [Tue, 2 Apr 2019 18:11:29 +0000 (02:11 +0800)]
addons: address: if hwaddress changed delete old fdb entry

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
4 years agoaddons: bond: enable ipv6 on brports before bond enslaving
Julien Fortin [Tue, 30 Jul 2019 15:12:13 +0000 (17:12 +0200)]
addons: bond: enable ipv6 on brports before bond enslaving

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
4 years agoaddons: vrf: enable_ipv6: rename method and add sysfs check for brport
Julien Fortin [Tue, 30 Jul 2019 14:43:27 +0000 (16:43 +0200)]
addons: vrf: enable_ipv6: rename method and add sysfs check for brport

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
4 years agoreverting the iface.py changes ; addons: vrf: enable ipv6 on slaves
Julien Fortin [Wed, 24 Jul 2019 22:35:59 +0000 (00:35 +0200)]
reverting the iface.py changes ; addons: vrf: enable ipv6 on slaves

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
4 years agonlmanager: nlmanager: retry binding tx_socket up to NLMANAGER_BIND_RETRY times
Julien Fortin [Wed, 17 Jul 2019 13:08:04 +0000 (15:08 +0200)]
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>
4 years agoaddons: address: remove old ip address when intf is moved to dhcp
Julien Fortin [Tue, 16 Jul 2019 23:21:03 +0000 (01:21 +0200)]
addons: address: remove old ip address when intf is moved to dhcp

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
4 years agoaddons: vrf: enable ipv6 on vrf slaves when moved from bport
Julien Fortin [Tue, 16 Jul 2019 12:39:58 +0000 (14:39 +0200)]
addons: vrf: enable ipv6 on vrf slaves when moved from bport

Remove/add swp2 from br0 and vrf blue

auto swp2
iface swp2
      vrf blue

auto br0
iface br0
      bridge-ports swp1
      address 10.0.0.11/24
      bridge-vlan-aware no

auto blue
iface blue
      vrf-table auto

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
4 years agoLinkUtils: convert ip addrs to string before comparing them
Julien Fortin [Sat, 13 Jul 2019 12:02:49 +0000 (16:02 +0400)]
LinkUtils: convert ip addrs to string before comparing them

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
4 years agoifupdownmain: ifquery check read_iface_config errors
Julien Fortin [Fri, 12 Jul 2019 18:46:56 +0000 (22:46 +0400)]
ifupdownmain: ifquery check read_iface_config errors

auto swp1
iface swp1
      typo_attribute 42

$ ifquery -ac
error: /etc/network/interfaces: line9: iface swp1: unsupported keyword (typo_attribute)
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp                                                [pass]

auto swp1
iface swp1

$ echo $?
1
$
$ echo $?
1
$ ifup -a
error: /etc/network/interfaces: line9: iface swp1: unsupported keyword (typo_attribute)
$ echo $?
1
$

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
4 years agoadd arp-accept option.
Alexandre Derumier [Tue, 3 Sep 2019 07:43:38 +0000 (09:43 +0200)]
add arp-accept option.

Currently, the only way to enable arp-accept is to enable
a policy with l3_intf_arp_accept.

But this enable arp-accept for all bridges.

This option allow to define it for specific bridge.

This is needed with bgp-evpn and vm migration
https://github.com/FRRouting/frr/issues/4904

4 years agoThis commit adds the feature to change offloads for nics.
Sven Auhagen [Tue, 30 Jul 2019 17:59:34 +0000 (19:59 +0200)]
This commit adds the feature to change offloads for nics.
Currently GRO, LRO GSO, TSO, UFO, TX and RX Offload are supported.

One can read the current value with ethtool -k NICNAME.
Values are set with ethtool -K NICNAME gro on lro on gso on tso on ufo on tx on rx on

An example for the config file is:

iface eth0 static
gro-offload no

The default value will be kept in the statemanager. The default value might differ depending on the NIC and is saved upon the first change.

4 years agosetup.py: bumping version from 1.2.5 to 1.2.9
Julien Fortin [Wed, 24 Jul 2019 21:55:19 +0000 (23:55 +0200)]
setup.py: bumping version from 1.2.5 to 1.2.9

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
4 years agodebian: changelog: add empty 1.2.9-1 entry for next release
Julien Fortin [Fri, 12 Jul 2019 08:47:06 +0000 (12:47 +0400)]
debian: changelog: add empty 1.2.9-1 entry for next release

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
4 years agodebian: changelog: add new changelog entry 1.2.8-1
Julien Fortin [Fri, 12 Jul 2019 08:22:36 +0000 (12:22 +0400)]
debian: changelog: add new changelog entry 1.2.8-1

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
4 years agoaddons: dhcp: PEP8 fixes
Julien Fortin [Fri, 12 Jul 2019 08:22:10 +0000 (12:22 +0400)]
addons: dhcp: PEP8 fixes

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
4 years agoMerge pull request #116 from rajendra-dendukuri/dhcp6_duid
Julien Fortin [Fri, 12 Jul 2019 08:18:02 +0000 (12:18 +0400)]
Merge pull request #116 from rajendra-dendukuri/dhcp6_duid

addons: dhcp: Policy to specify DUID type to use on dhcpv6 requests

4 years agoaddons: dhcp: Policy to specify DUID type to use on dhcpv6 requests
Rajendra Dendukuri [Thu, 11 Jul 2019 05:43:28 +0000 (22:43 -0700)]
addons: dhcp: Policy to specify DUID type to use on dhcpv6 requests

Update module description and changelog

Signed-off-by: Rajendra Dendukuri <rajendra.dendukuri@broadcom.com>
4 years agodebian: changelog: add new 1.2.7-1 entry
Julien Fortin [Tue, 9 Jul 2019 15:28:33 +0000 (19:28 +0400)]
debian: changelog: add new 1.2.7-1 entry

  * New: Add bridge-ports-condone-regex option (closes #117)

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
4 years agoAdd bridge-ports-condone-regex option (closes #117)
Maximilian Wilhelm [Tue, 27 Sep 2016 09:26:52 +0000 (11:26 +0200)]
Add bridge-ports-condone-regex option (closes #117)

  The bridge-ports-condone-regex option can be used to tell ifupdown2 to let
  some bridge member ports alone and do not remove them on ifreload runs.
  This might come in handy when running a KVM (or any other virtualization
  system) host with a bridged network setup.

  Before this option, ifupdown2 would either complain about not existing
  member ports when setting up the bridge (if all VM interfaces were to
  be specified in /etc/network/interfaces) or remove any VM interface
  from a bridge if it was not specified in /e/n/i.

Signed-off-by: Maximilian Wilhelm <max@rfc2324.org>
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
Co-authored-by: Julien Fortin <julien@cumulusnetworks.com>
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
4 years agoaddons: dhcp: Policy to specify DUID type to use on dhcpv6 requests
Rajendra Dendukuri [Sat, 6 Jul 2019 22:14:38 +0000 (15:14 -0700)]
addons: dhcp: Policy to specify DUID type to use on dhcpv6 requests

Add a ifupdown2 policy attribute dhcp6-duid to allow user to specify the DUID type
to be used on an IPv6 enabled interface.

Signed-off-by: Rajendra Dendukuri <rajendra.dendukuri@broadcom.com>
4 years agodebian: changelog: updating 1.2.6-1 entry
Julien Fortin [Mon, 24 Jun 2019 07:44:23 +0000 (15:44 +0800)]
debian: changelog: updating 1.2.6-1 entry

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
4 years agoaddons: addressvirtual: keep macvlan down if link-down specified on lower device
Julien Fortin [Thu, 20 Jun 2019 07:52:09 +0000 (15:52 +0800)]
addons: addressvirtual: keep macvlan down if link-down specified on lower device

auto vlan1755
iface vlan1755
        address 172.21.7.42/29
address-virtual 00:00:5E:00:01:41 172.21.7.41/29
link-down yes
vlan-id 1755
vlan-raw-device bridge

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
5 years agoaddons: when comparing mac addresses use integer representation
Julien Fortin [Tue, 11 Jun 2019 14:51:07 +0000 (22:51 +0800)]
addons: when comparing mac addresses use integer representation

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
5 years agoMerge pull request #108 from rajendra-dendukuri/ll_wait_option
Julien Fortin [Tue, 11 Jun 2019 17:01:36 +0000 (01:01 +0800)]
Merge pull request #108 from rajendra-dendukuri/ll_wait_option

Policy to wait for IPv6 link local address to be available

5 years agoaddons: dhcp: Policy to wait for IPv6 link local address to be available
Rajendra Dendukuri [Tue, 11 Jun 2019 10:29:43 +0000 (06:29 -0400)]
addons: dhcp: Policy to wait for IPv6 link local address to be available

Rename the policy attribute as dhcp6-ll-wait.
Changed logic to reuse existing timeout variable to store user provided value.

5 years agoMerge pull request #111 from svenauhagen/feature/xfrm
Julien Fortin [Thu, 6 Jun 2019 16:22:39 +0000 (00:22 +0800)]
Merge pull request #111 from svenauhagen/feature/xfrm

This commit adds support for the new IPSec Interface XFRM.

5 years agoaddons conf
Sven Auhagen [Thu, 6 Jun 2019 16:21:37 +0000 (18:21 +0200)]
addons conf

5 years agoxfrm id
Sven Auhagen [Thu, 6 Jun 2019 15:53:41 +0000 (17:53 +0200)]
xfrm id

5 years agodebian: changelog: update 1.2.6-1 entry
Julien Fortin [Thu, 6 Jun 2019 11:19:42 +0000 (19:19 +0800)]
debian: changelog: update 1.2.6-1 entry

* New. policymanager: merge module policy instead of overriding duplicates
* New: set default mtu on user defined device (via link-type)

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
5 years agoaddons: bridge: set bridge mtu on device creation
Julien Fortin [Mon, 3 Jun 2019 11:18:24 +0000 (19:18 +0800)]
addons: bridge: set bridge mtu on device creation

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
5 years agopolicymanager: merge module policy instead of overriding duplicates
Julien Fortin [Wed, 29 May 2019 06:16:05 +0000 (14:16 +0800)]
policymanager: merge module policy instead of overriding duplicates

When module policies are split up in seperate files ifupdown2 doesn't merge
them together but simply overrides duplicates. This pathc fixes the issue
and merge the related policies together.

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
5 years agoaddons: address: set default mtu on user defined device (via link-type)
Julien Fortin [Thu, 2 May 2019 17:19:01 +0000 (01:19 +0800)]
addons: address: set default mtu on user defined device (via link-type)

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
5 years agoaddons: addressvirtual: fix older vrrp macvlan doesn't get removed
Julien Fortin [Wed, 24 Apr 2019 10:43:24 +0000 (18:43 +0800)]
addons: addressvirtual: fix older vrrp macvlan doesn't get removed

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
5 years agoaddons: protodown vrrp macvlans only when created
Quentin Young [Thu, 2 May 2019 18:01:47 +0000 (18:01 +0000)]
addons: protodown vrrp macvlans only when created

Not when we are reloading and applying config ot existing macvlans -
somebody may be using them, we don't want to protodown them in that
case.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
5 years agoMerge pull request #113 from robertobarreda/patch-1
Julien Fortin [Thu, 6 Jun 2019 08:57:27 +0000 (16:57 +0800)]
Merge pull request #113 from robertobarreda/patch-1

ifupdownaddons: LinkUtils: fix cmd concatenation

5 years agofix cmd concatenation
Roberto Barreda [Wed, 5 Jun 2019 15:11:02 +0000 (17:11 +0200)]
fix cmd concatenation

5 years agoUpdate xfrm.py
sven [Wed, 5 Jun 2019 11:15:10 +0000 (13:15 +0200)]
Update xfrm.py

Update copyright text

5 years agoThis release adds support for the new IPSec Interface XFRM.
Sven Auhagen [Wed, 5 Jun 2019 09:05:33 +0000 (11:05 +0200)]
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

5 years agoMerge pull request #109 from aderumier/fix-bridge-stp-user-space
Julien Fortin [Mon, 3 Jun 2019 10:04:36 +0000 (18:04 +0800)]
Merge pull request #109 from aderumier/fix-bridge-stp-user-space

Fix error message on ifquery when sysctl bridge-stp-user-space

5 years agoFix error message on ifquery when sysctl bridge-stp-user-space
Alexandre Derumier [Mon, 3 Jun 2019 09:45:27 +0000 (11:45 +0200)]
Fix error message on ifquery when sysctl bridge-stp-user-space

This fix this kind of error:

error: bond0: cmd '/sbin/sysctl net.bridge.bridge-stp-user-space' failed: returned 255 (sysctl: cannot stat /proc/sys/net/bridge/bridge-stp-user-space: No such file or directory
)
error: fwpr103p0: cmd '/sbin/sysctl net.bridge.bridge-stp-user-space' failed: returned 255 (sysctl: cannot stat /proc/sys/net/bridge/bridge-stp-user-space: No such file or directory
)

5 years agoPolicy to wait for IPv6 link local address to be available
Rajendra Dendukuri [Wed, 29 May 2019 14:25:29 +0000 (10:25 -0400)]
Policy to wait for IPv6 link local address to be available

Add a ifupdown2 policy attribute to allow user to tune the wait time to be
allowed before the dhclient can be started on an IPv6 enabled interface.

5 years agoMerge pull request #107 from BarbarossaTM/batman-routing-algo-master
Julien Fortin [Sun, 26 May 2019 03:16:31 +0000 (11:16 +0800)]
Merge pull request #107 from BarbarossaTM/batman-routing-algo-master

addons: batman_adv: Add support to set B.A.T.M.A.N. advanced routing_algo

5 years agoaddons: batman_adv: Add support to set B.A.T.M.A.N. advanced routing_algo
Maximilian Wilhelm [Sat, 25 May 2019 12:16:30 +0000 (14:16 +0200)]
addons: batman_adv: Add support to set B.A.T.M.A.N. advanced routing_algo

  Add a new attribute for B.A.T.M.A.N. advanced interfaces to control the
  B.A.T.M.A.N. advanced routing algorithm to be used when setting up new
  interfaces. As the routing algorithm must be set before an interface is
  created, it needs special handling and can't be implemented as a common
  attribute. D'oh.

Signed-off-by: Maximilian Wilhelm <max@sdn.clinic>
Tested-by: Annika Wickert <aw@awlnx.space>
5 years agoMerge pull request #103 from aderumier/fix-ifquery-speed
Julien Fortin [Wed, 22 May 2019 09:55:14 +0000 (17:55 +0800)]
Merge pull request #103 from aderumier/fix-ifquery-speed

Fix ifquery speed

5 years agoMerge pull request #104 from bauen1/fix-tunnel-vrf
Julien Fortin [Thu, 16 May 2019 06:32:35 +0000 (14:32 +0800)]
Merge pull request #104 from bauen1/fix-tunnel-vrf

ifupdown2addons: fix order of pre-up,vrf and pre-up,tunnel

5 years agoifupdown2addons: fix order of pre-up,vrf and pre-up,tunnel
bauen1 [Wed, 15 May 2019 12:42:29 +0000 (14:42 +0200)]
ifupdown2addons: fix order of pre-up,vrf and pre-up,tunnel

Fixes the vrf addon trying to set the master on a non-existant tunnel
interface

5 years agoMerge pull request #101 from aderumier/fix-forwarding
Julien Fortin [Wed, 15 May 2019 09:43:36 +0000 (17:43 +0800)]
Merge pull request #101 from aderumier/fix-forwarding

don't change interface forwarding value if not defined

5 years agoreadd support for self.ipforward
Alexandre Derumier [Wed, 15 May 2019 05:15:00 +0000 (07:15 +0200)]
readd support for self.ipforward

if user want to setup default forwarding with a global policy

5 years agoaddressvirtual: _query_running : use cache instead glob
Alexandre Derumier [Fri, 10 May 2019 06:19:57 +0000 (08:19 +0200)]
addressvirtual: _query_running : use cache instead glob

5 years agomstpctl: don't load module if missing /sbin/mstpctl
Alexandre Derumier [Fri, 10 May 2019 04:37:02 +0000 (06:37 +0200)]
mstpctl: don't load module if missing /sbin/mstpctl

5 years agobatman_adv: don't load module if missing batctl
Alexandre Derumier [Fri, 10 May 2019 04:28:17 +0000 (06:28 +0200)]
batman_adv: don't load module if missing batctl

5 years agolinkutils: _bridge_attrs_fill: use sysfs
Alexandre Derumier [Fri, 10 May 2019 04:23:52 +0000 (06:23 +0200)]
linkutils: _bridge_attrs_fill: use sysfs

5 years agodon't change interface forwarding value if not defined
Alexandre Derumier [Sat, 4 May 2019 13:12:00 +0000 (15:12 +0200)]
don't change interface forwarding value if not defined

5 years agodebian: changelog: update 1.2.6-1 entry before release
Julien Fortin [Mon, 22 Apr 2019 03:05:12 +0000 (11:05 +0800)]
debian: changelog: update 1.2.6-1 entry before release

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
5 years agoaddons: bridge: down: when ifreload_down_changed=1: purge bridge and upper devices...
Julien Fortin [Fri, 22 Mar 2019 07:35:18 +0000 (15:35 +0800)]
addons: bridge: down: when ifreload_down_changed=1: purge bridge and upper devices cache

On ifreload (down ops) we need to purge the cache entry of the bridge and its upper devices
to avoid stale values in our cache.

ifup this config, then remove bridge-vids 20, ifreload: since the bridge is removed because
of ifreload_down_changed=1, we need torecreate the vlan bridge.10 and it's configuration, the
cache is stale. We need to clear it to remove the ip 10.10.10.10/32.

auto bridge
iface bridge
      bridge-ports swp1 swp2
      bridge-vids 10 20
      bridge-vlan-aware yes

auto swp1
iface swp1
      link-speed 10000

auto swp2
iface swp2

auto bridge.10
iface bridge.10
      address 10.10.10.10/32

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
5 years agoaddons: addressvirtual: vrrp: protodown new macvlans
Quentin Young [Tue, 19 Mar 2019 17:26:45 +0000 (17:26 +0000)]
addons: addressvirtual: vrrp: protodown new macvlans

New VRRP macvlan devices should be set into protodown when first
created, to prevent ND traffic and other automatically generated kernel
traffic from being transmitted on the interface and causing downstream
MAC moves.

Reviewed-by: Julien Fortin <julien@cumulusnetworks.com>
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
5 years agoaddons: bridge: don't disable ipv6 on vlan-aware vxlan-bridge
Julien Fortin [Fri, 15 Mar 2019 16:25:26 +0000 (00:25 +0800)]
addons: bridge: don't disable ipv6 on vlan-aware vxlan-bridge

ipv6 shouldn't be disabled on a bridge vlan aware

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
5 years agoaddons: bridge: get default mcsnoop value when bridge_vxlan is not set
Julien Fortin [Wed, 13 Mar 2019 07:23:54 +0000 (15:23 +0800)]
addons: bridge: get default mcsnoop value when bridge_vxlan is not set

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
5 years ago.gitignore: pycharm remote execution update
Julien Fortin [Thu, 31 Jan 2019 07:22:09 +0000 (15:22 +0800)]
.gitignore: pycharm remote execution update

To work on ifupdown2 i'm using Pycharm on macOS. ifupdown2 runs in a
debian VM. To use Pycharm remote execution capabilities, we need several
symlinks (one per command). Git needs to ignore those symlinks :)

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
5 years agonlpacket: vxlan: encode: fix payload length
Julien Fortin [Fri, 8 Mar 2019 11:58:34 +0000 (12:58 +0100)]
nlpacket: vxlan: encode: fix payload length

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
5 years agoaddons: addressvirtual: vrrp: set addrgen mode random on VRRP macvlans
Julien Fortin [Thu, 7 Mar 2019 18:22:09 +0000 (19:22 +0100)]
addons: addressvirtual: vrrp: set addrgen mode random on VRRP macvlans

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
5 years agoaddons: bridge: check kernel state for igmp snooping on vxlan brport
Julien Fortin [Thu, 7 Mar 2019 18:11:16 +0000 (19:11 +0100)]
addons: bridge: check kernel state for igmp snooping on vxlan brport

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
5 years agoaddons: addressvirtual: vrrp: fix multiline-merge attribute detection
Julien Fortin [Thu, 7 Mar 2019 17:43:10 +0000 (18:43 +0100)]
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>
5 years agoaddons: addressvirtual: vrrp: fix macvlan name to include vrrp id
Julien Fortin [Tue, 5 Mar 2019 17:44:57 +0000 (18:44 +0100)]
addons: addressvirtual: vrrp: fix macvlan name to include vrrp id

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
5 years agodebian: changelog: 1.2.6-1: update changelog entry for new release
Julien Fortin [Tue, 5 Mar 2019 09:51:56 +0000 (10:51 +0100)]
debian: changelog: 1.2.6-1: update changelog entry for new release

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
5 years agoaddons: addressvirtual: vrrp: remove macvlan device when all ipvX addrs are removed
Julien Fortin [Wed, 27 Feb 2019 21:40:55 +0000 (22:40 +0100)]
addons: addressvirtual: vrrp: remove macvlan device when all ipvX addrs are removed

For each VRRP configuration we create 2 macvlans (ip4 and ip6), if the ip4
is removed from the config we need to remove the associated macvlan (same
for ip6).

Testing Done: remove all ip4 (or ip6) from vrr attribute line

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
5 years agoaddons: ethtool: raise error on ethtool command failure
Julien Fortin [Thu, 28 Feb 2019 14:34:58 +0000 (15:34 +0100)]
addons: ethtool: raise error on ethtool command failure

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
5 years agoaddons: bridge: add new policy vxlan_bridge_igmp_snooping_enable_port_mcrouter
Julien Fortin [Tue, 26 Feb 2019 23:11:36 +0000 (00:11 +0100)]
addons: bridge: add new policy vxlan_bridge_igmp_snooping_enable_port_mcrouter

if igmp snooping is enabled on a vxlan bridge and if the
vxlan_bridge_igmp_snooping_enable_port_mcrouter is turned on, ifupdown2
will automatically enable multicast router on the vxlan brport unless
this attribute was provided by the user. The policy is enabled by default.

The policy can be disabled as follow:
{
    "bridge": {
"module_globals": {
    "vxlan_bridge_igmp_snooping_enable_port_mcrouter": "no"
}
    }
}

auto br0
iface br0
      bridge-ports vx42
      bridge-mcsnoop yes

auto vx42
iface vx42
      vxlan-id 42

$ ifreload -ad
will show that the config is applied

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