]> git.proxmox.com Git - mirror_ifupdown2.git/log
mirror_ifupdown2.git
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 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>
4 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>
4 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

4 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.

4 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.

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

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

4 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>
4 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>
4 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>
4 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>
4 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>
4 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>
4 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

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

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

Update copyright text

4 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

4 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

4 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
)

4 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.

4 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

4 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>
4 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

4 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

4 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

4 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

4 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

4 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

4 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

4 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

4 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

4 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>
5 years agoaddons: addressvirtual: create VRRP macvlans in bridge mode
Julien Fortin [Tue, 26 Feb 2019 17:58:22 +0000 (18:58 +0100)]
addons: addressvirtual: create VRRP macvlans in bridge mode

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
5 years agoaddons: addressvirtual: vrrp: base macvlan prefix on parent ifindex
Julien Fortin [Tue, 26 Feb 2019 17:30:25 +0000 (18:30 +0100)]
addons: addressvirtual: vrrp: base macvlan prefix on parent ifindex

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
5 years agoaddons: addressvirtual: make sure vrr macvlans names are 15 chars long max
Julien Fortin [Tue, 19 Feb 2019 22:14:03 +0000 (23:14 +0100)]
addons: addressvirtual: make sure vrr macvlans names are 15 chars long max

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
5 years agoaddons: addressvirtual: delete macvlan when vrrp config is removed (ifreload case)
Julien Fortin [Fri, 15 Feb 2019 10:29:43 +0000 (11:29 +0100)]
addons: addressvirtual: delete macvlan when vrrp config is removed (ifreload case)

Add a vrrp config under swp intf - ifup, then remove the vrrp config - ifreload
the macvlans are not removed without this patch

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
5 years agoaddons: vxlan: add support for vxlan-ttl attribute
Julien Fortin [Fri, 25 Jan 2019 10:06:39 +0000 (18:06 +0800)]
addons: vxlan: add support for vxlan-ttl attribute

New vxlan-ttl attribute: specifies the TTL value to use in outgoing
packets. Valid values: range 1..255 or auto (0)

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
5 years agoaddons: addressvirtual: add support for VRRP attribute
Julien Fortin [Fri, 25 Jan 2019 01:58:25 +0000 (09:58 +0800)]
addons: addressvirtual: add support for VRRP attribute

syntax: vrrp ID ip[4|6]

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
5 years agoaddons: bridge: fix 'NoneType' object has no attribute '__getitem__' error
Julien Fortin [Fri, 19 Apr 2019 09:14:21 +0000 (17:14 +0800)]
addons: bridge: fix 'NoneType' object has no attribute '__getitem__' error

Fixes #90

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
5 years agodebian: changelog: update 1.2.5-1 timestamp entry 1.2.5-1
Julien Fortin [Mon, 21 Jan 2019 03:01:13 +0000 (11:01 +0800)]
debian: changelog: update 1.2.5-1 timestamp entry

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
5 years agoscheduler: ifupdown2 scripts: log warning on EACCES exception (Fixes #89)
Julien Fortin [Thu, 17 Jan 2019 03:45:35 +0000 (11:45 +0800)]
scheduler: ifupdown2 scripts: log warning on EACCES exception (Fixes #89)

ifupdown2 behaviour significantly diverges from ifupdown on debian stretch.
Original ifupdown uses run-parts which supposedly doesn't run non-executable
files in the directory. However, ifupdown2 doesn't seem to make this
distinction.
This patch will log warning EACCES exceptions (instead of log error) and exit 0

Reported-by: George Diamantopoulos <gedia>
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
5 years agosetup.py: update copyright year (2019)
Julien Fortin [Thu, 17 Jan 2019 04:34:59 +0000 (12:34 +0800)]
setup.py: update copyright year (2019)

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
5 years agosetup.py: bump version number to 1.2.5
Julien Fortin [Thu, 17 Jan 2019 04:34:30 +0000 (12:34 +0800)]
setup.py: bump version number to 1.2.5

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
5 years agodebian: install sysvinit script (Fixes: #26)
Julien Fortin [Thu, 17 Jan 2019 03:22:26 +0000 (11:22 +0800)]
debian: install sysvinit script (Fixes: #26)

Fixes github issue #26 and debian bug #918775

Reported-by: Joerg Dorchain <joerg@dorchain.net>
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
Co-authored-by: Joerg Dorchain <joerg@dorchain.net>
Co-authored-by: Julien Fortin <julien@cumulusnetworks.com>
5 years agodebian: postinst: remove diversion after upgrade from stretch
Julien Fortin [Wed, 16 Jan 2019 09:19:45 +0000 (17:19 +0800)]
debian: postinst: remove diversion after upgrade from stretch

closes: #919443

Reported-by: Andreas Beckmann <anbe@debian.org>
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
5 years agostatemanager: configure state_dir via ifupdown2.conf
Julien Fortin [Fri, 11 Jan 2019 04:00:39 +0000 (12:00 +0800)]
statemanager: configure state_dir via ifupdown2.conf

ifupdown2 used /var/tmp/network/ to store its state file
upstream users reported that when /var/tmp is not mounted
before network configuration ifupdown2 fails. We now let
user define which location they want to use for the state
file.

closes: #918832

Reported-by: Maximilian Wilhelm <max@sdn.clinic>
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
5 years agolog: use stderr if syslog initialization fails
Julien Fortin [Sun, 30 Dec 2018 15:43:50 +0000 (22:43 +0700)]
log: use stderr if syslog initialization fails

closes: #917534

Reported-by: Joerg Dorchain <joerg@dorchain.net>
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
5 years agodebian: changelog: add debian revision and refactor 1.2.2-1 entry 1.2.2-1
Julien Fortin [Thu, 20 Dec 2018 09:40:41 +0000 (10:40 +0100)]
debian: changelog: add debian revision and refactor 1.2.2-1 entry

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
5 years agodebian: changelog: add B.A.T.M.A.N. changelog entry
Julien Fortin [Thu, 20 Dec 2018 08:48:43 +0000 (09:48 +0100)]
debian: changelog: add B.A.T.M.A.N. changelog entry

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
5 years agodebian: control: add python-pkg-resources to suggested dependencies-list
Julien Fortin [Wed, 19 Dec 2018 19:34:53 +0000 (20:34 +0100)]
debian: control: add python-pkg-resources to suggested dependencies-list

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
5 years agoman: remove non-implemented -m option (closes: #905572)
Julien Fortin [Wed, 19 Dec 2018 19:04:33 +0000 (20:04 +0100)]
man: remove non-implemented -m option (closes: #905572)

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
5 years agodebian: changelog: tag older version with UNRELEASED tag
Julien Fortin [Wed, 19 Dec 2018 17:56:31 +0000 (18:56 +0100)]
debian: changelog: tag older version with UNRELEASED tag

some of those release were available but under a different name so
technically those version numbers were never released.

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
5 years agodebian: source: format: moving to non-native package
Julien Fortin [Wed, 19 Dec 2018 17:56:02 +0000 (18:56 +0100)]
debian: source: format: moving to non-native package

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
5 years agodebian: control: update debhelper dependency and drop dh-systemd
Julien Fortin [Wed, 19 Dec 2018 17:46:21 +0000 (18:46 +0100)]
debian: control: update debhelper dependency and drop dh-systemd

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
5 years agoLinkUtils: tunnel_change: do not purge the cache on tunnel change
Sven Auhagen [Wed, 19 Dec 2018 10:32:28 +0000 (11:32 +0100)]
LinkUtils: tunnel_change: do not purge the cache on tunnel change

Author: Sven Auhagen <Sven.Auhagen@voleatech.de>

5 years agoaddons: batman_adv: import and IO api refactoring
Julien Fortin [Wed, 19 Dec 2018 06:14:15 +0000 (07:14 +0100)]
addons: batman_adv: import and IO api refactoring

The new code base supports installation via pypi so we need to update the
imports statement.
It's also good practice to use the existing IO apis to read/write and execute
sub-commands, those API will do error handling and logging.

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
5 years agoAdd addon module for B.A.T.M.A.N. advanced interface configuration. #12
Maximilian Wilhelm [Wed, 19 Dec 2018 06:07:42 +0000 (07:07 +0100)]
Add addon module for B.A.T.M.A.N. advanced interface configuration. #12

batman wasn't in master-next so it got removed during the last merge
this commit adds it back to master.
See PR #12

From Maximilian Wilhelm:
  This commit adds support for configuring B.A.T.M.A.N. advanced interfaces
  with ifupdown2. B.A.T.M.A.N. advanced is a protocol to build Layer2 based
  mesh networks with. It's supported in the Linux kernel and thus available
  in many Linux environments.

  A configuration could look like this

  auto bat0
  iface bat0
      batman-ifaces eth1 eth2.23
      batman-ifaces-ignore-regex .*_nodes
      batman-hop-penalty 23
      #
      address 192.0.2.42/24

  where »bat0« would be the local connection to the mesh network.

  The interfaces »eth1« and »eth2.23« would be used by the B.A.T.M.A.N. adv.
  protocol to communicate to other member of the mesh network.

  Any interfaces matching the »ifaces-ignore-regex« will be gently ignored
  by ifquery and ifreload as there might be some tunnels or interfaces
  added to the mesh network by other means which should not be removed by
  any subsequent ifreload run.

  The »hop-penalty» parameter set the penalty of this node within the mesh
  network.

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
Signed-off-by: Maximilian Wilhelm <max@rfc2324.org>
Author: Maximilian Wilhelm <max@rfc2324.org>

5 years agoaddons: tunnel: fix tunnel creation (#80)- master branch refactoring
Julien Fortin [Tue, 18 Dec 2018 16:05:30 +0000 (17:05 +0100)]
addons: tunnel: fix tunnel creation (#80)- master branch refactoring

During the recent merge between master and master-next the changes introduced
by PR #80 were lost. This commit adds them back with some refactoring to use
the new netlink cache.

Co-authored-by: Maximilian Wilhelm <max@sdn.clinic>
Co-authored-by: Julien Fortin <julien@cumulusnetworks.com>
Signed-off-by: Maximilian Wilhelm <max@sdn.clinic>
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
5 years agonetlink: add tunnel device support in ipcmd cache
Julien Fortin [Tue, 18 Dec 2018 14:58:11 +0000 (15:58 +0100)]
netlink: add tunnel device support in ipcmd cache

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
5 years agonlpacket: add decode support for tunnel devices
Julien Fortin [Tue, 18 Dec 2018 12:27:09 +0000 (13:27 +0100)]
nlpacket: add decode support for tunnel devices

Tunnel device now supported (decode):
- gre
- gretap
- erspan
- ip6gre
- ip6gretap
- ip6erspan
- ipip
- sit
- ip6tnl
- vti
- vti6

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
5 years agodebian: changelog: new entry for version 1.2.2
Julien Fortin [Fri, 14 Dec 2018 01:09:46 +0000 (17:09 -0800)]
debian: changelog: new entry for version 1.2.2

ifupdown2 (1.2.2) unstable; urgency=medium

  * Support for new iproute2 format (bridge vlan show)
  * Pypi install: local addons modules should be loaded first
  * Fix: link-down yes on vrf slaves
  * Fix: nlmanager: use strerror to format kernel error
  * Add: new checks for existing device with vxlan attributes
  * Ethtool: FEC: translate None and NotSupported values to link-fec off

 -- Julien Fortin <julien@cumulusnetworks.com>  Thu, 13 Dec 2018 23:42:42 -0800

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
5 years agoconfig: local addons modules should be loaded first
Julien Fortin [Thu, 6 Dec 2018 18:56:50 +0000 (10:56 -0800)]
config: local addons modules should be loaded first

ifupdown2 can be installed via apt/dpkg or via pypi (pip), those two installation methods have
two different installation directory. Our main installation dir is /usr/share/ifupdown2. This is
also were other scripts might add their own addon.
If ifupdown2 is installed via pypi we need to make sure we are loading the script-added addon modules

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
5 years agoaddons: vrf: fix link-down yes on vrf slaves
Julien Fortin [Thu, 6 Dec 2018 18:40:48 +0000 (10:40 -0800)]
addons: vrf: fix link-down yes on vrf slaves

because of a typo (use of wrong object) we weren't looking at the correct
ifaceobj for LINK_DOWN lookup. In some cases we didn't honor link-down yes
on VRF slaves

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
5 years agoaddons: vxlan: if device exists check that it's a vxlan (link_kind)
Julien Fortin [Tue, 4 Dec 2018 23:54:05 +0000 (15:54 -0800)]
addons: vxlan: if device exists check that it's a vxlan (link_kind)

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