]> git.proxmox.com Git - mirror_ifupdown2.git/log
mirror_ifupdown2.git
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>
5 years agoaddons: bridge: support multiple bridge-port configuration lines
Julien Fortin [Tue, 12 Jun 2018 15:50:22 +0000 (17:50 +0200)]
addons: bridge: support multiple bridge-port configuration lines

Reviewed-by: Roopa Prabhu <roopa@cumulusnetworks.com>
Reviewed-by: Sam Tannous <stannous@cumulusnetworks.com>
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
5 years agoifupdownmain: run up/down on manual interfaces, but ignore any errors. (closes #48)
Julien Fortin [Wed, 20 Jun 2018 10:07:08 +0000 (12:07 +0200)]
ifupdownmain: run up/down on manual interfaces, but ignore any errors. (closes #48)

ifupdown changed its original behavior on "manual" address method:
https://salsa.debian.org/debian/ifupdown/commit/12d333d619013914aae7deafe45fb6191ff2fb2c

ifupdown2 needs to change it's behavior too.

Reported-by: Alexandre Derumier <aderumier@odiso.com>
Reviewed-by: Roopa Prabhu <roopa@cumulusnetworks.com>
Co-authored-by: Alexandre Derumier <aderumier@odiso.com>
Co-authored-by: Julien Fortin <julien@cumulusnetworks.com>
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
5 years agodebian: changelog: update/refactor changelog 1.2.0 entry
Julien Fortin [Wed, 20 Jun 2018 09:58:27 +0000 (11:58 +0200)]
debian: changelog: update/refactor changelog 1.2.0 entry

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
5 years agoifupdown2.conf: vlan_aware_bridge_address_support: allow ip on vlan-aware bridge...
Julien Fortin [Mon, 18 Jun 2018 16:44:32 +0000 (18:44 +0200)]
ifupdown2.conf: vlan_aware_bridge_address_support: allow ip on vlan-aware bridge (closes #58)

In linux its possible to assign an ip address to a vlan-aware bridge
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 configuration variable in:
    /etc/network/ifudpown2/ifupdown2.conf

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

[8:30:41] root:~ # cat /etc/network/ifupdown2/ifupdown2.conf | grep "vlan_aware_bridge_address_support"
[8:30:43] root:~ # ifquery bridge
auto bridge
iface bridge
bridge-ports swp1
bridge-vlan-aware yes
address 10.10.10.10

[8:30:46] root:~ # ifup bridge --syntax-check
[8:30:52] root:~ # echo $?
0
[8:30:54] root:~ # echo "vlan_aware_bridge_address_support=no" >> /etc/network/ifupdown2/ifupdown2.conf
[8:31:11] root:~ # ifup bridge --syntax-check
warning: bridge: ignoring ip address. Assigning an IP address is not allowed on bridge vlan aware interfaces
[8:31:14] root:~ # echo $?
1
[8:31:17] root:~ #
[8:31:20] root:~ # ifup -a
[8:31:22] root:~ # echo $?
0
[8:31:25] root:~ # ifquery bridge -c
auto bridge
iface bridge                                                        [fail]
bridge-vlan-aware yes                                       [pass]
bridge-ports swp1                                           [pass]
address 10.10.10.10                                         [fail]

[8:31:29] root:~ # ifdown bridge && ifup bridge -v |& grep "bridge vlan aware interfaces"
info: bridge: ignoring ip address. Assigning an IP address is not allowed on bridge vlan aware interfaces
[8:31:57] root:~ #

Reviewed-by: Roopa Prabhu <roopa@cumulusnetworks.com>
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
5 years agodebian: changelog: 1.2.0: new entry for ipv6-addrgen attribute
Julien Fortin [Mon, 18 Jun 2018 17:10:10 +0000 (19:10 +0200)]
debian: changelog: 1.2.0: new entry for ipv6-addrgen attribute

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
5 years agoaddons: addressvirtual: fix typo in address-virtual-ipv6-addrgen examples
Julien Fortin [Mon, 18 Jun 2018 17:28:32 +0000 (19:28 +0200)]
addons: addressvirtual: fix typo in address-virtual-ipv6-addrgen examples

typo: missing 'n' in the example field

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
5 years agoaddons: addressvirtual: if system supports addr METRIC set skip route hack
Julien Fortin [Mon, 18 Jun 2018 17:24:12 +0000 (19:24 +0200)]
addons: addressvirtual: if system supports addr METRIC set skip route hack

Now that some system support ip addr METRIC sets we dont have to do this
"fix_connected_route" hack. The hack was previously introduced to make
sure the primary address was the first in the routing table. Some events
could cause some issues like having the macvlan address first in the
routing table. In that case the macvlan needs to be flapped. This shouldn't
happen when we are able to set the address metric

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
5 years agoaddons: addressvirtual: new attribute: address-virtual-ipv6-addrgen [on|off]
Julien Fortin [Mon, 18 Jun 2018 14:51:51 +0000 (16:51 +0200)]
addons: addressvirtual: new attribute: address-virtual-ipv6-addrgen [on|off]

[14:53:46] root:~ # ifquery -a
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp

auto vlan1903
iface vlan1903
alias LAB-CUST-VMS
vlan-id 1903
vlan-raw-device bridge
address 2a06:c01:1:1903::3/64
address 185.98.123.3/24
address-virtual 00:00:5e:00:01:a3 2a06:c01:1:1903::1/64 fe80::1/64 185.98.123.1/24
vrf public

auto public
iface public
vrf-table auto

auto bridge
iface bridge
bridge-ports swp1

[14:53:47] root:~ # ifup -a
[14:53:50] root:~ # ip addr show vlan1903-v0
46: vlan1903-v0@vlan1903: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master public state UP group default
    link/ether 00:00:5e:00:01:a3 brd ff:ff:ff:ff:ff:ff
    inet 185.98.123.1/24 scope global vlan1903-v0
       valid_lft forever preferred_lft forever
    inet6 2a06:c01:1:1903::1/64 scope global
       valid_lft forever preferred_lft forever
    inet6 fe80::200:5eff:fe00:1a3/64 scope link
       valid_lft forever preferred_lft forever
    inet6 fe80::1/64 scope link
       valid_lft forever preferred_lft forever
[14:53:52] root:~ #
[14:53:54] root:~ #
[14:53:54] root:~ # nano /etc/network/interfaces
[14:53:57] root:~ # ifquery vlan1903
auto vlan1903
iface vlan1903
alias LAB-CUST-VMS
vlan-id 1903
vlan-raw-device bridge
address 2a06:c01:1:1903::3/64
address 185.98.123.3/24
address-virtual 00:00:5e:00:01:a3 2a06:c01:1:1903::1/64 fe80::1/64 185.98.123.1/24
address-virtual-ipv6-addrgen off
vrf public

[14:54:05] root:~ # ifdown -a -X eth0
[14:54:08] root:~ # ifup -a -v
...
...
info: executing /bin/ip -force -batch - [link set dev vlan1903-v0 master public
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 table 1001 dev vlan1903-v0
route del fe80::/64 table 1001 dev vlan1903-v0
route add 2a06:c01:1:1903::/64 table 1001 dev vlan1903-v0 proto kernel metric 9999
route add fe80::/64 table 1001 dev vlan1903-v0 proto kernel metric 9999
]
...
...
[14:54:14] root:~ # ip addr show vlan1903-v0
50: vlan1903-v0@vlan1903: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master public state UP group default
    link/ether 00:00:5e:00:01:a3 brd ff:ff:ff:ff:ff:ff
    inet 185.98.123.1/24 scope global vlan1903-v0
       valid_lft forever preferred_lft forever
    inet6 2a06:c01:1:1903::1/64 scope global
       valid_lft forever preferred_lft forever
    inet6 fe80::1/64 scope link
       valid_lft forever preferred_lft forever
[14:54:16] root:~ #

Reviewed-by: Roopa Prabhu <roopa@cumulusnetworks.com>
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
5 years agoaddons: address: new attribute: ipv6-addrgen [on/off]
Julien Fortin [Mon, 18 Jun 2018 16:57:20 +0000 (18:57 +0200)]
addons: address: new attribute: ipv6-addrgen [on/off]

[14:49:15] root:~ # ifquery swp2
auto swp2
iface swp2

[14:49:18] root:~ # ip addr show swp2
4: swp2: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast state DOWN group default qlen 1000
    link/ether 90:e2:ba:2c:b2:95 brd ff:ff:ff:ff:ff:ff
[14:49:20] root:~ # ifup swp2
[14:49:23] root:~ # ip addr show swp2
4: swp2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 90:e2:ba:2c:b2:95 brd ff:ff:ff:ff:ff:ff
    inet6 fe80::92e2:baff:fe2c:b295/64 scope link
       valid_lft forever preferred_lft forever
[14:49:25] root:~ #
[14:49:32] root:~ # nano /etc/network/interfaces
[14:49:34] root:~ # ifquery swp2
auto swp2
iface swp2
        ipv6-addrgen off

[14:49:41] root:~ # ifup -v swp2 |& grep addrgen
link set dev swp2 addrgenmode none
[14:49:57] root:~ # ip addr show swp2
4: swp2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 90:e2:ba:2c:b2:95 brd ff:ff:ff:ff:ff:ff
[14:50:01] root:~ #
[14:50:09] root:~ #
[14:50:09] root:~ # ifup -v swp2
info: executing /bin/ip -force -batch - [link set dev swp2 down
link set dev swp2 addrgenmode none
link set dev swp2 up
]
info: reading '/proc/sys/net/ipv4/conf/swp2/accept_local'
[14:50:13] root:~ #

Reviewed-by: Roopa Prabhu <roopa@cumulusnetworks.com>
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
5 years agobackport: "Add support for setting phys-dev for VXLAN interfaces."
Julien Fortin [Mon, 18 Jun 2018 12:19:14 +0000 (14:19 +0200)]
backport: "Add support for setting phys-dev for VXLAN interfaces."

backporting the following commit to master-next:

commit eb92e5efff776602081b8bbd2cc74462293c4b79
Author: Maximilian Wilhelm <max@rfc2324.org>
Date:   Thu Oct 6 19:22:06 2016 +0200

    Add support for setting phys-dev for VXLAN interfaces.

      Add interface configuration option »vxlan-physdev« to set »dev« attribute
            of VXLAN interfaces and a check for the running configuration.

Signed-off-by: Maximilian Wilhelm <max@rfc2324.org>
This backport also:
 - adds support for ifquery --running
 - uses the netlink cache
 - includes some pep8 fixes

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
Signed-off-by: Maximilian Wilhelm <max@rfc2324.org>
Co-authored-by: Julien Fortin <julien@cumulusnetworks.com>
Co-authored-by: Maximilian Wilhelm <max@rfc2324.org>
5 years agoaddressvirtual: address: add default metric to ip4 and ip6 (if available)
Julien Fortin [Sat, 16 Jun 2018 17:56:57 +0000 (19:56 +0200)]
addressvirtual: address: add default metric to ip4 and ip6 (if available)

Reviewed-by: Roopa Prabhu <roopa@cumulusnetworks.com>
Reviewed-by: David Ahern <dsa@cumulusnetworks.com>
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
5 years agoaddons: addressvirtual: if device is VRF slave check vrf route table
Julien Fortin [Fri, 15 Jun 2018 15:59:19 +0000 (17:59 +0200)]
addons: addressvirtual: if device is VRF slave check vrf route table

auto bridge
iface bridge
      bridge-vlan-aware yes
      bridge-ports swp2

auto bridge.2
iface bridge.2
      address 10.254.1.2/24
      address 2a03:25e0:254:1::2/64
      address-virtual 00:00:5e:00:01:01 10.254.1.1/24 2a03:25e0:254:1::1/64 fe80::1/64
      vrf blue

auto blue
iface blue
      vrf-table auto

$ ifreload -a -v
...
info: executing /bin/ip route get 10.254.1.0/24 vrf blue
...
$

Reviewed-by: Roopa Prabhu <roopa@cumulusnetworks.com>
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
5 years agodebian: changelog: change version to 1.2.0
Julien Fortin [Fri, 15 Jun 2018 15:58:26 +0000 (17:58 +0200)]
debian: changelog: change version to 1.2.0

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
5 years agonlmanager : nlpacket : IFLA_BRPORT_ARP_SUPPRESS : use 32 netlink value : (fixes #47)
Alexandre Derumier [Wed, 16 May 2018 00:16:42 +0000 (02:16 +0200)]
nlmanager : nlpacket : IFLA_BRPORT_ARP_SUPPRESS : use 32 netlink value : (fixes #47)

this has been upstreamed recently in linux kernel, with
IFLA_BRPORT_NEIGH_SUPPRESS, with 32 as netlink value.
https://www.spinics.net/lists/linux-ethernet-bridging/msg06910.html

Cumulus is using a temp 152 number in his own kernel.

This is needed for bgp evpn and anycast gateway.

auto vmbr3
iface vmbr3
        bridge_ports vxlan3
        bridge_stp off
        bridge_fd 0

auto vxlan3
iface vxlan3 inet manual
        vxlan-id 3
        vxlan-local-tunnelip 10.59.100.231
        bridge-learning off
        bridge-arp-nd-suppress on

info: reading '/sys/class/net/vmbr3/bridge/stp_state'
debug: vmbr3: evaluating port expr '['vxlan3']'
debug: _cache_get(['vxlan3', 'hwaddress']) : ['hwaddress']
debug: reading '/sys/class/net/vxlan3/address'
info: writing '1' to file /proc/sys/net/ipv6/conf/vxlan3/disable_ipv6
info: executing /bin/ip -force -batch - [link set dev vxlan3 master vmbr3
addr flush dev vxlan3
]
info: vmbr3: applying bridge port configuration: ['vxlan3']
info: vmbr3: vxlan3: set bridge-learning off
debug: (cache None)
info: vmbr3: vxlan3: set bridge-arp-nd-suppress on
debug: (cache None)
info: vmbr3: vxlan3: vxlan learning and bridge learning out of sync: set False
info: vxlan3: netlink: ip link set dev vxlan3: bridge slave attributes
debug: vxlan3: ifla_info_data {7: False}
debug: vxlan3: ifla_info_slave_data {8: False, 152: True}

5 years agoifupdown: ifupdownmain: create a copy of environment dictionary for addons scripts...
Alexandre Derumier [Mon, 14 May 2018 14:27:22 +0000 (16:27 +0200)]
ifupdown: ifupdownmain: create a copy of environment dictionary for addons scripts (fixes #49)

Today when ifupdown2 execute addons scripts we use the global environment
dictionary (os.environ) and not a copy of this dict. This corrupts the environment.

May 10 08:07:02 kvmformation1 networking[375279]: debug: vmbr101: pre-up :
 running script /etc/network/if-pre-up.d/openvswitch {'LANG': 'en_US.UTF-8',
 'ADDRFAM': '', 'IFACE': 'vmbr101', 'JOURNAL_STREAM': '9:29498964', 'SHLVL':
 '1', 'LOGICAL': 'vmbr101', 'PWD': '/', 'MODE': 'start', '**IF_TESTVARIABLE2**':
 'test', 'PHASE': 'pre-up', 'PATH': '/sbin:/bin', 'METHOD': '', '_':
 '/sbin/ifreload', 'INVOCATION_ID': '5ffcea837bc64759bd0c171b70e22cc2'}

May 10 08:07:02 kvmformation1 networking[375279]: debug: vmbr100: pre-up :
 running script /etc/network/if-pre-up.d/openvswitch {'LANG': 'en_US.UTF-8',
 'ADDRFAM': '', '**IF_OVS_TYPE**': 'OVSBridge', 'IFACE': 'vmbr100',
 'JOURNAL_STREAM': '9:29498964', 'SHLVL': '1', 'LOGICAL': 'vmbr100', 'PWD':
 '/', 'MODE': 'start', '**IF_TESTVARIABLE2**': 'test', 'PHASE': 'pre-up',
 'PATH': '/sbin:/bin', 'METHOD': '', '_': '/sbin/ifreload', 'INVOCATION_ID':
 '5ffcea837bc64759bd0c171b70e22cc2'}

May 10 08:07:02 kvmformation1 networking[375279]: debug: eno1: pre-up :
 running script /etc/network/if-pre-up.d/openvswitch {'LANG': 'en_US.UTF-8',
 'ADDRFAM': '', '**IF_OVS_TYPE**': 'OVSBridge', 'IFACE': 'eno1',
 'JOURNAL_STREAM': '9:29498964', 'SHLVL': '1', 'LOGICAL': 'eno1', 'PWD': '/',
 'MODE': 'start', '**IF_TESTVARIABLE2**': 'test', '**IF_TESTVARIABLE1**':
 'test', 'PHASE': 'pre-up', 'PATH': '/sbin:/bin', 'METHOD': '', '_':
 '/sbin/ifreload', 'INVOCATION_ID': '5ffcea837bc64759bd0c171b70e22cc2'}

May 10 08:07:02 kvmformation1 networking[375279]: debug: eno1.100: pre-up :
 running script /etc/network/if-pre-up.d/openvswitch {'LANG': 'en_US.UTF-8',
 'ADDRFAM': '', '**IF_OVS_TYPE**': 'OVSBridge', 'IFACE': 'eno1.100',
 'JOURNAL_STREAM': '9:29498964', 'SHLVL': '1', 'IF_NETMASK': '255.255.255.0',
 'IF_ADDRESS': '10.59.100.231', 'LOGICAL': 'eno1.100', 'IF_GATEWAY': '10.59.100.1',
 'PWD': '/', 'MODE': 'start', '**IF_TESTVARIABLE2**': 'test', 'IF_TESTVARIABLE1':
 'test', 'PHASE': 'pre-up', 'PATH': '/sbin:/bin', 'METHOD': '', '_':
 '/sbin/ifreload', 'INVOCATION_ID': '5ffcea837bc64759bd0c171b70e22cc2'}

5 years agorenamed: README -> README.rst
Julien Fortin [Tue, 12 Jun 2018 09:14:38 +0000 (11:14 +0200)]
renamed:    README -> README.rst

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
5 years agoifupdown2 2.0.0 release
Julien Fortin [Tue, 12 Jun 2018 09:09:47 +0000 (11:09 +0200)]
ifupdown2 2.0.0 release

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
5 years agoifupdown2 2.0.0 release
Julien Fortin [Thu, 13 Dec 2018 19:43:32 +0000 (11:43 -0800)]
ifupdown2 2.0.0 release

This is a major update coming all at once from master-next branch
master-next branch was started with --orphan option which is basically a new
branch without history.

The major changes are:
    - repackaging
    - cleanup the directory tree
    - rewritte setup.py to allow install from deb file or pypi (pip install)
    - add a Makefile to make things (like building a deb) easier
    - review all debian files

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
5 years agoMerge pull request #80 from BarbarossaTM/tunnel-fixes-master
Julien Fortin [Tue, 30 Oct 2018 11:17:56 +0000 (12:17 +0100)]
Merge pull request #80 from BarbarossaTM/tunnel-fixes-master

Tunnel fixes master

5 years agoaddons: tunnel: Make sure tunnel modes are read correctly
Maximilian Wilhelm [Mon, 29 Oct 2018 19:35:30 +0000 (20:35 +0100)]
addons: tunnel: Make sure tunnel modes are read correctly

  Latest additions added a bunch of new tunnel modes but didn't add support
  to read in these modes which breaks 'ifquery' as it falsely marks the mode
  as 'fail'.

Signed-off-by: Maximilian Wilhelm <max@sdn.clinic>
5 years agoaddons: tunnel: Fix (re)creation of tunnelsof any kind.
Maximilian Wilhelm [Mon, 29 Oct 2018 19:31:17 +0000 (20:31 +0100)]
addons: tunnel: Fix (re)creation of tunnelsof any kind.

  Create all tunnels - except gretap - with 'ip tunnel', as this supports
  most tunnel modes; create gretap tunnels with 'ip link'.

  Rework the whole concept of tunnel updates and make sure a tunnel only is
  changed - recreated - IFF the configuration has changed. In previos code
  'tunnel change' was called on every _up() call. The 'tunnel change' part
  was removed completely as it doesn't work on many occations. So IFF the
  tunnel related interface configuration has changed, the tunnel is removed
  and recreated.

  fixes #78

Signed-off-by: Maximilian Wilhelm <max@sdn.clinic>
5 years agoMerge pull request #73 from carlanton/ethtool-typo-fix
Julien Fortin [Mon, 10 Sep 2018 11:07:21 +0000 (13:07 +0200)]
Merge pull request #73 from carlanton/ethtool-typo-fix

addons: ethtool: fix indentation error for link-fec attr handling

5 years agoFix indentation error in ethtool.py
Anton Lindström [Sun, 9 Sep 2018 17:28:31 +0000 (19:28 +0200)]
Fix indentation error in ethtool.py

6 years agoMerge pull request #46 from svenauhagen/feature/ppp
Julien Fortin [Fri, 13 Apr 2018 17:38:25 +0000 (19:38 +0200)]
Merge pull request #46 from svenauhagen/feature/ppp

ppp support closes #22

6 years agodependent device fix
Sven Auhagen [Fri, 13 Apr 2018 17:32:04 +0000 (19:32 +0200)]
dependent device fix

6 years agoppp load
Sven Auhagen [Sat, 7 Apr 2018 17:22:33 +0000 (19:22 +0200)]
ppp load

6 years agodo not load ppp if not installed
Sven Auhagen [Sat, 7 Apr 2018 17:21:04 +0000 (19:21 +0200)]
do not load ppp if not installed

6 years agoexclude ppp like dhcp
Sven Auhagen [Sat, 7 Apr 2018 16:07:30 +0000 (18:07 +0200)]
exclude ppp like dhcp

6 years agotypo
Sven Auhagen [Sat, 7 Apr 2018 15:35:04 +0000 (17:35 +0200)]
typo

6 years agoppp support
Sven Auhagen [Sat, 7 Apr 2018 15:29:51 +0000 (17:29 +0200)]
ppp support

6 years agoMerge pull request #45 from svenauhagen/feature/tunnels
Julien Fortin [Fri, 6 Apr 2018 04:45:00 +0000 (16:45 +1200)]
Merge pull request #45 from svenauhagen/feature/tunnels

tunnel changes

6 years agochache error on change
Sven Auhagen [Thu, 5 Apr 2018 05:32:42 +0000 (07:32 +0200)]
chache error on change

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

6 years agoname fix
Sven Auhagen [Wed, 4 Apr 2018 18:06:48 +0000 (20:06 +0200)]
name fix

6 years agotunnel changes
Sven Auhagen [Wed, 4 Apr 2018 17:49:34 +0000 (19:49 +0200)]
tunnel changes

6 years agoaddon/batctl: lookup batctl dynamically from PATH
skorpy [Sun, 25 Feb 2018 22:35:59 +0000 (23:35 +0100)]
addon/batctl: lookup batctl dynamically from PATH

Currently it is called from /usr/sbin/batctl what makes it impossible to use in case one runs a self compiled version for example

6 years agoaddons: vrf: fix vrf slave link kind (fixes #39)
Julien Fortin [Mon, 22 Jan 2018 11:09:07 +0000 (19:09 +0800)]
addons: vrf: fix vrf slave link kind (fixes #39)

$ cat /etc/network/interfaces
auto v0
iface v0
      link-type veth
      vrf blue

auto blue
iface blue
      vrf-table auto

$ ifreload -a
$ echo $?
0
$ ifquery -a -c
auto v0
iface v0                         [pass]
      link-type veth             [pass]
      vrf blue                   [pass]

auto blue
iface blue                       [pass]
      vrf-table 1001             [pass]
$ echo $?
0

Reported-by: Maximilian Wilhelm <max@rfc2324.org>
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
6 years agoaddons: bridge: allow "bridge-ports: none" for bridges without initial ports. (#33)
Maximilian Wilhelm [Tue, 24 Oct 2017 18:58:10 +0000 (20:58 +0200)]
addons: bridge: allow "bridge-ports: none" for bridges without initial ports. (#33)

This simple patch allows the creation of bridges which should be set up
  without any ports, like a bridge for virtual machines on a hosting box.

  With this patch ifupdown2 get's a step closer to feature parity and
  compatiblity with ifupdown1.

Signed-off-by: Maximilian Wilhelm <max@sdn.clinic>
6 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>
6 years agoaddons: batman_adv: Add support for more B.A.T.M.A.N. adv. attributes. (#35)
Maximilian Wilhelm [Tue, 24 Oct 2017 18:38:32 +0000 (20:38 +0200)]
addons: batman_adv: Add support for more B.A.T.M.A.N. adv. attributes. (#35)

* addons: batman_adv: Rework B.A.T.M.A.N. adv. attribute handling.

  This commit reworks the internal handling of B.A.T.M.A.N. adv. attributes
  within the plugin. The new approach on setting and checking attributes is
  more generic and allows adding more B.A.T.M.A.N. adv. which should be set
  as attributes of an B.A.T.M.A.N. adv. interface in a simple way.

  This commit does not introduce any changes visibile to the user.

Signed-off-by: Maximilian Wilhelm <max@sdn.clinic>
* addons: batman_adv: Add support for more B.A.T.M.A.N. adv. attributes.

  This commit adds supports for setting the following optional attributes:
   * gw-mode (one of { off, client, server })
   * multicast-mode (can be 'enabled' or 'disabled')
   * distributed-arp-table (cat be 'enabled' or 'disabled')

  Example config:

  pandora:~# ifquery -c bat-foo
  iface bat-foo                                         [pass]
      batman-ifaces dummy-bat                           [pass]
      batman-ifaces-ignore-regex                        [pass]
      batman-hop-penalty 7                              [pass]
      batman-multicast-mode enabled                     [pass]
      batman-distributed-arp-table enabled              [pass]
      batman-gw-mode client                             [pass]

Signed-off-by: Maximilian Wilhelm <max@sdn.clinic>
6 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)

6 years agoaddons: address: Fix handling of 'pointopoint' attr. (#23)
Maximilian Wilhelm [Wed, 23 Aug 2017 21:11:57 +0000 (23:11 +0200)]
addons: address: Fix handling of 'pointopoint' attr. (#23)

Due to a simple logic bug the 'pointopoint' attribute was ignored when
  specifying and address as <ip/mask> and only considered when IP and mask
  where given seperately. This commit fixes this behaviour.

  When configured in ptp mode »ip addr« will show the IP address without a
  netmask which will make »ifquery -c« mark the IP as failed. The check has
  been fixed, too.

Signed-off-by: Maximilian Wilhelm <max@rfc2324.org>
6 years agosbin: ifupdown2: update ifupdown2 version number for --version option
Julien Fortin [Sun, 5 Mar 2017 17:21:35 +0000 (00:21 +0700)]
sbin: ifupdown2: update ifupdown2 version number for --version option

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
6 years agosbin: start-networking: adjust allow-hotplug behavior to ifupdown
Julien Fortin [Thu, 23 Feb 2017 09:42:34 +0000 (16:42 +0700)]
sbin: start-networking: adjust allow-hotplug behavior to ifupdown

Ticket: Bug#855598: src:ifupdown2: allow-hotplug behaves differently, not UPing interfaces
Reviewed By: Roopa
Testing Done: mark an interface (ethX) as hotplug then reboot

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
6 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>
6 years agocloses: #810844: debian: control: Unlisted dependencies
Julien Fortin [Thu, 22 Dec 2016 13:01:52 +0000 (14:01 +0100)]
closes: #810844: debian: control: Unlisted dependencies

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
6 years agobatman_adv: Ignore non-existing batman interface when setting up batman iface.
Maximilian Wilhelm [Thu, 17 Nov 2016 17:52:29 +0000 (18:52 +0100)]
batman_adv: Ignore non-existing batman interface when setting up batman iface.

  Previously a single non existing batman member interface could prevent the
  configuration of the batman interface. This patch makes sure only existing
  member interfaces will be considered when setting up the interface.

Signed-off-by: Maximilian Wilhelm <max@rfc2324.org>
6 years agobatman_adv: Rename _sysfs_mgmt_member_if() to _batctl_if() and use absolute path...
Maximilian Wilhelm [Thu, 17 Nov 2016 17:51:05 +0000 (18:51 +0100)]
batman_adv: Rename _sysfs_mgmt_member_if() to _batctl_if() and use absolute path to batctl.

Signed-off-by: Maximilian Wilhelm <max@rfc2324.org>
6 years agobatman-adv: Show function where error occured in message.
Maximilian Wilhelm [Thu, 17 Nov 2016 17:48:51 +0000 (18:48 +0100)]
batman-adv: Show function where error occured in message.

Signed-off-by: Maximilian Wilhelm <max@rfc2324.org>
6 years agoAdd support for setting phys-dev for VXLAN interfaces.
Maximilian Wilhelm [Thu, 6 Oct 2016 17:22:06 +0000 (19:22 +0200)]
Add support for setting phys-dev for VXLAN interfaces.

  Add interface configuration option »vxlan-physdev« to set »dev« attribute
  of VXLAN interfaces and a check for the running configuration.

Signed-off-by: Maximilian Wilhelm <max@rfc2324.org>
6 years agoAddons: vxlan: Fix check of »vxlan-svcnodeip« config option.
Maximilian Wilhelm [Sun, 2 Oct 2016 20:30:44 +0000 (22:30 +0200)]
Addons: vxlan: Fix check of »vxlan-svcnodeip« config option.

  The »vxlan-svcnodeip« corresponds with the multicast »group« parameter
  of the VXLAN interface and should be checked against this value instead
  of the »remote« parameter for unicast ptp tunnels.

Signed-off-by: Maximilian Wilhelm <max@rfc2324.org>
6 years agodocs: examples: new batman_adv folder with configuration script and example
Julien Fortin [Wed, 5 Oct 2016 14:55:00 +0000 (16:55 +0200)]
docs: examples: new batman_adv folder with configuration script and example

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
6 years agoAdd addon module for B.A.T.M.A.N. advanced interface configuration. (#12)
Maximilian Wilhelm [Wed, 5 Oct 2016 10:18:05 +0000 (12:18 +0200)]
Add addon module for B.A.T.M.A.N. advanced interface configuration. (#12)

* Add addon module for B.A.T.M.A.N. advanced interface configuration.

  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: Maximilian Wilhelm <max@rfc2324.org>
* addons: batman_adv: replacing rtnetlink by netlink api call and iproute2 instantiation fix

These changes are due to modifications we introduced in debian-prep2.
We no longer use the rtnetlink_api but a new one "netlink" build on top of python-nlmanager.

* Reflect upstream change where flags are stored.

Signed-off-by: Maximilian Wilhelm <max@rfc2324.org>
6 years agoRevert "iproute2: addr_add: change default broadcast to '+' so iproute2 generate...
Julien Fortin [Tue, 13 Mar 2018 00:05:52 +0000 (11:05 +1100)]
Revert "iproute2: addr_add: change default broadcast to '+' so iproute2 generate broadcast addrs"

this patch is breaking ip6, i'll try to fix it later by adding a ip4 check first.

This reverts commit c4d1cffc5e34d4afb38606ecf4288b431c82b683.

6 years agoiproute2: addr_add: change default broadcast to '+' so iproute2 generate broadcast...
Julien Fortin [Thu, 1 Mar 2018 05:46:53 +0000 (16:46 +1100)]
iproute2: addr_add: change default broadcast to '+' so iproute2 generate broadcast addrs

    today ifupdown2 doesn't generate the broadcast address for an intf while ifupdown1(debian)
    does, simply changing the default broadcast value to '+' solve the issue.

    auto bond1
    iface bond1 inet static
            address 88.213.145.1
            netmask 255.255.255.0
            bond-slaves ens6 ens6d1
            bond-mode 0
            bond-miimon 100

    $ ifconfig bond1
    bond1: flags=5187<UP,BROADCAST,RUNNING,MASTER,MULTICAST>  mtu 1500
            inet 88.213.145.1  netmask 255.255.255.0  broadcast 0.0.0.0
            inet6 fe80::f652:14ff:fe33:ea01  prefixlen 64  scopeid 0x20<link>
            ether f4:52:14:33:ea:01  txqueuelen 1000  (Ethernet)
            RX packets 6  bytes 522 (522.0 B)
            RX errors 0  dropped 0  overruns 0  frame 0
            TX packets 66  bytes 4878 (4.8 KB)
            TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

    $ ip addr show bond1
    13: bond1: <BROADCAST,MULTICAST,MASTER,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
        link/ether f4:52:14:33:ea:01 brd ff:ff:ff:ff:ff:ff
        inet 88.213.145.1/24 scope global bond1
           valid_lft forever preferred_lft forever
        inet6 fe80::f652:14ff:fe33:ea01/64 scope link
           valid_lft forever preferred_lft forever

    ******************************************
    With ifupdown1 (debian) with the same configuration

    bond1: flags=5187<UP,BROADCAST,RUNNING,MASTER,MULTICAST>  mtu 1500
            inet 88.213.144.1  netmask 255.255.255.0  broadcast 88.213.144.255
            inet6 8f54:2573:3de8:92ba::2  prefixlen 126  scopeid 0x0<global>
            inet6 fe80::f652:14ff:fe33:eac2  prefixlen 64  scopeid 0x20<link>
            ether f4:52:14:33:ea:c2  txqueuelen 1000  (Ethernet)
            RX packets 18  bytes 1566 (1.5 KB)
            RX errors 0  dropped 0  overruns 0  frame 0
            TX packets 51  bytes 4508 (4.5 KB)

    5: bond1: <BROADCAST,MULTICAST,MASTER,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
        link/ether f4:52:14:33:ea:c2 brd ff:ff:ff:ff:ff:ff
        inet 88.213.144.1/24 brd 88.213.144.255 scope global bond1
           valid_lft forever preferred_lft forever
        inet6 8f54:2573:3de8:92ba::2/126 scope global
           valid_lft forever preferred_lft forever
        inet6 fe80::f652:14ff:fe33:eac2/64 scope link
           valid_lft forever preferred_lft forever

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
6 years agoPass environment variables to addon scripts (#32)
Gaudenz Steinlin [Wed, 25 Oct 2017 00:00:27 +0000 (02:00 +0200)]
Pass environment variables to addon scripts (#32)

Pass the same environment variables to addon scripts from /etc/network/
as are passed to user defined commands in interfaces stanzas. This is
needed for compatibility with ifupdown.

Fixes: #14
6 years agoUpdate README.md with install instructions
Julien Fortin [Fri, 13 Oct 2017 23:10:29 +0000 (16:10 -0700)]
Update README.md with install instructions

6 years agoUpdate README.rst (#11)
Jeffrey [Tue, 1 Aug 2017 14:08:10 +0000 (16:08 +0200)]
Update README.rst (#11)

Fixed formatting issue which did put the second 'apt-get install' line behind the first one.

6 years agoFor hotplug devices check if the link is present, not up (#28)
Nigel Kukard [Wed, 26 Jul 2017 23:45:52 +0000 (23:45 +0000)]
For hotplug devices check if the link is present, not up (#28)

Checking operstate would require firmware to be loaded and link
negotiation to of taken place. Some firmwares take a few seconds to
upload and online the device, and some link negotiations take a second
or two.

Immediately checking operstate is not feasible here. Checking if the
link is present is a more suitable non-delaying approach.

Signed-off-by: Nigel Kukard <nkukard@lbsd.net>
7 years agoMerge remote-tracking branch 'cumulus/dev'
Julien Fortin [Thu, 23 Feb 2017 10:17:26 +0000 (17:17 +0700)]
Merge remote-tracking branch 'cumulus/dev'

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
7 years agodebian: changelog: update changelog for new version cl3u10 (unreleased)
Julien Fortin [Thu, 23 Feb 2017 10:10:01 +0000 (17:10 +0700)]
debian: changelog: update changelog for new version cl3u10 (unreleased)

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
7 years agosbin: start-networking: adjust allow-hotplug behavior to ifupdown
Julien Fortin [Thu, 23 Feb 2017 09:42:34 +0000 (16:42 +0700)]
sbin: start-networking: adjust allow-hotplug behavior to ifupdown

Ticket: Bug#855598: src:ifupdown2: allow-hotplug behaves differently, not UPing interfaces
Reviewed By: Roopa
Testing Done: mark an interface (ethX) as hotplug then reboot

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
7 years agosbin: ifupdown2: drop the dependency to pkg_resource, hardcode version number
Julien Fortin [Thu, 23 Feb 2017 09:31:58 +0000 (16:31 +0700)]
sbin: ifupdown2: drop the dependency to pkg_resource, hardcode version number

Ticket:
Reviewed By: Roopa
Testing Done:

Debian Bug#855401, we didn't list pkg_resource as a dependency so the
installation is failing for upstream users.

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
7 years agoifupdown2: bond-downdelay and bond-updelay need validrange
Daniel Walton [Wed, 22 Feb 2017 15:13:40 +0000 (03:13 +1200)]
ifupdown2: bond-downdelay and bond-updelay need validrange

Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by: julien@cumulusnetworks.com
Ticket: CM-15012

7 years agoifupdown2: restrict mstpctl-treeprio validvals
Daniel Walton [Wed, 22 Feb 2017 15:12:16 +0000 (03:12 +1200)]
ifupdown2: restrict mstpctl-treeprio validvals

Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by: julien@cumulusnetworks.com
Ticket: CM-15011

7 years agoMerge remote-tracking branch 'origin/dev-next' into dev
Julien Fortin [Fri, 17 Feb 2017 18:46:15 +0000 (01:46 +0700)]
Merge remote-tracking branch 'origin/dev-next' into dev

7 years agodebian: mark 1.1-cl3u9 RELEASED
Roopa Prabhu [Wed, 8 Feb 2017 18:51:22 +0000 (10:51 -0800)]
debian: mark 1.1-cl3u9 RELEASED

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
7 years agodebian: add new changelog entry for 1.1-cl3u9
Roopa Prabhu [Mon, 6 Feb 2017 21:24:09 +0000 (13:24 -0800)]
debian: add new changelog entry for 1.1-cl3u9

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
7 years agoaddons: bridge: support for bridge-learning attribute
Roopa Prabhu [Mon, 6 Feb 2017 00:27:02 +0000 (16:27 -0800)]
addons: bridge: support for bridge-learning attribute

Ticket: CM-14683
Reviewed By: julien, mallik, anita, vivek, balki, wkok
Testing Done: tested with bridge-learning on off

- support for bridge-learning attribute on bridge ports.
  (currently uses sysfs, must move to netlink soon)
- Additional feature for vxlan bridge ports: sync learning
flag to vxlan bridge ports. No ifquery check for this auto
sync feature.

example config for vxlan ports:
auto vxlan1000
iface vxlan1000
        vxlan-id 1000
        bridge-learning off
        bridge-access 100

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
7 years agoaddons: bond: adding attribute bond-(up|down)delay
Nikhil [Mon, 30 Jan 2017 22:09:58 +0000 (14:09 -0800)]
addons: bond: adding attribute bond-(up|down)delay

Ticket: CM-8424
Reviewed By: Roopa, Julien
Testing Done: using the config mentioned in bug

updelay

    Specifies the time, in milliseconds, to wait before enabling a
    slave after a link recovery has been detected.  This option is
    only valid for the miimon link monitor.

downdelay

    Specifies the time, in milliseconds, to wait before disabling
    a slave after a link failure has been detected.  This option
    is only valid for the miimon link monitor.

Signed-off-by: Nikhil Gajendrakumar <nikhil@cumulusnetworks.com>
Conflicts:
ifupdownaddons/bondutil.py

7 years agoMerge branch 'dev' into dev-next
Julien Fortin [Fri, 27 Jan 2017 20:40:07 +0000 (23:40 +0300)]
Merge branch 'dev' into dev-next

7 years agoRevert "ifupdownaddons: bridgeutils: uncomment parsing code for brctl mc attributes"
Julien Fortin [Fri, 27 Jan 2017 14:34:13 +0000 (17:34 +0300)]
Revert "ifupdownaddons: bridgeutils: uncomment parsing code for brctl mc attributes"

This reverts commit 65beb82662576c047a281389bd663589dcba09db.

it's causing testifupdown2.py:TestMakoJson to fail... Basically this commit
uncomment codes which parse mc value from brctl output. So `ifquery -r` output
is different (this new attribute show up under the bridge). TestMakoJson at
some point does:
$ ifquery -a -r -t json > running_json
Then later
$ ifup -i running_json...
This ifup fails on:
...
warning: br0: unsupported attribute 'bridge-mclmt'
...

7 years agoaddons: vxlan: ifquery: fix remote-ip handling
Roopa Prabhu [Thu, 26 Jan 2017 22:34:32 +0000 (14:34 -0800)]
addons: vxlan: ifquery: fix remote-ip handling

Ticket: CM-14628
Reviewed By: julien, nikhil, vivek, mallik
Testing Done: Tested with vxlan config and remote ips added externally

Recent handling of vxlan-purge-routes as part of CM-13815 did not fix
handling of remote ips during ifquery --check and ifquery --running.
This patch fixes ifquery -c and ifquery running for external
vxlan controller cases.

Without this, ifquery --check always returns exit code of 1 for
external vxlan controller configs

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
7 years agoMerge branch 'dev' into dev-next
Julien Fortin [Mon, 23 Jan 2017 23:53:53 +0000 (02:53 +0300)]
Merge branch 'dev' into dev-next

7 years agoRevert "addons: mstpctl: reset (default) bridge mstpctl options when users remove...
Nikhil [Fri, 20 Jan 2017 21:39:45 +0000 (13:39 -0800)]
Revert "addons: mstpctl: reset (default) bridge mstpctl options when users remove settings"

This reverts commit a3d36dd86d6888a0b61b506a534c24ea4867a18f.
Ticket CM-14516 has been filed to track this

Signed-off-by: Nikhil <nikhil@cumulusnetworks.com>
7 years agoaddons: mstpctl: ifquery -c --with-default, ignore mstpctl default attributes when...
Nikhil [Thu, 5 Jan 2017 22:41:42 +0000 (14:41 -0800)]
addons: mstpctl: ifquery -c --with-default, ignore mstpctl default attributes when stp is off

Ticket: CM-13779
Reviewed By: roopa, satish, julien
Testing Done: testing the config given in the CM

mstpctl showportdetail <bridge> command won't output anything when
bridge-stp is off, therefore ignore mstpctl default attributes during
ifquery -c --with-defaults

This patch also consistently updates bridge and bridge port cache
at the same time.
Earlier bridge and bridge port cache were not consistent
because of the early return condition
    attrs = MSTPAttrsCache.get(bridgename)
        if attrs:
            return attrs
If either of bridge port cache and bridge cache is updated, function used to
return inconsistent cache values

Signed-off-by: Nikhil Gajendrakumar <nikhil@cumulusnetworks.com>
7 years agoifupdownaddons: bridgeutils: uncomment parsing code for brctl mc attributes
Julien Fortin [Thu, 19 Jan 2017 09:22:44 +0000 (12:22 +0300)]
ifupdownaddons: bridgeutils: uncomment parsing code for brctl mc attributes

Ticket: None
Reviewed By: Roopa, Nikhil G
Testing Done: ssim ifupdown2-tests

runtests.sh -T ~/result_smoke/single/ifupdown2-tests.log -r ~/result_smoke/single/summary_ifupdown2tests.txt -d cel-redxp-06 -t nightly -l INFO -k $VM_BASE_KERNEL -i $VM_BASE_IMG $TESTS_HOME/tests/smoke/testOneConfigifupdown2.py:Testifupdown2OneConfig

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
7 years agoaddons: address: replay all gateway commands at every ifreload
Nikhil [Wed, 18 Jan 2017 01:55:35 +0000 (17:55 -0800)]
addons: address: replay all gateway commands at every ifreload

Ticket: CM-14472
Reviewed By: Roopa, Julien
Testing Done: used the config mentioned in CM

Fix introduced by "addons: address: add both v4 and v6 gateways
instead of just one" changed the way gateway commands were configured.
ifupdown2 does not replay default gateway commands on ifreload

This patch ensures all the gateway commands at every ifreload are replayed

Signed-off-by: Nikhil Gajendrakumar <nikhil@cumulusnetworks.com>
7 years agoaddons: mstpctl: reset (default) bridge mstpctl options when users remove settings
Nikhil [Wed, 7 Dec 2016 17:53:33 +0000 (09:53 -0800)]
addons: mstpctl: reset (default) bridge mstpctl options when users remove settings

Ticket: CM-8401
Reviewed By: Roopa, Julien
Testing Done: tested on all bridge mstpctl attributes.

This patch resets th following bridge attributes to defauls when
users remove settings from interface config file.

mstpctl-treeprio
mstpctl-ageing
mstpctl-fdelay
mstpctl-maxhops
mstpctl-maxage
mstpctl-txholdcount
mstpctl-forcevers
mstpctl-hello

Added an api in policy manager to get policy default value of any
module attribute.

Added a cache for bridge attributes to save some runtime

Signed-off-by: Nikhil <nikhil@cumulusnetworks.com>
7 years agodebian: ifupdown2.postinst: refine 'iface lo' regex
Julien Fortin [Tue, 17 Jan 2017 12:49:23 +0000 (15:49 +0300)]
debian: ifupdown2.postinst: refine 'iface lo' regex

Ticket: CM-14362
Reviewed By: Roopa, Nikhil G
Testing Done:

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
7 years agodebian: changelog: update changelog for new version cl3u8
Julien Fortin [Tue, 17 Jan 2017 08:03:02 +0000 (11:03 +0300)]
debian: changelog: update changelog for new version cl3u8

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
7 years ago'link-down' needs 'default' entry in dictionary
Daniel Walton [Fri, 13 Jan 2017 18:18:39 +0000 (18:18 +0000)]
'link-down' needs 'default' entry in dictionary

Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by: roopa@cumulusnetworks.com
Ticket: CM-14330

7 years agoaddons: address: log error when ip route gateway command fails
Julien Fortin [Fri, 13 Jan 2017 03:51:28 +0000 (06:51 +0300)]
addons: address: log error when ip route gateway command fails

Ticket: CM-14386
Reviewed By: Roopa, Purna, NIkhil G
Testing Done:

We have incorrect Address Range and Default g/w configuration. Kernel will give
error in such condition and ignore the route. but ifupdown2 is masking this
error and making user in blind spot.

$ ifdown -a -X eth0
$ ifreload -a
error: h2t_c-1: cmd 'ip route add table DataVrf1080 default via 3.0.0.1 dev h2t_c-1' failed: returned 2 (RTNETLINK answers: Network is unreachable
)
$ echo $?
1
$ ifquery -a
auto h2t_c-1
iface h2t_c-1
      address 6.0.0.1/26
      address 2001:fee1::1/64
      bond-slaves swp1 swp2
      bond-mode 802.3ad
      bond-miimon 100
      bond-min-links 1
      bond-xmit-hash-policy layer3+4
      bond-lacp-rate 1
      mtu 9152
      alias Local Node/s hostd-1-1 and Ports swp1 swp2 <==> Remote  Node/s torc-1-1 torc-1-2 and Ports swp7 swp7
      gateway 3.0.0.1
      gateway 2001:fee1::1
      vrf DataVrf1080

auto DataVrf1080
iface DataVrf1080
      vrf-table 1080

$

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
7 years agoaddons: bridge: warn/err if bridge-access is missing under vxlan bridge VA port
Julien Fortin [Thu, 12 Jan 2017 20:08:57 +0000 (23:08 +0300)]
addons: bridge: warn/err if bridge-access is missing under vxlan bridge VA port

Ticket: CM-14209
Reviewed By: Julien
Testing Done:

vids was a list and pvid is not a list, hence the check was failing

$ cat /etc/network/interfaces
auto vxlan1000
iface vxlan1000
      vxlan-id 1000
      vxlan-local-tunnelip 172.16.20.103
      vxlan-remoteip 172.16.20.106

auto bridge
iface bridge
      bridge-vlan-aware yes
      bridge-ports swp1 vxlan1000
      bridge-vids 100 200

$
$ ifdown -a -X eth0
$ ifreload -a -s
warning: vxlan1000: `bridge-access` attribute is mandatory when vxlan device (vxlan1000) is part of vlan aware bridge (bridge)
$ ifreload -a
warning: bridge: `bridge-access` attribute is mandatory when vxlan device (vxlan1000) is part of vlan aware bridge (bridge)
error: bridge: errors applying port settings
$ ifreload -a
error: vxlan1000: `bridge-access` attribute is mandatory when vxlan device (vxlan1000) is part of vlan aware bridge (bridge)
warning: bridge: `bridge-access` attribute is mandatory when vxlan device (vxlan1000) is part of vlan aware bridge (bridge)
error: bridge: errors applying port settings

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
7 years agoRevert "addons: bridge: warn/err if bridge-access is missing under vxlan bridge VA...
Roopa Prabhu [Thu, 12 Jan 2017 03:58:02 +0000 (19:58 -0800)]
Revert "addons: bridge: warn/err if bridge-access is missing under vxlan bridge VA port"
This reverts commit 4e2db079564a5055a03d2e7e97807b7956c6e110.

reverting because of some reported false errors.

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
7 years agoaddons: bridge: warn/err if bridge-access is missing under vxlan bridge VA port
Julien Fortin [Thu, 12 Jan 2017 00:19:19 +0000 (03:19 +0300)]
addons: bridge: warn/err if bridge-access is missing under vxlan bridge VA port

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

$ cat /etc/network/interfaces
auto vxlan1000
iface vxlan1000
       vxlan-id 1000
       vxlan-local-tunnelip 172.16.20.103
       vxlan-remoteip 172.16.20.106

auto bridge
iface bridge
       bridge-vlan-aware yes
       bridge-ports swp1 vxlan1000
       bridge-vids 100 200

$
$ ifdown -a -X eth0
$ ifreload -a -s
warning: vxlan1000: `bridge-access` attribute is mandatory when vxlan device (vxlan1000) is part of vlan aware bridge (bridge)
$ ifreload -a
warning: bridge: `bridge-access` attribute is mandatory when vxlan device (vxlan1000) is part of vlan aware bridge (bridge)
error: bridge: errors applying port settings
$ ifreload -a
error: vxlan1000: `bridge-access` attribute is mandatory when vxlan device (vxlan1000) is part of vlan aware bridge (bridge)
warning: bridge: `bridge-access` attribute is mandatory when vxlan device (vxlan1000) is part of vlan aware bridge (bridge)
error: bridge: errors applying port settings
$

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
7 years agoaddons: bridge: fix syntax check failing on bridge without port
Julien Fortin [Wed, 11 Jan 2017 20:01:11 +0000 (23:01 +0300)]
addons: bridge: fix syntax check failing on bridge without port

Ticket: CM-13653
Reviewed By: Roopa, Daniel W
Testing Done:

$ cat /etc/network/interfaces
auto bridge
iface bridge
    bridge-vids 10-15
    bridge-vlan-aware yes

$ ifup --syntax-check --verbose --all --interfaces /etc/network/interfaces
info: loading builtin modules from /usr/share/ifupdown2/addons
info: executing /var/lib/ifupdown2/hooks/get_reserved_vlan_range.sh
info: executing /bin/pidof -x clagd
info: executing /var/lib/ifupdown2/hooks/get_reserved_vlan_range.sh
info: executing /bin/pidof mstpd
info: executing /sbin/ip rule show
info: executing /sbin/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
$ echo $?
0
$

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
7 years agovxlan: add new attribute vxlan-purge-remotes to make purging remotes explicit
Roopa Prabhu [Tue, 10 Jan 2017 22:59:32 +0000 (14:59 -0800)]
vxlan: add new attribute vxlan-purge-remotes to make purging remotes explicit

Ticket: CM-13815
Reviewed By:
Testing Done: Tested remote purging

vxlan purging remotes is a feature where we clean up
existing fdb remote entries in favor of the ones specified in the
interfaces file. Obviously in precense of an external controller
like bgp or vxrd this is not a good thing because these remotes
maybe installed by these external controller  daemons.
This patch makes the purgining behaviour explicit by a new attribute.
We will ship with a default policy file which sets vxlan-purge-remotes to no.

This also cleans up a bug introduced by fix to CM-13767 where we were
trying to delete default remote entry pointing to the local ip.

more details below.

problem:
for static configuration, ifupdown2 has some code to "purge" existing
default remote fdb entries and install
new ones corresponding to the ones specified in the interfaces file
(with vxlan-remoteip).
For non-static configuration (ie in presence of an external controller),
it skips this "purge"...because these entries
maybe added by an external controller. To detect that there is no
external controller running..., today it
checks if the vxrd process is running or not. We need to extend this
check to now include bgp (for evpn)...and it gets trickier with bgp
since just checking the quagga pid is not good.

Solution:
I would like to make this purging explicit with an attribute. This patch
adds a 'vxlan-purge-remotes yes|no' attribute. vxlan remote address purging
will take into affect when:
        vxlan-remoteip attribute is present in the interfaces file
        or
        vxlan-purge-remotes is set to 'yes'

We will ship a ifupdown2 default policy file to disable purging by
default (vxlan-purge-remotes no).
For existing customer deployed static configs, since the interfaces file
will already have remote entries, this change
will behave as existing code (ie purge = yes).

For existing vxrd deployments, as long as already deployed interfaces
files have no vxlan-remoteip entries,
this patch does not change any behavior (can people confirm that
existing vxrd deployments have no vxlan-remoteip entries in their
interfaces ?)

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
7 years agoMerge branch 'dev' into dev-next
Julien Fortin [Sun, 8 Jan 2017 13:32:35 +0000 (16:32 +0300)]
Merge branch 'dev' into dev-next

7 years agoaddons: bridge: add support for bridge-vids alias: bridge-trunk
Julien Fortin [Sun, 8 Jan 2017 04:38:35 +0000 (07:38 +0300)]
addons: bridge: add support for bridge-vids alias: bridge-trunk

Daniel: Having both bridge-vids and bridge-trunk at the
net add interface NAME <TAB>
level creates confusion… need to remove bridge-vids

This commit adds bridge-trunk as an alias for bridge-vids

Ticket: CM-14041
Reviewed By: Roopa, Nikhil G
Testing Done:

$ ifquery -a
auto bridge
iface bridge
      bridge-vlan-aware yes
      bridge-ports swp1 swp9
      bridge-trunk 2-100
      bridge-pvid 101
      bridge-stp on

$ ifrelaod -a
$ ifquery -a -c
auto bridge
iface bridge                                                        [pass]
      bridge-vlan-aware yes                                       [pass]
      bridge-ports swp1 swp9                                      [pass]
      bridge-stp yes                                              [pass]
      bridge-pvid 101
      bridge-trunk 2-100                                              []

$ ifquery -a -r
auto bridge
iface bridge
      bridge-vlan-aware yes
      bridge-ports swp9 swp1
      bridge-stp yes
      bridge-pvid 101
      bridge-vids 2-101

$ net show bridge vlan
port       vlan ids
swp1        2-100
             101 PVID Egress Untagged

swp9          2-100
               101 PVID Egress Untagged

bridge         None

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
7 years agoMerge branch 'dev' into dev-next
Julien Fortin [Sun, 8 Jan 2017 02:40:26 +0000 (05:40 +0300)]
Merge branch 'dev' into dev-next

7 years agoaddons: bond: add support for attribute aliases (bond-ports)
Julien Fortin [Fri, 6 Jan 2017 14:58:49 +0000 (17:58 +0300)]
addons: bond: add support for attribute aliases (bond-ports)

This features will allow attributes to have aliases. Our use case today is
between bond-slaves and bridge-ports, which be a little confusing.
It follows the kernel api and existing linux tools. Bonding driver calls them
slaves and to the bridge driver they are ports.

With NCLU we we would like to be more consistent. We will now also support
"bond-ports"a

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

$ ifquery -a -c
auto bond0
iface bond0                                                         [pass]
      bond-slaves swp1                                            [pass]

auto bond1
iface bond1                                                         [pass]
      bond-ports swp2                                             [pass]

root@cel-redxp-06:~# ifquery -a -r
auto bond0
iface bond0
      bond-lacp-bypass-allow 0
      bond-slaves swp1
      bond-mode 802.3ad
      bond-use-carrier 1
      bond-lacp-rate 1
      bond-min-links 1
      bond-miimon 100
      bond-xmit-hash-policy layer3+4

auto bond1
iface bond1
      bond-lacp-bypass-allow 0
      bond-slaves swp2
      bond-mode 802.3ad
      bond-use-carrier 1
      bond-lacp-rate 1
      bond-min-links 1
      bond-miimon 100
      bond-xmit-hash-policy layer3+4

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
7 years agoaddons: bridge: warn/err if bridge-access is missing under vxlan bridge VA port
Julien Fortin [Fri, 6 Jan 2017 02:20:10 +0000 (05:20 +0300)]
addons: bridge: warn/err if bridge-access is missing under vxlan bridge VA port

Ticket: CM-12235
Reviewed By: Roopa, Nikhil G
Testing Done:

$ ifquery vx br0
auto vx
iface vx
      vxlan-id 14567100
      vxlan-local-tunnelip 27.0.0.11
      mstpctl-portbpdufilter yes
      mstpctl-bpduguard yes
      mtu 1500

auto br0
iface br0
      bridge-stp off
      bridge-ports vx
      bridge-vlan-aware yes

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
7 years agoifupdown: add missing supporting code for 'link-down [yes|no]'
Roopa Prabhu [Wed, 4 Jan 2017 22:52:09 +0000 (14:52 -0800)]
ifupdown: add missing supporting code for 'link-down [yes|no]'

Ticket: CM-13434
Reviewed by: julien, nikhil, daniel
Testing Done: ifreload and multiple down [yes|no] sequences under
physical and logical interfaces (ifupdown2-tests test case is pending)

This also moves the fix done for CM-4125 (inet manual handling for
logical devices) into a single place under ifupdownmain.

attribute 'link-down [yes|no]' will not work in all cases when 'inet manual'
is used. This is only to preserve the semantics of 'inet manual'.
Best use of 'link-down [yes|no]' is to use it without 'inet manual'..
they are conflicting features anyways.

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
7 years agoaddons: link: add new 'link-down [yes|no]' link attribute to keep link down
Roopa Prabhu [Thu, 5 Jan 2017 18:52:31 +0000 (10:52 -0800)]
addons: link: add new 'link-down [yes|no]' link attribute to keep link down

Ticket: CM-13434
Reviewed by: julien, nikhil, daniel
Testing Done: ifreload and multiple down [yes|no] sequences under
physical and logical interfaces (ifupdown2-tests test case is
pending)

This also moves the fix done for CM-4125 (inet manual handling for
logical devices) into a single place under ifupdownmain.

attribute 'link-down [yes|no]' will not work in all cases when 'inet
manual' is used. This is only to preserve the semantics of 'inet manual'.
Best use of 'link-down [yes|no]' is to use it without 'inet manual'..
they are conflicting features anyways.

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
7 years agoRevert "addons: address: add 'down' keyword to modinfo dictionary"
Roopa Prabhu [Thu, 5 Jan 2017 18:51:32 +0000 (10:51 -0800)]
Revert "addons: address: add 'down' keyword to modinfo dictionary"

This reverts commit a21c63b65ca297ca6f23c919bbb74e58f9e04a07.

Moving this to link-down in link.py addon module..due to conflict
with usercmds.py

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
7 years agoRevert "ifupdown: add new 'down [yes|no]' link attribute to keep link down"
Roopa Prabhu [Thu, 5 Jan 2017 18:50:48 +0000 (10:50 -0800)]
Revert "ifupdown: add new 'down [yes|no]' link attribute to keep link down"

This reverts commit 02e00f54bbf9d0ca647c1ed2c39f7af28b6653b7.

reverting this commit to move it to link.py addon module.
down conflicts with usercmds.py 'down'

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>