]> git.proxmox.com Git - mirror_ifupdown2.git/log
mirror_ifupdown2.git
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>
5 years agoaddons: ethtool: FEC: translate None and NotSupported values to link-fec off
Julien Fortin [Sat, 1 Dec 2018 01:16:01 +0000 (17:16 -0800)]
addons: ethtool: FEC: translate None and NotSupported values to link-fec off

$ /sbin/ethtool --show-fec swp42
FEC parameters for swp42:
FEC encodings   : None
$ ifquery swp42
auto swp42
iface swp42
      link-fec off

$ ifreload -av |& grep ethtool
info: executing /sbin/ethtool swp42
info: executing /sbin/ethtool --show-fec swp42
$

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
5 years agonlmanager: use strerror to deal with kernel error
Julien Fortin [Fri, 30 Nov 2018 01:14:35 +0000 (17:14 -0800)]
nlmanager: use strerror to deal with kernel error

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
5 years agoifupdownaddons: LinkUtils: bridge vlan show: add support for new iproute2 format
Julien Fortin [Thu, 29 Nov 2018 08:27:02 +0000 (00:27 -0800)]
ifupdownaddons: LinkUtils: bridge vlan show: add support for new iproute2 format

A newer iproute2 version changed the bridge vlan show output, ifupdown2 relies
on the previous format, we have the convert  data into old format:

{
   "vx-1002": [{
        "vlan": 1002,
        "flags": ["PVID", "Egress Untagged"]
    }],
    "vx-1004": [{
        "vlan": 1004,
        "flags": ["PVID", "Egress Untagged"]
    }]
 }

auto bridge
iface bridge
        bridge-vlan-aware yes
        bridge-ports vx-1000 vx-1001 vx-1002 vx-1003 vx-1004 hostbond3 hostbond4
        bridge-stp on
        bridge-vids 1000-1004
        bridge-pvid 1

auto vx-1002
iface vx-1002
        vxlan-id 1002
        bridge-access 1002
        vxlan-local-tunnelip 27.0.0.15
        bridge-learning off
        bridge-arp-nd-suppress on
        mstpctl-portbpdufilter yes
        mstpctl-bpduguard yes
        mtu 9152

auto hostbond4
iface hostbond4
        bond-slaves swp2 swp3
        bond-mode 802.3ad
        bond-min-links 1
        bond-lacp-rate 1
        mtu 9152
        alias Local Node/s TORS1 and Ports swp32s2 swp32s3 <==> Remote  Node/s HOSTS12 and Ports swp1 swp2
        bridge-pvid 1001

auto swp3
iface swp3
        link-speed 10000
        link-duplex full
        link-autoneg off

auto swp2
iface swp2
        link-speed 10000
        link-duplex full
        link-autoneg off

auto vx-1004
iface vx-1004
        vxlan-id 1004
        bridge-access 1004
        vxlan-local-tunnelip 27.0.0.15
        bridge-learning off
        bridge-arp-nd-suppress on
        mstpctl-portbpdufilter yes
        mstpctl-bpduguard yes
        mtu 9152

auto vx-1003
iface vx-1003
        vxlan-id 1003
        bridge-access 1003
        vxlan-local-tunnelip 27.0.0.15
        bridge-learning off
        bridge-arp-nd-suppress on
        mstpctl-portbpdufilter yes
        mstpctl-bpduguard yes
        mtu 9152

auto hostbond3
iface hostbond3
        bond-slaves swp5 swp6
        bond-mode 802.3ad
        bond-min-links 1
        bond-lacp-rate 1
        mtu 9152
        alias Local Node/s TORS1 and Ports swp32s0 swp32s1 <==> Remote  Node/s HOSTS11 and Ports swp1 swp2
        bridge-pvid 1000

auto swp6
iface swp6
        link-speed 10000
        link-duplex full
        link-autoneg off

auto swp5
iface swp5
        link-speed 10000
        link-duplex full
        link-autoneg off

auto vx-1001
iface vx-1001
        vxlan-id 1001
        bridge-access 1001
        vxlan-local-tunnelip 27.0.0.15
        bridge-learning off
        bridge-arp-nd-suppress on
        mstpctl-portbpdufilter yes
        mstpctl-bpduguard yes
        mtu 9152

auto vx-1000
iface vx-1000
        vxlan-id 1000
        bridge-access 1000
        vxlan-local-tunnelip 27.0.0.15
        bridge-learning off
        bridge-arp-nd-suppress on
        mstpctl-portbpdufilter yes
        mstpctl-bpduguard yes
        mtu 9152

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
5 years agoaddons: bridge: add "None" check (string) for unsupported bridge attr on some systems
Julien Fortin [Wed, 14 Nov 2018 20:52:45 +0000 (21:52 +0100)]
addons: bridge: add "None" check (string) for unsupported bridge attr on some systems

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
5 years agoAdd python-setuptools as required preinstalled package
Rostislav Kandilarov [Mon, 12 Nov 2018 23:01:56 +0000 (01:01 +0200)]
Add python-setuptools as required preinstalled package

On some kind-of-minimalistic  Ubuntu 18.04.1 extra python package `python-setuptools` was needed in order to compile from source the final DEB.

```
dpkg-buildpackage: info: source version 1.2.1
dpkg-buildpackage: info: source changed by Julien Fortin <julien@cumulusnetworks.com>
 dpkg-source --before-build ifupdown2
dpkg-buildpackage: info: host architecture amd64
dpkg-checkbuilddeps: error: Unmet build dependencies: python-setuptools
dpkg-buildpackage: warning: build dependencies/conflicts unsatisfied; aborting
```

5 years agoaddons: vxlan: modinfo: remove vxlan-port validval
Julien Fortin [Mon, 5 Nov 2018 19:04:58 +0000 (20:04 +0100)]
addons: vxlan: modinfo: remove vxlan-port validval

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
5 years agoaddons: bridge: modinfo: bridge-portmcfl remove validrange attribute
Julien Fortin [Mon, 5 Nov 2018 19:09:09 +0000 (20:09 +0100)]
addons: bridge: modinfo: bridge-portmcfl remove validrange attribute

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
5 years agoaddons: ethtool: fec: only use and compare lowercase data
Julien Fortin [Tue, 6 Nov 2018 00:35:37 +0000 (01:35 +0100)]
addons: ethtool: fec: only use and compare lowercase data

on --show-fec ethtool seems to return fec in uppercase while
we only advertise lowercase validvals. We should only deal
and compare lowercase values for running, config and default

root@host:/home/cumulus# /sbin/ethtool --show-fec swp29
FEC parameters for swp29:
FEC encodings   : RS
root@host:/home/cumulus#

testing:
set: link-fec rs
ifup/ifreloads

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
5 years agoaddons: bond: catch exception and log.info on modprobe failure
Julien Fortin [Mon, 5 Nov 2018 19:15:09 +0000 (20:15 +0100)]
addons: bond: catch exception and log.info on modprobe failure

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
5 years agoifupdown2.conf: enable addon_scripts_support and disable addon_syntax_check
Julien Fortin [Wed, 31 Oct 2018 14:42:06 +0000 (15:42 +0100)]
ifupdown2.conf: enable addon_scripts_support and disable addon_syntax_check

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
5 years agoaddons: address: new l3_intf_default_gateway_set_onlink policy closes #54
Julien Fortin [Tue, 30 Oct 2018 10:31:11 +0000 (11:31 +0100)]
addons: address: new l3_intf_default_gateway_set_onlink policy closes #54

As shown in the following example, ifupdown1 sets the default route with the
onlink attribute. This patch will add this capability to ifupdown2 controlled
by a policy variable in the address module: "l3_intf_default_gateway_set_onlink"
default to on

[19:16:07] root:~ # cat /etc/network/interfaces
auto lo
iface lo inet loopback

auto enp0s3
iface enp0s3 inet static
      address 78.46.193.234/32
      gateway 172.31.1.1
[19:16:19] root:~ # ifup -a -v
ifup: configuring interface enp0s3=enp0s3 (inet)
...
/bin/ip addr add 78.46.193.234/255.255.255.255 broadcast 78.46.193.234   dev enp0s3 label enp0s3
/bin/ip link set dev enp0s3   up
/bin/ip route add default via 172.31.1.1  dev enp0s3 onlink
...
[19:16:21] root:~ # ip route show
default via 172.31.1.1 dev enp0s3 onlink
10.0.2.0/24 dev enp0s3 proto kernel scope link src 10.0.2.15
169.254.0.0/16 dev enp0s3 scope link metric 1000
[19:16:21] root:~ #

$ cat /etc/network/ifupdown2/policy.d/address.json
{
    "address": {
"module_globals": {
    "l3_intf_default_gateway_set_onlink": "yes"
}
    }
}
$ ifquery swp1
auto swp1
iface swp1 inet static
address 78.46.193.234/32
gateway 172.31.1.1

$ ifreload -av |& grep "route add default"
info: executing /bin/ip route add default via 172.31.1.1 proto kernel dev swp1 onlink
$
$
$ emacs -nw /etc/network/ifupdown2/policy.d/address.json
$ cat /etc/network/ifupdown2/policy.d/address.json
{
    "address": {
"module_globals": {
    "l3_intf_default_gateway_set_onlink": "no"
}
    }
}
$ ifdown -a -X eth0
$ ifreload -av |& grep "route add default"
info: executing /bin/ip route add default via 172.31.1.1 proto kernel dev swp1
$

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
5 years agodebian: changelog: update all entry to unstable distribution
Julien Fortin [Tue, 30 Oct 2018 14:46:54 +0000 (15:46 +0100)]
debian: changelog: update all entry to unstable distribution

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
5 years agodebian: changelog: 1.2.1: set RELEASED
Julien Fortin [Tue, 30 Oct 2018 13:56:29 +0000 (14:56 +0100)]
debian: changelog: 1.2.1: set RELEASED

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
5 years agoaddons: address: remplace sysctl calls with /proc/ read/write
Julien Fortin [Mon, 29 Oct 2018 13:20:19 +0000 (14:20 +0100)]
addons: address: remplace sysctl calls with /proc/ read/write

Ticket: CM-21809
Reviewed By: Roopa
Testing Done:

<% num_vlans = 2048 %>
% for i in range(2,10):
%   for j in range(2,num_vlans+2):
auto br${i}_${j}
iface br${i}_${j}
      bridge-ports swp${i}.${j}
      bridge-vlan-aware no
      bridge-stp no
      bridge-learning swp${i}.${j}=off
%   endfor
% endfor

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
5 years agodebian: changelog: update 1.2.1 entry
Julien Fortin [Tue, 30 Oct 2018 10:14:52 +0000 (11:14 +0100)]
debian: changelog: update 1.2.1 entry

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