]> git.proxmox.com Git - mirror_ifupdown2.git/log
mirror_ifupdown2.git
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>
5 years agodebian: changelog: 1.2.1: update entry date
Julien Fortin [Mon, 29 Oct 2018 11:29:31 +0000 (12:29 +0100)]
debian: changelog: 1.2.1: update entry date

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
5 years agoaddons: vxlan: attr vxlan-port: add DRYRUN check
Julien Fortin [Fri, 26 Oct 2018 16:48:49 +0000 (18:48 +0200)]
addons: vxlan: attr vxlan-port: add DRYRUN check

-n sets DRYRUN flags, when DRYRUN is set many functions return True
(like link_exists), in this case vxlanattrs is set to False because
not cached. But since link_exists=True we still try to access it like
a dictionary.

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
5 years agoaddons: address: don't reset ip addrgen on dhcp intf
Julien Fortin [Tue, 23 Oct 2018 10:15:17 +0000 (12:15 +0200)]
addons: address: don't reset ip addrgen on dhcp intf

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
5 years agoFix gretunnels
Sven Auhagen [Mon, 29 Oct 2018 05:55:25 +0000 (06:55 +0100)]
Fix gretunnels

5 years agodebian: watch: removing watch file according to debian-watch-file-in-native-package...
Julien Fortin [Mon, 22 Oct 2018 11:26:37 +0000 (13:26 +0200)]
debian: watch: removing watch file according to debian-watch-file-in-native-package (lintian warning)

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
5 years agodebian: changelog: add l3_intf_arp_accept policy to 1.2.1 entry
Julien Fortin [Mon, 22 Oct 2018 10:06:19 +0000 (12:06 +0200)]
debian: changelog: add l3_intf_arp_accept policy to 1.2.1 entry

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
5 years agoaddons: address: add l3_intf_arp_accept policy to control ARP_ACCEPT
Julien Fortin [Fri, 19 Oct 2018 15:42:24 +0000 (17:42 +0200)]
addons: address: add l3_intf_arp_accept policy to control ARP_ACCEPT

$ cat /var/lib/ifupdown2/policy.d/address.json | grep l3_intf_arp_accept
      "l3_intf_arp_accept": "0"
$ ifreload -ad |& grep arp
debug: bridge: init: arp_nd_suppress_only_on_vxlan=True
info: writing '0' to file /proc/sys/net/ipv4/conf/br0/arp_accept
$
$
$ emacs -nw /var/lib/ifupdown2/policy.d/address.json
$
$ cat /var/lib/ifupdown2/policy.d/address.json | grep l3_intf_arp_accept
      "l3_intf_arp_accept": "1"
$
$ ifreload -ad |& grep arp
debug: bridge: init: arp_nd_suppress_only_on_vxlan=True
info: writing '1' to file /proc/sys/net/ipv4/conf/br0/arp_accept
$

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
5 years agoaddons: addressvirtual: ifquery -r doesn't display link-local address
Julien Fortin [Mon, 8 Oct 2018 13:18:32 +0000 (15:18 +0200)]
addons: addressvirtual: ifquery -r doesn't display link-local address

The issue here lies with how we query the cache to get the ips addresses
configured on the macvlan. A few months ago we added support for link scope
addresses in the cache, since the kernel may add it's own link addresse to
some interfaces we need to filter them out when querying the cache (because
we just want to get the list of IPs managed by ifupdown2). To perform this
filtering we need to look at the current user configuration (/e/n/i) but we
also need to look at past configuration. To perform this filtering we need
to provide the API LinkUtils:get_running_addrs a special parameter for
address-virtual (we need an ifaceobj).

$ ifquery -a
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp

auto vlan1000
iface vlan1000
address 192.168.10.2/24
address fc00:10::2/64
address-virtual 00:00:5e:00:01:01 192.168.10.1/24 fc00:10::1/64 fe80::1/64
address-virtual-ipv6-addrgen off
vlan-id 1000
vlan-raw-device bridge
vrf blue

auto bridge
iface bridge
bridge-ports swp1

auto blue
iface blue
vrf-table auto

$ ifreload -a
$ echo $?
0
$ ifquery -a -c
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp                                                [pass]

auto vlan1000
iface vlan1000                                                      [pass]
vlan-raw-device bridge                                      [pass]
vlan-id 1000                                                [pass]
vrf blue                                                    [pass]
address 192.168.10.2/24                                     [pass]
address fc00:10::2/64                                       [pass]
address-virtual 00:00:5e:00:01:01 192.168.10.1/24 fc00:10::1/64 fe80::1/64     [pass]
address-virtual-ipv6-addrgen off                            [pass]

auto bridge
iface bridge                                                        [pass]
bridge-ports swp1                                           [pass]

auto blue
iface blue                                                          [pass]
vrf-table 1001                                              [pass]

$ ifquery -r vlan1000
auto vlan1000
iface vlan1000
vlan-id 1000
vlan-protocol 802.1Q
vlan-raw-device bridge
address 192.168.10.2/24
address fc00:10::2/64
address-virtual 00:00:5e:00:01:01 192.168.10.1/24 fe80::1/64 fc00:10::1/64
address-virtual-ipv6-addrgen off

$

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
5 years agoadodns: bridge: bridge-[port]mcrouter enhance modinfo helper
Julien Fortin [Fri, 12 Oct 2018 12:29:24 +0000 (14:29 +0200)]
adodns: bridge: bridge-[port]mcrouter enhance modinfo helper

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
5 years agoaddons: vxlan: fix vxlan-port example type
Julien Fortin [Fri, 12 Oct 2018 11:59:47 +0000 (13:59 +0200)]
addons: vxlan: fix vxlan-port example type

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
5 years agoaddons: address: up_ipv6_addrgen: add PERFMODE check
Julien Fortin [Thu, 11 Oct 2018 01:12:43 +0000 (03:12 +0200)]
addons: address: up_ipv6_addrgen: add PERFMODE check

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
5 years agonlpacket:: add family string (AF_*) to debug dump
Julien Fortin [Tue, 9 Oct 2018 14:06:24 +0000 (16:06 +0200)]
nlpacket:: add family string (AF_*) to debug dump

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
5 years agonlpacket:: add netconf support (RTM_GETNETCONF/RTM_NEWNETCONF)
Julien Fortin [Wed, 29 Aug 2018 15:21:54 +0000 (17:21 +0200)]
nlpacket:: add netconf support (RTM_GETNETCONF/RTM_NEWNETCONF)

$ cd python-nlmanager/examples
$ ./netconf_show.py
    2018-06-01 16:59:02,398   DEBUG: TXed RTM_GETNETCONF, length 32, seq 1, pid 14202, flags 0x0 ()

      Netlink Header
       1: 0x20000000   ...  Length 0x00000020 (32)
       2: 0x52000503  R...  Type 0x0052 (82 - RTM_GETNETCONF), Flags 0x0305 (NLM_F_REQUEST, NLM_F_ACK, NLM_F_DUMP)
       3: 0x01000000  ....  Sequence Number 0x00000001 (1)
       4: 0x7a370000  z7..  Process ID 0x0000377a (14202)
      Service Header
       5: 0x00000000  ....  Family 0x00 (0), Device Type 0x0000 (0 - ARPHRD_NETROM)
       6: 0x00000000  ....  Interface Index 0x00000000 (0)
       7: 0x00000000  ....  Device Flags 0x00000000 ()
       8: 0x00000000  ....  Change Mask 0x00000000
      Attributes

    Attributes Summary
    {}

    2018-06-01 16:59:02,401   DEBUG: RXed RTM_NEWNETCONF, length 68, seq 1, pid 14202, flags 0x2

      Netlink Header
       1: 0x44000000  D...  Length 0x00000044 (68)
       2: 0x50000200  P...  Type 0x0050 (80 - RTM_NEWNETCONF), Flags 0x0002 (NLM_F_MULTI)
       3: 0x01000000  ....  Sequence Number 0x00000001 (1)
       4: 0x7a370000  z7..  Process ID 0x0000377a (14202)
      Service Header
       1: 0x00000002  ....  Family 0x02 (2)
      Attributes
       5: 0x08000100  ....  Length 0x0008 (8), Type 0x0001 (1) NETCONFA_IFINDEX
       6: 0x01000000  ....  1
       7: 0x08000200  ....  Length 0x0008 (8), Type 0x0002 (2) NETCONFA_FORWARDING
       8: 0x01000000  ....  1
       9: 0x08000300  ....  Length 0x0008 (8), Type 0x0003 (3) NETCONFA_RP_FILTER
      10: 0x00000000  ....  0
      11: 0x08000400  ....  Length 0x0008 (8), Type 0x0004 (4) NETCONFA_MC_FORWARDING
      12: 0x00000000  ....  0
      13: 0x08000500  ....  Length 0x0008 (8), Type 0x0005 (5) NETCONFA_PROXY_NEIGH
      14: 0x00000000  ....  0
      15: 0x08000600  ....  Length 0x0008 (8), Type 0x0006 (6) NETCONFA_IGNORE_ROUTES_WITH_LINKDOWN
      16: 0x01000000  ....  1

    Attributes Summary
    {'( 1) NETCONFA_IFINDEX': 1,
     '( 2) NETCONFA_FORWARDING': 1,
     '( 3) NETCONFA_RP_FILTER': 0,
     '( 4) NETCONFA_MC_FORWARDING': 0,
     '( 5) NETCONFA_PROXY_NEIGH': 0,
     '( 6) NETCONFA_IGNORE_ROUTES_WITH_LINKDOWN': 1}

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
5 years agoaddons: bridge: read bridge multicast_v4_queriers from sysfs
Julien Fortin [Tue, 2 Oct 2018 16:43:50 +0000 (18:43 +0200)]
addons: bridge: read bridge multicast_v4_queriers from sysfs

➜  ~ ifquery -a
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp

auto br0
iface br0
      bridge-ports swp2
      bridge-mcqv4src 100=172.16.100.1 101=172.16.101.1

➜  ~ ifup br0 -v
...
info: executing /sbin/brctl showmcqv4src br0
info: executing /sbin/brctl setmcqv4src br0 100 172.16.100.1
info: executing /sbin/brctl setmcqv4src br0 101 172.16.101.1
...
➜  ~ ifquery br0 -c
auto br0
iface br0                                                           [pass]
      bridge-ports swp2                                           [pass]
      bridge-mcqv4src 100=172.16.100.1 101=172.16.101.1           [pass]

➜  ~

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
5 years agoman: ifquery: fix conflicting documentation about ifquery -i flag
Julien Fortin [Mon, 1 Oct 2018 14:28:27 +0000 (16:28 +0200)]
man: ifquery: fix conflicting documentation about ifquery -i flag

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
5 years agoaddon: ethtool: link-speed: add 10 to valid values array
Julien Fortin [Mon, 1 Oct 2018 14:23:49 +0000 (16:23 +0200)]
addon: ethtool: link-speed: add 10 to valid values array

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
5 years agodebian: changelog: add link-fec changelog entry (release 1.2.1)
Julien Fortin [Tue, 9 Oct 2018 19:31:44 +0000 (21:31 +0200)]
debian: changelog: add link-fec changelog entry (release 1.2.1)

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
5 years agoREADME: update deb version (1.2.1)
Julien Fortin [Tue, 9 Oct 2018 15:38:40 +0000 (17:38 +0200)]
README: update deb version (1.2.1)

5 years agoaddons: bridge: add "none" to the bridge-ports validvals (closes #75)
Julien Fortin [Mon, 24 Sep 2018 15:59:14 +0000 (17:59 +0200)]
addons: bridge: add "none" to the bridge-ports validvals (closes #75)

--syntax-check was failing because "none" was missing in the validvals list for bridge-ports
closes #75

Reported-by: Alexandre Derumier <aderumier@odiso.com>
5 years agoREADME: update dependency list: fakeroot, build-essential
Julien Fortin [Mon, 24 Sep 2018 08:10:06 +0000 (10:10 +0200)]
README: update dependency list: fakeroot, build-essential

5 years agoREADME: update build dependency list
Julien Fortin [Mon, 24 Sep 2018 08:06:30 +0000 (10:06 +0200)]
README: update build dependency list

build dependency line was missing 'devscripts'

5 years agoaddons: ethtool: fix indentation error for link-fec attr
Anton Lindström [Sun, 9 Sep 2018 17:28:31 +0000 (19:28 +0200)]
addons: ethtool: fix indentation error for link-fec attr

Signed-off-by: Anton Lindström <carlantonlindstrom@gmail.com>
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
5 years agodebian: changelog: update changelog for release 1.2.1
Julien Fortin [Sun, 2 Sep 2018 16:38:01 +0000 (18:38 +0200)]
debian: changelog: update changelog for release 1.2.1

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
5 years agoaddons: vrf: fix link-down yes on vrf throws an exception
Julien Fortin [Mon, 20 Aug 2018 07:15:32 +0000 (09:15 +0200)]
addons: vrf: fix link-down yes on vrf throws an exception

before the patch we can see that ifreload is displaying an error
with the example config

$ ifquery -a
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp

auto swp1
iface swp1
      vrf blue
         link-down yes

auto blue
iface blue
      vrf-table auto

$ ifreload -a
error: eth0: vrf blue not around, skipping vrf config
$ echo $?
1
$

$ # applying patch
$ ifreload -a
$ echo $?
0

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
5 years agoaddons: bridge: ports l2protocol tunnel: fix TypeError exception
Julien Fortin [Thu, 16 Aug 2018 10:31:36 +0000 (12:31 +0200)]
addons: bridge: ports l2protocol tunnel: fix TypeError exception

ifquery may fail on the following exception:

File "/usr/share/ifupdown2/addons/bridge.py", line 709, in _query_check_l2protocol_tunnel_lldp
     return ifla_brport_group_mask & 0x4000
 TypeError: unsupported operand type(s) for &: 'NoneType' and 'int'

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
5 years agoifupdownaddons: mstpctlutils: cache empty 'showportdetail' results
Julien Fortin [Tue, 14 Aug 2018 16:49:39 +0000 (18:49 +0200)]
ifupdownaddons: mstpctlutils: cache empty 'showportdetail' results

mstpctl might return an empty result on: mstpctl showportdetail bridge json
the cache is not filled with an empty dict so next cache lookup will be a
cache miss and therefore, ifupdown2 thinks we need to fill the cache with fresh
data and will execute showportdetail again (resulting in calling mstpctl cmd
sometime 5 or 6 times in a row).

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
5 years agoaddons: vlan: for ip link del use netlink rather than iproute2
Julien Fortin [Tue, 14 Aug 2018 16:48:58 +0000 (18:48 +0200)]
addons: vlan: for ip link del use netlink rather than iproute2

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
5 years agoaddons: vlan: add vlan-raw-device add missing user config check
Julien Fortin [Fri, 10 Aug 2018 14:09:28 +0000 (16:09 +0200)]
addons: vlan: add vlan-raw-device add missing user config check

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
5 years agoaddons: vlan: raw-device: check if cache value is valid before more checks
Julien Fortin [Fri, 10 Aug 2018 09:40:47 +0000 (11:40 +0200)]
addons: vlan: raw-device: check if cache value is valid before more checks

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
5 years agoLinkUtils: addrgen: move disable_ipv6 check before MTU check
Julien Fortin [Fri, 10 Aug 2018 09:37:41 +0000 (11:37 +0200)]
LinkUtils: addrgen: move disable_ipv6 check before MTU check

if disable_ipv6 is on there's no need to check for the MTU

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
5 years agoaddons: vlan: error out when vlan-raw-device config change on existing vlan
Julien Fortin [Thu, 9 Aug 2018 13:46:16 +0000 (15:46 +0200)]
addons: vlan: error out when vlan-raw-device config change on existing vlan

kernel doesn't support vlan raw-device change on existing vlan, user needs to
manually ifdown/ifup the device

[13:45:06] root:~ # ifquery vlan42
auto vlan42
iface vlan42
      address 42.42.42.42/24
      vlan-id 42
      vlan-raw-device swp1

[13:45:07] root:~ # ifup -a
[13:45:09] root:~ # echo $?
0
[13:45:10] root:~ # ip link show vlan42
34: vlan42@swp1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DEFAULT group default
    link/ether 90:e2:ba:2c:b1:96 brd ff:ff:ff:ff:ff:ff
[13:45:13] root:~ # nano /etc/network/interfaces
[13:45:19] root:~ # ifquery vlan42
auto vlan42
iface vlan42
      address 42.42.42.42/24
      vlan-id 42
      vlan-raw-device swp2

[13:45:25] root:~ # ifreload -a
error: vlan42: cannot change vlan-raw-device from swp1 to swp2: operation not supported. Please delete the device with 'ifdown vlan42' and recreate it to apply the change.
[13:45:27] root:~ # echo $?
1
[13:45:30] root:~ #

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
5 years agoLinkUtils: check device MTU and /proc/../disable_ipv6 before setting ipv6-addrgen
Julien Fortin [Thu, 9 Aug 2018 11:19:08 +0000 (13:19 +0200)]
LinkUtils: check device MTU and /proc/../disable_ipv6 before setting ipv6-addrgen

The minimum IPv6 MTU (ipv6 stack should handle at minmum this size)
is 1280 bytes. If you set the MTU below that then you can't really
have ipv6 addrconf follows the MTU changes and if it sees change
below 1280 then it disables ipv6 on the iface

$ ifquery swp1
auto swp1
iface swp1
      mtu 420

$ ifreload -a
error: swp1: cmd '/bin/ip -force -batch - [link set dev swp1 down
link set dev swp1 addrgenmode eui64
link set dev swp1 up
]' failed: returned 1 (RTNETLINK answers: Address family not supported by protocol
Command failed -:2
)

Reviewed-by: Roopa Prabhu <roopa@cumulusnetworks.com>
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
5 years agoREADME: update build instruction to switch to maste-next branch
Julien Fortin [Wed, 1 Aug 2018 09:30:28 +0000 (11:30 +0200)]
README: update build instruction to switch to maste-next branch

The building instruction didn't mention that users should checkout the master-next branch and build from it. This branch contains the lastest ifupdown2 version

5 years agoREADME: remove rst2man from dependency list
Julien Fortin [Wed, 1 Aug 2018 09:24:09 +0000 (11:24 +0200)]
README: remove rst2man from dependency list

5 years agodebian: changelog: add ip[6]-forward entry for new validvals
Julien Fortin [Mon, 30 Jul 2018 12:42:01 +0000 (14:42 +0200)]
debian: changelog: add ip[6]-forward entry for new validvals

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
5 years agoaddons: addressvirtual: address-virtual-ipv6-addrgen reset to default if removed...
Julien Fortin [Mon, 23 Jul 2018 08:38:29 +0000 (10:38 +0200)]
addons: addressvirtual: address-virtual-ipv6-addrgen reset to default if removed from stanza

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

[8:39:13] root:~ # ifquery vlan1000
auto vlan1000
iface vlan1000
      address 192.168.10.1/24
      address fc00:10::1/64
      address-virtual 00:00:5e:00:01:01 192.168.10.1/24 fc00:10::1/64 fe80::1/64
      address-virtual-ipv6-addrgen off
      vlan-id 1000
      vlan-raw-device bridge

[8:39:18] root:~ # nano /etc/network/interfaces
[8:39:24] root:~ # ifquery vlan1000
auto vlan1000
iface vlan1000
      address 192.168.10.1/24
      address fc00:10::1/64
      address-virtual 00:00:5e:00:01:01 192.168.10.1/24 fc00:10::1/64 fe80::1/64
      vlan-id 1000
      vlan-raw-device bridge

[8:39:27] root:~ # ifreload -a -v |& grep addrgenmode
link set dev vlan1000-v0 addrgenmode eui64
[8:39:34] root:~ #

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
5 years agoaddons: address: add yes, no, 1, 0 as valid values
Roopa Prabhu [Sun, 15 Jul 2018 04:54:48 +0000 (21:54 -0700)]
addons: address: add yes, no, 1, 0 as valid values

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
5 years agoaddons: address: fix ifquery-check for ip(6)-forward 0/1 values
Julien Fortin [Mon, 16 Jul 2018 11:03:47 +0000 (13:03 +0200)]
addons: address: fix ifquery-check for ip(6)-forward 0/1 values

[18:18:12] root:~ # ifquery swp1
auto swp1
iface swp1
ip-forward 0
ip6-forward 0

[18:18:15] root:~ #
[18:18:16] root:~ # ifup swp1
[18:18:22] root:~ # echo $?
0
[18:18:23] root:~ # ifquery swp1 -c
auto swp1
iface swp1                                                          [pass]
ip-forward off                                              [pass]
ip6-forward off                                             [pass]

[18:18:27] root:~ #

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
5 years agoipv6-addrgen: add ifquery check/running/ifreload support using netlink cache
Julien Fortin [Mon, 9 Jul 2018 22:18:39 +0000 (00:18 +0200)]
ipv6-addrgen: add ifquery check/running/ifreload support using netlink cache

[13:09:20] root:~ # ifquery -a
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp

auto vlan1903
iface vlan1903
vlan-id 1903
vlan-raw-device bridge
ipv6-addrgen no
address-virtual-ipv6-addrgen no
address-virtual 00:00:5e:00:01:a3 2a06:c01:1:1903::1/64 fe80::1/64 185.98.123.1/24

auto bridge
iface bridge
bridge-ports swp1

[13:09:25] root:~ # ifup -a -v
info: loading builtin modules from ['/usr/share/ifupdown2/addons']
info: executing /var/lib/ifupdown2/hooks/get_reserved_vlan_range.sh
info: executing /sbin/sysctl net.bridge.bridge-allow-multiple-vlans
info: executing /bin/pidof mstpd
info: executing /bin/ip rule show
info: executing /bin/ip -6 rule show
info: address: using default mtu 1500
info: 'link_master_slave' is set. slave admin state changes will be delayed till the masters admin state change.
info: processing interfaces file /etc/network/interfaces
info: lo: running ops ...
info: netlink: ip link show
info: netlink: ip addr show
info: executing /bin/ip addr help
info: address metric support: KO
info: lo: netlink: ip link set dev lo up
info: reading '/proc/sys/net/mpls/conf/lo/input'
info: reading '/proc/sys/net/ipv4/conf/lo/forwarding'
info: reading '/proc/sys/net/ipv6/conf/lo/forwarding'
info: reading '/proc/sys/net/ipv4/conf/lo/accept_local'
info: executing /bin/systemctl is-enabled vxrd.service
info: eth0: running ops ...
info: executing /sbin/ethtool eth0
info: reading '/sys/class/net/eth0/speed'
info: reading '/sys/class/net/eth0/duplex'
info: eth0: netlink: ip link set dev eth0 up
info: dhclient4 already running on eth0. Not restarting.
info: reading '/proc/sys/net/mpls/conf/eth0/input'
info: reading '/proc/sys/net/ipv4/conf/eth0/forwarding'
info: reading '/proc/sys/net/ipv6/conf/eth0/forwarding'
info: reading '/proc/sys/net/ipv4/conf/eth0/accept_local'
info: swp1: running ops ...
info: executing /sbin/ethtool swp1
info: reading '/sys/class/net/swp1/speed'
info: reading '/sys/class/net/swp1/duplex'
info: executing /sbin/ethtool -s swp1  speed 1000 duplex full
info: reading '/proc/sys/net/mpls/conf/swp1/input'
info: reading '/proc/sys/net/ipv4/conf/swp1/accept_local'
info: bridge: running ops ...
info: bridge: netlink: ip link add bridge type bridge
info: bridge: apply bridge settings
info: bridge: set bridge-ageing 1800
info: bridge: set bridge-hashel 4096
info: bridge: set bridge-hashmax 4096
info: bridge: set bridge-mcstats on
info: reading '/sys/class/net/bridge/bridge/stp_state'
info: bridge: stp state reset, reapplying port settings
info: bridge: netlink: ip link set bridge type bridge with attributes
info: writing '1' to file /proc/sys/net/ipv6/conf/swp1/disable_ipv6
info: executing /bin/ip -force -batch - [link set dev swp1 master bridge
addr flush dev swp1
]
info: bridge: applying bridge port configuration: ['swp1']
info: bridge: swp1: set bridge-portprios 8
info: swp1: netlink: ip link set dev swp1: bridge slave attributes
info: executing /sbin/brctl showmcqv4src bridge
info: bridge: applying bridge configuration specific to ports
info: bridge: processing bridge config for port swp1
info: swp1: netlink: ip link set dev swp1 up
info: bridge: setting bridge mac to port swp1 mac
info: executing /bin/ip link set dev bridge address 90:e2:ba:2c:b1:96
info: executing /sbin/mstpctl showportdetail bridge json
info: executing /sbin/mstpctl showbridge json bridge
info: bridge: applying mstp configuration specific to ports
info: bridge: processing mstp config for port swp1
info: bridge: netlink: ip link set dev bridge up
info: reading '/proc/sys/net/mpls/conf/bridge/input'
info: executing /sbin/sysctl net.ipv4.conf.bridge.forwarding
info: executing /sbin/sysctl net.ipv6.conf.bridge.forwarding
info: executing /bin/ip -force -batch - [link set dev bridge down
link set dev bridge addrgenmode eui64
link set dev bridge up
]
info: reading '/proc/sys/net/ipv4/conf/bridge/accept_local'
info: vlan1903: running ops ...
info: vlan1903: netlink: ip link add link bridge name vlan1903 type vlan id 1903 protocol 802.1q
info: vlan1903: netlink: ip link set dev vlan1903 up
info: reading '/proc/sys/net/mpls/conf/vlan1903/input'
info: reading '/proc/sys/net/ipv4/conf/vlan1903/forwarding'
info: reading '/proc/sys/net/ipv6/conf/vlan1903/forwarding'
info: executing /bin/ip -force -batch - [link set dev vlan1903 down
link set dev vlan1903 addrgenmode none
link set dev vlan1903 up
]
info: vlan1903: netlink: ip link add link vlan1903 name vlan1903-v0 type macvlan mode private
info: executing /sbin/sysctl net.ipv6.conf.vlan1903-v0.accept_dad
info: executing /sbin/sysctl net.ipv6.conf.vlan1903-v0.accept_dad=0
info: executing /sbin/sysctl net.ipv6.conf.vlan1903-v0.dad_transmits
info: executing /sbin/sysctl net.ipv6.conf.vlan1903-v0.dad_transmits=0
info: executing /bin/ip -force -batch - [link set dev vlan1903-v0 addrgenmode none
link set dev vlan1903-v0 down
link set dev vlan1903-v0 address 00:00:5e:00:01:a3
link set dev vlan1903-v0 up
addr add 2a06:c01:1:1903::1/64 dev vlan1903-v0
addr add fe80::1/64 dev vlan1903-v0
addr add 185.98.123.1/24 dev vlan1903-v0
route del 2a06:c01:1:1903::/64 dev vlan1903-v0
route del fe80::/64 dev vlan1903-v0
route add 2a06:c01:1:1903::/64 dev vlan1903-v0 proto kernel metric 9999
route add fe80::/64 dev vlan1903-v0 proto kernel metric 9999
]
info: reading '/proc/sys/net/ipv4/conf/vlan1903/accept_local'
[13:09:29] root:~ #
[13:09:30] root:~ #
[13:09:30] root:~ # ifquery -a -c
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp                                                [pass]

auto vlan1903
iface vlan1903                                                      [pass]
vlan-raw-device bridge                                      [pass]
vlan-id 1903                                                [pass]
ipv6-addrgen no                                             [pass]
address-virtual 00:00:5e:00:01:a3 2a06:c01:1:1903::1/64 fe80::1/64 185.98.123.1/24     [pass]
address-virtual-ipv6-addrgen no                             [pass]

auto bridge
iface bridge                                                        [pass]
bridge-ports swp1                                           [pass]

[13:09:33] root:~ #
[13:09:35] root:~ #
[13:09:35] root:~ # ifquery -a -r
auto vlan1903-v0
iface vlan1903-v0
ipv6-addrgen off
address 185.98.123.1/24
address 2a06:c01:1:1903::1/64

auto vlan1903
iface vlan1903
vlan-id 1903
vlan-protocol 802.1Q
vlan-raw-device bridge
ipv6-addrgen off
address-virtual 00:00:5e:00:01:a3 185.98.123.1/242a06:c01:1:1903::1/64
address-virtual-ipv6-addrgen off

auto bridge
iface bridge
bridge-vlan-stats off
bridge-mcstats 1
bridge-ports swp1
bridge-stp yes
mstpctl-portp2p  swp1=auto
mstpctl-treeportcost  swp1=20000
mstpctl-portautoedge  swp1=yes

auto swp1
iface swp1

auto eth0
iface eth0 inet dhcp

auto lo
iface lo inet loopback
mtu 65536

[13:09:38] root:~ # ip -d link show vlan1903
20: vlan1903@bridge: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DEFAULT group default
    link/ether 90:e2:ba:2c:b1:96 brd ff:ff:ff:ff:ff:ff promiscuity 1
    vlan protocol 802.1Q id 1903 <REORDER_HDR> addrgenmode none
[13:09:50] root:~ # ip -d link show vlan1903-v0
21: vlan1903-v0@vlan1903: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DEFAULT group default
    link/ether 00:00:5e:00:01:a3 brd ff:ff:ff:ff:ff:ff promiscuity 0
    macvlan  mode private addrgenmode none
[13:09:53] root:~ #
[13:09:56] root:~ # ip link set dev vlan1903-v0 addrgenmode eui64
[13:10:23] root:~ # ifquery -a -c
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp                                                [pass]

auto vlan1903
iface vlan1903                                                      [fail]
vlan-raw-device bridge                                      [pass]
vlan-id 1903                                                [pass]
ipv6-addrgen no                                             [pass]
address-virtual 00:00:5e:00:01:a3 2a06:c01:1:1903::1/64 fe80::1/64 185.98.123.1/24     [pass]
address-virtual-ipv6-addrgen no                             [fail]

auto bridge
iface bridge                                                        [pass]
bridge-ports swp1                                           [pass]

[13:10:29] root:~ # ifquery -a -r
auto vlan1903-v0
iface vlan1903-v0
address 185.98.123.1/24
address 2a06:c01:1:1903::1/64

auto vlan1903
iface vlan1903
vlan-id 1903
vlan-protocol 802.1Q
vlan-raw-device bridge
ipv6-addrgen off
address-virtual 00:00:5e:00:01:a3 185.98.123.1/242a06:c01:1:1903::1/64
address-virtual-ipv6-addrgen on

auto bridge
iface bridge
bridge-vlan-stats off
bridge-mcstats 1
bridge-ports swp1
bridge-stp yes
mstpctl-portp2p  swp1=auto
mstpctl-treeportcost  swp1=20000
mstpctl-portautoedge  swp1=yes

auto swp1
iface swp1

auto eth0
iface eth0 inet dhcp

auto lo
iface lo inet loopback
mtu 65536

[13:10:33] root:~ #

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
5 years agonlpacket: add decode support for IFLA_AF_SPEC (AF_UNSPEC) family - inet6 attributes
Julien Fortin [Mon, 9 Jul 2018 22:14:06 +0000 (00:14 +0200)]
nlpacket: add decode support for IFLA_AF_SPEC (AF_UNSPEC) family - inet6 attributes

This patch mostly adds support for IFLA_INET6_ADDR_GEN_MODE
nlmanager doesn't support multiple kernel version all the
other attributes like IFLA_INET6_CONF are based on DEVCONF_MAX
from _UAPI_IPV6_H.

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
5 years agoaddons: addressvirtual: flush macvlan addr cache when setting addrgenmode
Julien Fortin [Mon, 9 Jul 2018 10:10:17 +0000 (12:10 +0200)]
addons: addressvirtual: flush macvlan addr cache when setting addrgenmode

When setting addrgenmode it is necessary to flap the macvlan
device. After flapping the device we also need to re-add all
the user configuration. The best way to add the user config
is to flush our internal address cache.

[10:12:10] root:~ # ifquery vlan1000
auto vlan1000
iface vlan1000
address 192.168.10.1/24
address fc00:10::1/64
address-virtual 00:00:5e:00:01:01 192.168.10.1/24 fc00:10::1/64 fe80::1/64
vlan-id 1000
vlan-raw-device bridge

[10:12:15] root:~ # ifup -a
[10:12:24] root:~ # echo $?
0
[10:12:26] root:~ # ifquery vlan1000 -c
auto vlan1000
iface vlan1000                                                      [pass]
vlan-raw-device bridge                                      [pass]
vlan-id 1000                                                [pass]
address 192.168.10.1/24                                     [pass]
address fc00:10::1/64                                       [pass]
address-virtual 00:00:5e:00:01:01 192.168.10.1/24 fc00:10::1/64 fe80::1/64     [pass]

[10:12:30] root:~ # ip -6 -o addr show vlan1000-v0
48: vlan1000-v0    inet6 fc00:10::1/64 scope global \       valid_lft forever preferred_lft forever
48: vlan1000-v0    inet6 fe80::200:5eff:fe00:101/64 scope link \       valid_lft forever preferred_lft forever
48: vlan1000-v0    inet6 fe80::1/64 scope link \       valid_lft forever preferred_lft forever
[10:12:33] root:~ #
[10:12:34] root:~ #
[10:12:34] root:~ # ifquery vlan1000
auto vlan1000
iface vlan1000
address 192.168.10.1/24
address fc00:10::1/64
address-virtual 00:00:5e:00:01:01 192.168.10.1/24 fc00:10::1/64 fe80::1/64
address-virtual-ipv6-addrgen off
vlan-id 1000
vlan-raw-device bridge

[10:12:39] root:~ #
[10:12:41] root:~ # ifreload -a -d
...
debug: vlan1000: up : running module addressvirtual
debug: vlan1000-v0: reset address cache <<<<<<<<<<<<<<<<<<<<<< without this reset ifupdown2 would be in a broken state
info: vlan1000: checking route entry ...
info: executing /bin/ip route get 192.168.10.0/24
info: netlink: ip link show dev vlan1000
info: netlink: ip link show dev vlan1000-v0
info: vlan1000-v0: netlink: ip link set dev vlan1000-v0 up
info: executing /bin/ip -force -batch - [link set dev vlan1000-v0 down
link set dev vlan1000-v0 addrgenmode none
link set dev vlan1000-v0 up
addr add 192.168.10.1/24 dev vlan1000-v0
addr add fc00:10::1/64 dev vlan1000-v0
addr add fe80::1/64 dev vlan1000-v0
]
...
[10:12:50] root:~ #
[10:12:51] root:~ # ip -6 -o addr show vlan1000-v0
48: vlan1000-v0    inet6 fc00:10::1/64 scope global \       valid_lft forever preferred_lft forever
48: vlan1000-v0    inet6 fe80::1/64 scope link \       valid_lft forever preferred_lft forever
[10:12:53] root:~ # ifquery vlan1000 -c
auto vlan1000
iface vlan1000                                                      [pass]
vlan-raw-device bridge                                      [pass]
vlan-id 1000                                                [pass]
address 192.168.10.1/24                                     [pass]
address fc00:10::1/64                                       [pass]
address-virtual 00:00:5e:00:01:01 192.168.10.1/24 fc00:10::1/64 fe80::1/64     [pass]

[10:13:03] root:~ # echo $?
0
[10:13:04] root:~ #

Reviewed-by: Roopa Prabhu <roopa@cumulusnetworks.com>
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
5 years agoaddons: bridge: fix check_valid_bridge for DRYRUN mode
Julien Fortin [Thu, 5 Jul 2018 15:24:16 +0000 (17:24 +0200)]
addons: bridge: fix check_valid_bridge for DRYRUN mode

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
5 years agoaddons: mstpctl: bridge vlan-unaware: check brport running config before setting...
Julien Fortin [Tue, 3 Jul 2018 16:40:05 +0000 (18:40 +0200)]
addons: mstpctl: bridge vlan-unaware: check brport running config before setting attributes

when handling mstpctl attribute on vlan-unaware bridges we don't
check the running configuration of the bridge ports (cache) thus
misconfiguring some attributes on brports.

We first create a traditional bridge with:

auto bridge1
iface bridge1
    bridge-ports swp1 swp2
    bridge-vlan-aware no
We check the setting:

$ mstpctl showportdetail bridge1 swp1 | grep edge
  admin edge port    no                      auto edge port       yes
  oper edge port     yes                     topology change ack  no
We then add the setting for swp1:

auto swp1
iface swp1
    mstpctl-portautoedge no
We then do an ifreload -adv and we see two calls. First
info: executing /sbin/mstpctl setportautoedge bridge1 swp1 no

and then a little later
info: executing /sbin/mstpctl setportautoedge bridge1 swp1 yes

Reviewed-by: Roopa Prabhu <roopa@cumulusnetworks.com>
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
5 years agoaddons: bridge: warn users if bridge attributes are used under non-bridge stanza
Julien Fortin [Wed, 27 Jun 2018 20:45:24 +0000 (23:45 +0300)]
addons: bridge: warn users if bridge attributes are used under non-bridge stanza

This check is done without too much overhead because we rarely see a stanza
with more than a handful of attributes...

$ ifquery swp1
auto swp1
iface swp1
      bridge-vlan-aware yes
      bridge-stp off

$ ifup swp1 -v
...
info: swp1: running ops ...
warning: swp1: invalid use of bridge attribute (bridge-vlan-aware) on non-bridge stanza
warning: swp1: invalid use of bridge attribute (bridge-stp) on non-bridge stanza
..
$

Reviewed-by: Roopa Prabhu <roopa@cumulusnetworks.com>
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
5 years agoaddons: bridge: if device exists - check if device is really a bridge
Julien Fortin [Tue, 3 Jul 2018 08:06:40 +0000 (10:06 +0200)]
addons: bridge: if device exists - check if device is really a bridge

[18:43:47] root:~ # ip link show swp3
5: swp3: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast state DOWN mode DEFAULT group default qlen 1000
    link/ether 08:00:27:bc:04:3c brd ff:ff:ff:ff:ff:ff
[18:43:48] root:~ #
[18:43:49] root:~ #
[18:43:50] root:~ # cat /etc/network/interfaces
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp

auto swp3
iface swp3
bridge-vlan-aware yes
[18:43:50] root:~ #
[18:43:51] root:~ #
[18:43:51] root:~ # ifup -a
warning: swp3: error getting dependent interfaces (misconfiguration of bridge attribute(s) on existing non-bridge interface (swp3))
[18:43:56] root:~ # echo $?
1
[18:43:58] root:~ #

Reviewed-by: Roopa Prabhu <roopa@cumulusnetworks.com>
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
5 years agoaddons: addressvirtual: error in VRR mac address changes exit code (1)
Julien Fortin [Mon, 2 Jul 2018 10:20:07 +0000 (12:20 +0200)]
addons: addressvirtual: error in VRR mac address changes exit code (1)

$ ifquery -a
auto bridge
iface bridge
      bridge-vlan-aware yes
      bridge-ports swp1

auto bridge.2
iface bridge.2
      address-virtual 01:01:01:02:02:02 1.10.10.10/32

$ ifup -a
error: bridge.2: Multicast bit is set in the virtual mac address '01:01:01:02:02:02'
$ echo $?
1
$

Reviewed-by: Roopa Prabhu <roopa@cumulusnetworks.com>
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
5 years agoaddons: ppp: fixes PEP8 warning
Julien Fortin [Thu, 28 Jun 2018 15:42:48 +0000 (18:42 +0300)]
addons: ppp: fixes PEP8 warning

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
5 years agodebian: changelog: 1.2.1: new entry: point-to-point protocol (ppp)
Julien Fortin [Thu, 28 Jun 2018 15:39:29 +0000 (18:39 +0300)]
debian: changelog: 1.2.1: new entry: point-to-point protocol (ppp)

New addon to create/configure ppp interfaces

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
5 years agoaddons: ppp: Add support for master-next
Sven Auhagen [Mon, 25 Jun 2018 14:22:22 +0000 (16:22 +0200)]
addons: ppp: Add support for master-next
This commit fixes the ppp addon for the new master-next branch.

5 years agonlmanager: nlpacket: update AttributeMACAddress decode comments
Julien Fortin [Wed, 27 Jun 2018 18:46:38 +0000 (21:46 +0300)]
nlmanager: nlpacket: update AttributeMACAddress decode comments

this commit adds some explanation/comments in the decode function of the
AttributeMACAddress class. Some comments are moved around and placed
in the right location.

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
5 years agoaddons: tunnel: pep8 refactoring
Julien Fortin [Wed, 27 Jun 2018 18:33:37 +0000 (21:33 +0300)]
addons: tunnel: pep8 refactoring

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
5 years agonetlink: nlpacket AttributeMACAddress
Sven Auhagen [Wed, 27 Jun 2018 05:24:21 +0000 (07:24 +0200)]
netlink: nlpacket AttributeMACAddress

This commits fixes AttributeMACAddress for GREv6.
Error message: info: netlink: link dump failed: Length of MACAddress attribute not supported: 20
Reproducible by adding a GREv6 Tunnel:

auto gre1
iface gre1 inet tunnel
    mode ip6gre
    local 2001:1000:1000:1000::123
    endpoint 2001:1000:1000:2000::123
    address 192.168.123.1/29

In netlink The IFLA_ADDRESS and IFLA_BROADCAST attributes for all interfaces has been a
6-byte MAC address. But the GRE interface uses a 4-byte IP address and GREv6 uses a 16-byte IPv6 address for this
attribute. This patch allows for decoding a 16-byte value as an IP address.

5 years agoaddons: tunnel: Add support for master-next
Sven Auhagen [Wed, 27 Jun 2018 05:18:05 +0000 (07:18 +0200)]
addons: tunnel: Add support for master-next

This commit fixes the tunnel addon for the new master-next branch.

5 years agoaddons: addressvirtual: new policy (bool): addressvirtual_with_route_metric (default...
Julien Fortin [Mon, 25 Jun 2018 14:36:26 +0000 (16:36 +0200)]
addons: addressvirtual: new policy (bool): addressvirtual_with_route_metric (default: yes)

Ifupdown2 is now setting a default metric on macvlan ips. This policy will let
users disable this new default behavior. addressvirtual_with_route_metric is
boolean policy variable.

  addressvirtual_with_route_metric: yes|no|on|off|1|0 (default to yes)

$ cat /var/lib/ifupdown2/policy.d/addressvirtual.json
{
    "addressvirtual": {
        "module_globals": {
            "addressvirtual_with_route_metric": "no"
        }
    }
}

Reviewed-by: Roopa Prabhu <roopa@cumulusnetworks.com>
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
5 years agodebian: changelog: new entry for version 1.2.1
Julien Fortin [Tue, 26 Jun 2018 21:14:22 +0000 (00:14 +0300)]
debian: changelog: new entry for version 1.2.1

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
5 years agoaddons: tunnel: complete backport by updating imports + PEP8 refactoring
Julien Fortin [Tue, 26 Jun 2018 20:59:59 +0000 (23:59 +0300)]
addons: tunnel: complete backport by updating imports + PEP8 refactoring

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
5 years agoaddons: tunnel: dependent device fix
Sven Auhagen [Fri, 13 Apr 2018 17:32:04 +0000 (19:32 +0200)]
addons: tunnel: dependent device fix

5 years agoaddons: tunnel: get_dependent_ifacenames: tunnel-physdev dependency
Sven Auhagen [Sat, 7 Apr 2018 15:29:51 +0000 (17:29 +0200)]
addons: tunnel: get_dependent_ifacenames: tunnel-physdev dependency

5 years agoaddons: tunnel: fix tunnel v4 to v6 change
Sven Auhagen [Wed, 4 Apr 2018 18:53:32 +0000 (20:53 +0200)]
addons: tunnel: fix tunnel v4 to v6 change

5 years agoaddons: tunnel: add support for vti, ip6gre, ipip6, ip6ip6, vti6 tunnels
Sven Auhagen [Wed, 4 Apr 2018 17:49:34 +0000 (19:49 +0200)]
addons: tunnel: add support for vti, ip6gre, ipip6, ip6ip6, vti6 tunnels

5 years agoaddons: tunnel: Add support for GRETAP tunnels. (#34)
Maximilian Wilhelm [Tue, 24 Oct 2017 18:42:10 +0000 (20:42 +0200)]
addons: tunnel: Add support for GRETAP tunnels. (#34)

This commit adds support to configure and check gretap tunnels. An example
  configuration could look like this:

    iface tap0 inet tunnel
        mode gretap
        local 10.132.255.3
        endpoint 10.132.255.1
        ttl 64
        mtu 1400
        tunnel-physdev eth0
        #
        address 10.10.0.1/2

  ifup will happily configure the interface (which it does even without this
  patch) and ifquery now can successfully validate the configure interface:

    cr03.in.ffho.net:~# ifquery -c tap0
    iface tap0 inet tunnel                   [[ OK ]]
        tunnel-physdev eth0                  [[ OK ]]
        endpoint 10.132.255.1                [[ OK ]]
        local 10.132.255.3                   [[ OK ]]
        mode gretap                          [[ OK ]]
        ttl 64                               [[ OK ]]
        mtu 1400                             [[ OK ]]
        address 10.10.0.1/24                 [[ OK ]]

Signed-off-by: Maximilian Wilhelm <max@sdn.clinic>
5 years agoAddons/tunnel: fix typo in validvals (#31)
kokel [Tue, 3 Oct 2017 16:48:12 +0000 (18:48 +0200)]
Addons/tunnel: fix typo in validvals (#31)

5 years agoAdd support GRE/SIT tunnels. (#20)
Maximilian Wilhelm [Sat, 28 Jan 2017 22:54:43 +0000 (23:54 +0100)]
Add support GRE/SIT tunnels. (#20)

This commit adds support for configuring GRE/IPIP/SIT tunnel interfaces as know
from previous versions of ifupdown. Currently only configuration checks for GRE
and SIT tunnels are implemented.

A tunnel interface configuration could look like this:

auto gre42
iface gre42 inet tunnel
        mode     gre
        local    198.51.100.1
        endpoint 203.0.113.2
#
# optional tunnel attributes
        ttl      64
        mtu      1400
tunnel-physdev eth0
        #
        address  192.0.2.42/31
        address  2001:db8:d0c:23::42/64

auto he-ipv6
iface he-ipv6 inet tunnel
mode sit
endpoint 203.0.113.6
local    198.51.100.66
#
# optional tunnel attributes
ttl 255
mtu 1466
tunnel-physdev vrf_external
#
address 2001:db8:666::2/64

Signed-off-by: Maximilian Wilhelm <max@rfc2324.org>
5 years agobridge: vlan-aware: add new boolean policy "vlan_aware_bridge_address_support"
Julien Fortin [Mon, 18 Jun 2018 16:44:32 +0000 (18:44 +0200)]
bridge: vlan-aware: add new boolean policy "vlan_aware_bridge_address_support"

closes #58

In linux its possible to assign a vlan-aware bridge an ip address
For some use cases is it useful to restrict users from configuring
ips on bridges VA. This patch will let admins and distributions
decide if it is necessary to warn the user in such case.

The patch introduces a new 'address' policy:

 vlan_aware_bridge_address_support: yes|no|on|off|0|1 (default to yes)

[16:46:09] root:~ # cat /var/lib/ifupdown2/policy.d/address.json
{
    "address": {
"module_globals": {
    "enable_l3_iface_forwarding_checks": "yes"
},
"defaults": {
    "mtu": "1500",
    "ip-forward": "on",
    "ip6-forward": "on"
}
    }
}
[16:46:16] root:~ # ifquery -a
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp

auto bridge
iface bridge
bridge-ports swp1
bridge-vlan-aware yes
address 10.10.10.10/32

[16:46:20] root:~ # ifup -a --syntax-check
[16:46:22] root:~ # echo $?
0
[16:46:33] root:~ # nano /var/lib/ifupdown2/policy.d/address.json
[16:46:47] root:~ # cat /var/lib/ifupdown2/policy.d/address.json
{
    "address": {
"module_globals": {
    "enable_l3_iface_forwarding_checks": "yes",
    "vlan_aware_bridge_address_support": "no"
},
"defaults": {
    "mtu": "1500",
    "ip-forward": "on",
    "ip6-forward": "on"
}
    }
}
[16:46:48] root:~ # ifup -a --syntax-check
warning: bridge: ignoring ip address. Assigning an IP address is not allowed on bridge vlan aware interfaces
[16:46:51] root:~ # echo $?
1
[16:46:52] root:~ #

Reviewed-by: Roopa Prabhu <roopa@cumulusnetworks.com>
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
5 years agoRevert "ifupdown2.conf: vlan_aware_bridge_address_support: allow ip on vlan-aware...
Julien Fortin [Mon, 25 Jun 2018 11:07:53 +0000 (13:07 +0200)]
Revert "ifupdown2.conf: vlan_aware_bridge_address_support: allow ip on vlan-aware bridge (closes #58)"

This reverts commit 3d06493205882c4485363bd63d5050c345c2fac9.

5 years agodebian: changelog: 1.2.0: new entry: metric on macvlan ip
Julien Fortin [Mon, 25 Jun 2018 10:29:43 +0000 (12:29 +0200)]
debian: changelog: 1.2.0: new entry: metric on macvlan ip

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
5 years agoaddons: vrf: add support for 'link-down yes' on VRF slaves
Julien Fortin [Thu, 21 Jun 2018 09:36:10 +0000 (11:36 +0200)]
addons: vrf: add support for 'link-down yes' on VRF slaves

$ ifquery -a
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp
vrf mgmt
link-down yes

auto mgmt
iface mgmt
vrf-table auto

$ ifup -a -d
...
...
debug: mgmt: pre-up : running module vrf
info: executing /usr/lib/vrf/vrf-helper create mgmt 1001
debug: mgmt: eth0: slave configured with link-down yes
info: mgmt: netlink: ip link set dev mgmt up
...
$ ip link show eth0
2: eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast master mgmt state DOWN mode DEFAULT group default qlen 1000
    link/ether 08:00:27:80:e2:97 brd ff:ff:ff:ff:ff:ff

Reviewed-by: Roopa Prabhu <roopa@cumulusnetworks.com>
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
5 years agoaddons: bridge: fix 'NoneType' object has no attribute 'keys' exception
Julien Fortin [Tue, 12 Jun 2018 17:22:34 +0000 (19:22 +0200)]
addons: bridge: fix 'NoneType' object has no attribute 'keys' exception

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