]> git.proxmox.com Git - mirror_ifupdown2.git/log
mirror_ifupdown2.git
7 years agoattribute syntax check using validvals/validrange and keywords
Julien Fortin [Mon, 1 Aug 2016 07:19:31 +0000 (09:19 +0200)]
attribute syntax check using validvals/validrange and keywords

Ticket: CM-8101
Reviewed By: CCR-4949
Testing Done: smoke tests + ran ifup -a -s on every interface configuration file from GSS cl-supports collection

This commit is introducing ~20 keywords. The value of the different attributes
will be check against raw values and <keywords>:

'<mac>'
'<text>'
'<ipv4>'
'<ipv6>'
'<auto>': "auto"
'<ipaddr>': ipv4/6 with preflix len
'<number>'
'<interface>'
'<ipv4-vrf-text>': equivalent to: <ipv4> "vrf" <text>
'<number-ipv4-list>': example: "100=172.16.100.1 101=172.16.101.1"
'<interface-list>': example: "swp1 swp2 swp3"
'<ipv4/prefixlen>'
'<ipv6/prefixlen>'
'<ipaddr/prefixlen>'
'<number-range-list>': example: "2000 2200-3000"
'<interface-range-list>': example: "swp1=100 swp2=100" ('validrange' : ['0', '65535'])
'<mac-ipaddr/prefixlen-list>'
'<number-interface-list>': example: "4 swp1 swp2"
'<interface-yes-no-list>': example: "swp1=yes swp2=no"
'<interface-yes-no-0-1-list>'
'<interface-yes-no-auto-list>'

It's possible to combine a keyword with a range from validrange. example:
validrange: 10-50
validvals: <intrface-range-list>
value: swp1=21 swp2=42 ...

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
7 years agoaddons: bridge & mstpctl: avoid printing default and port attributes under vlan aware...
Nikhil [Fri, 29 Jul 2016 20:20:13 +0000 (13:20 -0700)]
addons: bridge & mstpctl: avoid printing default and port attributes under vlan aware bridge

Ticket: CM-12036
Reviewed By: roopa
Testing Done: used same config from bug

This patch avoids printing port attributes under
vlan-AWARE-bridge on 'ifquer -ra'.

This patch also avoids printing following attributes
on 'ifquer -ra' if not defined:
mstpctl-maxhops
mstpctl-portpathcost
mstpctl-treeportcost

Signed-off-by: Nikhil <nikhil@cumulusnetworks.com>
7 years agoaddons: addressvirtual: enslave macvlans on vrf slaves to the vrf master
Roopa Prabhu [Mon, 18 Jul 2016 05:50:26 +0000 (22:50 -0700)]
addons: addressvirtual: enslave macvlans on vrf slaves to the vrf master

Ticket: CM-11803
Reviewed By: dsa, scotte, wkok, nikhil, julien
Testing Done: tested config of address-virtual lines on vrf slaves

This patch does the following:
- addressvirtual: enslaves macvlans created on vrf slaves
to the vrf master
- vrf: when looking for stale slaves on vrf master, skip
macvlan devices. This code does basic checking right now
and can be improved to include more cases.

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
7 years agoaddons: bridge: Fix KeyError when 'bridge-pvid' is not in the set 'bridge-vid'
Nikhil [Mon, 25 Jul 2016 17:32:47 +0000 (10:32 -0700)]
addons: bridge: Fix KeyError when 'bridge-pvid' is not in the set 'bridge-vid'

Ticket: CM-11998
Reviewed By: roopa
Testing Done: used same config given in bug descreption

When we try to unconditionally remove 'pvid' from 'vids' set,
we run into KeyError if 'vids' set doesn't contain 'pvid'

Example configuration:
auto swp9
iface swp9
   mstpctl-portautoedge no

auto frontnet
iface frontnet
   bridge-vlan-aware yes
   bridge-ports swp9
   bridge-vids 10
   bridge-stp on

Signed-off-by: Nikhil <nikhil@cumulusnetworks.com>
7 years agoaddons: mstpctl: handle vlan aware bridge port config under port
Nikhil [Mon, 25 Jul 2016 17:31:00 +0000 (10:31 -0700)]
addons: mstpctl: handle vlan aware bridge port config under port

Ticket: CM-8629
Reviewed By: roopa, julien
Testing Done: used same config given in bug description

This patch avoids vlan aware bridge over-writing it's port's
config with default values

Example configuration:

auto swp9
iface swp9
   mstpctl-portautoedge no

auto frontnet
iface frontnet
   bridge-vlan-aware yes
   bridge-ports swp9
   bridge-vids 10
   bridge-stp on

Signed-off-by: Nikhil <nikhil@cumulusnetworks.com>
7 years agoaddons: address: add both v4 and v6 gateways instead of just one.
Nikhil [Wed, 20 Jul 2016 22:23:13 +0000 (15:23 -0700)]
addons: address: add both v4 and v6 gateways instead of just one.

Ticket: CM-8596, CM-5118
Reviewed By: roopa, julien
Testing Done: used same config mentioned in bug

Previously, only first configured gateway is set as default route.
This patch sets all the configured gateways as default routes.

This patch also removes default route on ifup
after removing 'gateway' from the interface

Signed-off-by: Nikhil <nikhil@cumulusnetworks.com>
7 years agoaddons: vxlan: localtunnelip check before netlink call, prevent from overwriting...
Julien Fortin [Thu, 21 Jul 2016 00:56:27 +0000 (01:56 +0100)]
addons: vxlan: localtunnelip check before netlink call, prevent from overwriting the anycast ip

Ticket: CM-11867
Reviewed By: Roopa, Balki, Nikhil G
Testing Done: tests/l2/clag_vxlan_aa_test.py

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
7 years agoaddons: bridge: fix 'ifquery -c' 'bridge vid error' on vlan aware bridge port
Nikhil [Wed, 13 Jul 2016 21:18:48 +0000 (14:18 -0700)]
addons: bridge: fix 'ifquery -c' 'bridge vid error' on vlan aware bridge port

Ticket: CM-11811
Reviewed By: roopa, julien
Testing Done: used same configuration from ticket

For a VLAN aware bridge, if 'bridge-pvid' is not configured,
auto bridge
iface bridge
    bridge-ports swp7 swp8
    bridge-vids 1-200
    bridge-vlan-aware yes

'1' is would be running pvid and [2-200] would be running vids.
While doing _query_check() we compare configred versus running
vids excluding running 'pvid'. Configured vids here is [1-200]
and running is [2-200], but instead of excluding running 'pvid'
we used to exclued configured 'pvid' which is None in this case.
Comparison used to fail because of this.

This patch excludes running 'pvid' instead of configured 'pvid'
during _query_check()

This patch also fixes 'ifquery -c' error for bridge-pvid if
configured under a port of vlan aware bridge

This patch also avoids printing 'bridge-pvid' on 'ifquery -c'
if bridge-pvid is not configured under vlan aware bridge port

sample configuration:
auto swp4
iface swp4

auto swp7
iface swp7
    bridge-pvid 2

auto swp8
iface swp8
    bridge-pvid 2

auto bridge
iface bridge
    bridge-ports swp4 swp7 swp8
    bridge-vids 1-200
    bridge-pvid 20
    bridge-vlan-aware yes

sample output:
root@dell-s3000-02:~# ifquery -c -a
auto swp4
iface swp4                                                      [pass]
    bridge-pvid 20                                              [pass]

auto swp7
iface swp7                                                      [pass]
    bridge-pvid 2                                               [pass]

auto swp8
iface swp8                                                      [pass]
    bridge-pvid 2                                               [pass]

auto bridge
iface bridge                                                    [pass]
    bridge-vlan-aware yes                                       [pass]
    bridge-ports swp8 swp7 swp4                                 [pass]
    bridge-pvid 20
    bridge-vids 1-200                                               []

Signed-off-by: Nikhil <nikhil@cumulusnetworks.com>
7 years agoaddons: dhcp: stop IPv6 dhclient on ifdown and add delay before starting dhclient
Nikhil [Fri, 15 Jul 2016 21:21:23 +0000 (14:21 -0700)]
addons: dhcp: stop IPv6 dhclient on ifdown and add delay before starting dhclient

Ticket: CM-11043
Reviewed By: roopa
Testing Done: used the config mentioned in bug

This patch adds a delay before starting IPv6 dhclient to
make sure the configured interface/link in up.

Also, ifdown on a IPv6 interface, this patch makes sure
that the link in up before dhcp release. Dhcp release is
done using a default lease file.

Signed-off-by: Nikhil <nikhil@cumulusnetworks.com>
7 years agoaddons: bridge: fix 'ifquery -c' 'bridge vid error' on vlan aware bridge port
Nikhil [Wed, 13 Jul 2016 21:18:48 +0000 (14:18 -0700)]
addons: bridge: fix 'ifquery -c' 'bridge vid error' on vlan aware bridge port

Ticket: CM-11811
Reviewed By: roopa, julien
Testing Done: used same configuration from ticket

For a VLAN aware bridge, if 'bridge-pvid' is not configured,
auto bridge
iface bridge
    bridge-ports swp7 swp8
    bridge-vids 1-200
    bridge-vlan-aware yes

'1' is would be running pvid and [2-200] would be running vids.
While doing _query_check() we compare configred versus running
vids excluding running 'pvid'. Configured vids here is [1-200]
and running is [2-200], but instead of excluding running 'pvid'
we used to exclued configured 'pvid' which is None in this case.
Comparison used to fail because of this.

This patch excludes running 'pvid' instead of configured 'pvid'
during _query_check()

This patch also fixes 'ifquery -c' error for bridge-pvid if
configured under a port of vlan aware bridge

sample configuration:
auto swp4
iface swp4

auto swp7
iface swp7
    bridge-pvid 2

auto swp8
iface swp8
    bridge-pvid 2

auto bridge
iface bridge
    bridge-ports swp4 swp7 swp8
    bridge-vids 1-200
    bridge-pvid 20
    bridge-vlan-aware yes

sample output:
root@dell-s3000-02:~# ifquery -c -a
auto swp4
iface swp4                                                      [pass]
    bridge-pvid 20                                              [pass]

auto swp7
iface swp7                                                      [pass]
    bridge-pvid 2                                               [pass]

auto swp8
iface swp8                                                      [pass]
    bridge-pvid 2                                               [pass]

auto bridge
iface bridge                                                    [pass]
    bridge-vlan-aware yes                                       [pass]
    bridge-ports swp8 swp7 swp4                                 [pass]
    bridge-pvid 20
    bridge-vids 1-200                                               []

Signed-off-by: Nikhil <nikhil@cumulusnetworks.com>
7 years agoRevert "Revert "addons: bond: reverting validvals "<mac>" change""
Julien Fortin [Mon, 18 Jul 2016 20:00:12 +0000 (21:00 +0100)]
Revert "Revert "addons: bond: reverting validvals "<mac>" change""

This reverts commit b19c6c100a3ccec5c858342b8349f1ee441bf153.

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
7 years agonlmanager: changing log level to debug for RXed messages
Julien Fortin [Mon, 18 Jul 2016 09:45:45 +0000 (10:45 +0100)]
nlmanager: changing log level to debug for RXed messages

Ticket: CM-11857
Reviewed By: Daniel, Roopa
Testing Done:

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
7 years agoRevert "addons: usercmds: adding environment variables passed by the ifupdown2 to...
Roopa Prabhu [Mon, 18 Jul 2016 05:04:01 +0000 (22:04 -0700)]
Revert "addons: usercmds: adding environment variables passed by the ifupdown2 to user scripts"

This reverts commit cfc51ed18be9aee902cbc89a57350d9e99a1950d.

this commit seems to have broken usercmds. reverting it until it is
fixed.

Closes: CM-11856
Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
7 years agoaddons: bridge: batch bridge commands
Roopa Prabhu [Sun, 10 Jul 2016 23:34:34 +0000 (16:34 -0700)]
addons: bridge: batch bridge commands

Ticket: CM-11274
Reviewed By: julien, nikhil, wkok
Testing Done: tested with vxlan scale config

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
7 years agoifupdownaddons: iproute2: add bridge_commit_batch api to batch bridge
Roopa Prabhu [Fri, 8 Jul 2016 15:13:37 +0000 (08:13 -0700)]
ifupdownaddons: iproute2: add bridge_commit_batch api to batch bridge
commands

Ticket: CM-11274
Testing Done: julien, wkok, nikhil

It uses and goes with the the other batch variables and apis.
This one just calls the 'bridge -batch' command instead
of the 'ip -batch' command.

This can be used to batch bridge commands.

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
7 years agoaddons: ethtool: ignore logical interfaces with link_kind
Roopa Prabhu [Sat, 16 Jul 2016 23:09:37 +0000 (16:09 -0700)]
addons: ethtool: ignore logical interfaces with link_kind

Ticket: CM-11517
Reviewed By: julien, nikhil, jtoppins
Testing Done: ethtool sanity test

ethtool module should really care only about
physical interfaces. so, this patch makes ethtool
module ignore all logical interfaces, ie interfaces
with link_kind set.

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
7 years agoaddons: usercmds: adding environment variables passed by the ifupdown2 to user scripts
Julien Fortin [Fri, 15 Jul 2016 16:00:09 +0000 (17:00 +0100)]
addons: usercmds: adding environment variables passed by the ifupdown2 to user scripts

Ticket: None
Reviewed By: Roopa
Testing Done: with a dummy script I printed the value passed by ifupdown
After the changes I did the same with ifupdown2 and checksd if the values
matched correctly.

This issue was reported on the github repository.

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
7 years agoifupdown: networkinterfaces: making sure template engine will only be initialized...
Julien Fortin [Fri, 15 Jul 2016 11:18:36 +0000 (12:18 +0100)]
ifupdown: networkinterfaces: making sure template engine will only be initialized once.

Ticket: None
Reviewed By: Roopa
Testing Done:

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
7 years agoifupdown: networkinterfaces: not importing template engine if no mako keyword found
Julien Fortin [Thu, 14 Jul 2016 19:09:42 +0000 (20:09 +0100)]
ifupdown: networkinterfaces: not importing template engine if no mako keyword found

Ticket: CM-11807
Reviewed By: Roopa, Daniel
Testing Done:

Loading the default template engine (mako) is adding an extra overhead: 100ms
We also import the template engine even if we are dealing with a json input
The overhead is noticable when using NCLU.

With this change we are now important the template engine when a keyword is
found in the configuration file.

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
7 years agoifupdown: fixes to make addon scripts work via special config options
Roopa Prabhu [Mon, 11 Jul 2016 05:48:42 +0000 (22:48 -0700)]
ifupdown: fixes to make addon scripts work via special config options

ifupdown2 can invoke scripts under /etc/network/if-*.d/*
in the required order with the required environment variables.
This patch includes fixes to execute these scripts.

The following attributes in /etc/network/ifupdown2/ifupdown.conf
can influence the execution behaviour of python-addon modules
and /etc/network/if-*.d/*

<ifupdown.conf>
addon_syntax_check=0

addon_scripts_support=1

addon_python_modules_support=1
</ifupdown.conf>

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
7 years agoman.rst: fix spelling mistakes as reported by lintian and Piotr
Roopa Prabhu [Fri, 21 Aug 2015 04:17:00 +0000 (21:17 -0700)]
man.rst: fix spelling mistakes as reported by lintian and Piotr

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
7 years agoconfig: enable template by default for cumulus
Roopa Prabhu [Mon, 11 Jul 2016 03:30:24 +0000 (20:30 -0700)]
config: enable template by default for cumulus

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
7 years agoifupdown: disable template execution by default
Roopa Prabhu [Mon, 11 Jul 2016 03:28:53 +0000 (20:28 -0700)]
ifupdown: disable template execution by default

User will have to enable it by enabling it in
/etc/network/ifupdown2.conf template_enable=1

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
7 years agoaddon: handle unsupported modules
Roopa Prabhu [Mon, 11 Jul 2016 03:23:17 +0000 (20:23 -0700)]
addon: handle unsupported modules

Example: If /sbin/ethtool is not installed dont run the
ethtool addon module.

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
7 years agoifupdownaddons: bridgeutils: build cache only if bridge-utils installed
Roopa Prabhu [Mon, 11 Jul 2016 01:34:45 +0000 (18:34 -0700)]
ifupdownaddons: bridgeutils: build cache only if bridge-utils installed

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
7 years agoaddons: addressvirtual: allowing address-virtual attr for vrf slave interfaces
Julien Fortin [Wed, 13 Jul 2016 22:25:07 +0000 (23:25 +0100)]
addons: addressvirtual: allowing address-virtual attr for vrf slave interfaces

Ticket: CM-11745
Reviewed By: Roopa, Nikhil G
Testing Done: configuration provided in the bug

User was attempting to configure a traditional bridge under a VRF with VRR.
When issuing ifreload -a, the configuration failed to apply with an error.

Applying an address-virtual keyword to an interface with upper interfaces
or parent interfaces was not allowed. But now we are allowing the use of
this keyword only for vrf slaves.

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
7 years agoaddons may implement `syntax_check` method to perform specific syntax checks
Julien Fortin [Tue, 12 Jul 2016 15:31:29 +0000 (16:31 +0100)]
addons may implement `syntax_check` method to perform specific syntax checks
and validation

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

The goal of this commit is to provide the addons a new way to perform their
own specific syntax checks. By implementing `syntax_check` method.

The addons will have to make sure the provided ifaceobj is valid.
e.g. vxlan.py:syntax_check(ifaceobj) should check:
self._is_vxlan_device(ifaceobj)

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
7 years agoimporting: "nlmanager: changing log level info->debug for TXed messages"
Julien Fortin [Mon, 11 Jul 2016 23:39:44 +0000 (00:39 +0100)]
importing: "nlmanager: changing log level info->debug for TXed messages"

Ticket: CM-11708
Reviewed By: Roopa, Daniel
Testing Done:

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
7 years agoimporting: "nlmanager: removing IFLA_VXLAN_LINK attribute from packet when creating...
Julien Fortin [Mon, 11 Jul 2016 23:34:56 +0000 (00:34 +0100)]
importing: "nlmanager: removing IFLA_VXLAN_LINK attribute from packet when creating vxlan"

Ticket:
Reviewed By: Roopa, Daniel
Testing Done:

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
7 years agoRevert "addons: bond: reverting validvals "<mac>" change"
Julien Fortin [Mon, 11 Jul 2016 19:37:41 +0000 (20:37 +0100)]
Revert "addons: bond: reverting validvals "<mac>" change"

This reverts commit 3861c72cf6132ba79147911c7fe3498cab57de3e.

7 years agoaddons: vxlan: fixing wrong vxlan-id range
Julien Fortin [Mon, 11 Jul 2016 19:36:18 +0000 (20:36 +0100)]
addons: vxlan: fixing wrong vxlan-id range

Ticket: None
Reviewed By: Roopa, Daniel
Testing Done: This is not affecting ifupdown2 yet
the validvals attribute is only used by ifedit

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
7 years agoifupdownaddons: iproute2: fix 'ifquery -c' fail for 'bridge-pvid' on bridge ports
Nikhil [Sat, 2 Jul 2016 06:07:19 +0000 (23:07 -0700)]
ifupdownaddons: iproute2: fix 'ifquery -c' fail for 'bridge-pvid' on bridge ports

Ticket: CM-11624
Reviewed By: roopa, julien
Testing Done: using configuration mentioned in the bug

This patch fixes 'ifquery -c' failure for 'bridge-pvid' on
all bridge ports.

The following format of '/sbin/bridge -c vlan show' output was not handled properly
by iproute2

port  vlan ids
swp1   600
       700-710
       711 PVID Egress Untagged
       712-900

iproute2 was parsing the '/sbin/bridge -c vlan show' output with the assumption that
pvid line '711 PVID Egress Untagged' appears before all the vland ids.

Something like this:
port  vlan ids
swp1   711 PVID Egress Untagged
       600
       700-710
       712-900

Signed-off-by: Nikhil <nikhil@cumulusnetworks.com>
7 years agoaddons: mstpctl: complete ifquery -r support
Nikhil [Thu, 30 Jun 2016 23:10:04 +0000 (16:10 -0700)]
addons: mstpctl: complete ifquery -r support

Ticket: CM-7841
Reviewed By: roopa, julien
Testing Done: tested all the bridge attributes

added 'ifquery -r' support for 'mstpctl-portpathcost', 'mstpctl-treeportcost', 'mstpctl-portautoedge', 'mstpctl-portbpdufilter', 'mstpctl-portnetwork'

Below is the sample configuration and output

root@dell-s3000-02:~# ifquery -a
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp

auto br0
iface br0
  bridge-vlan-aware yes
  bridge-ports swp42 swp43
  mstpctl-fdelay 14
  mstpctl-txholdcount 5
  mstpctl-forcevers rstp
  mstpctl-maxhops 14
  mstpctl-treeprio 32768
  mstpctl-maxage 19
  mstpctl-hello 3
  mstpctl-ageing 200

auto swp42
iface swp42
  mstpctl-portadminedge yes
  mstpctl-portbpdufilter yes
  mstpctl-portnetwork yes
  mstpctl-portautoedge yes
  mstpctl-treeportprio 127
  mstpctl-portpathcost 10
  mstpctl-portrestrtcn yes
  mstpctl-portrestrrole yes
  mstpctl-bpduguard yes
  mstpctl-treeportcost 100
  mstpctl-portp2p yes

auto swp43
iface swp43
  mstpctl-portadminedge yes
  mstpctl-portbpdufilter yes
  mstpctl-portnetwork yes
  mstpctl-portautoedge yes
  mstpctl-treeportprio 127
  mstpctl-portpathcost 10
  mstpctl-portrestrtcn yes
  mstpctl-portrestrrole yes
  mstpctl-bpduguard yes
  mstpctl-treeportcost 100
  mstpctl-portp2p yes

root@dell-s3000-02:~# ifquery -ra
auto swp42
iface swp42
  mstpctl-portautoedge yes
  mstpctl-portbpdufilter yes
  mstpctl-portpathcost 10
  mstpctl-treeportcost 100
  mstpctl-portnetwork yes
  mstpctl-portadminedge yes
  mstpctl-portp2p yes
  mstpctl-portrestrrole yes
  mstpctl-portrestrtcn yes
  mstpctl-bpduguard yes
  link-speed 0
  link-duplex half
  link-autoneg off

auto swp43
iface swp43
  mstpctl-portautoedge yes
  mstpctl-portbpdufilter yes
  mstpctl-portpathcost 10
  mstpctl-treeportcost 100
  mstpctl-portnetwork yes
  mstpctl-portadminedge yes
  mstpctl-portp2p yes
  mstpctl-portrestrrole yes
  mstpctl-portrestrtcn yes
  mstpctl-bpduguard yes
  link-speed 0
  link-duplex half
  link-autoneg off

auto br0
iface br0
  vxlan-ageing 300
  bridge-vlan-aware yes
  bridge-mcqifaddr 0
  bridge-mcquerier 0
  bridge-mcsnoop 1
  bridge-mcrouter 1
  bridge-stp yes
  bridge-ports swp43 swp42
  mstpctl-portadminedge  swp42=yes swp43=yes
  mstpctl-fdelay 14
  mstpctl-portnetwork  swp42=yes swp43=yes
  mstpctl-txholdcount 5
  mstpctl-maxage 19
  mstpctl-portbpdufilter  swp42=yes swp43=yes
  mstpctl-maxhops 14
  mstpctl-portrestrtcn  swp42=yes swp43=yes
  mstpctl-portpathcost  swp42=10 swp43=10
  mstpctl-portautoedge  swp42=yes swp43=yes
  mstpctl-hello 3
  mstpctl-portrestrrole  swp42=yes swp43=yes
  mstpctl-bpduguard  swp42=yes swp43=yes
  mstpctl-ageing 200
  mstpctl-treeportcost  swp42=100 swp43=100
  mstpctl-portp2p  swp42=yes swp43=yes

Signed-off-by: Nikhil <nikhil@cumulusnetworks.com>
7 years agonlmanager: nlpacket: vxlan dstport config incorrect
Julien Fortin [Sun, 10 Jul 2016 02:40:25 +0000 (03:40 +0100)]
nlmanager: nlpacket: vxlan dstport config incorrect

Ticket: CM-11735
Reviewed By: Roopa, Daniel
Testing Done: creating a vxlan with ifupdown then checking the dstport with
ip -d link show $vlxanName

When creating a vxlan nlmanager didn't re-order/byte swap the dstport value
to little endian

46354 instead of 4789

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
7 years agoifupdown2 defaults for link attributes are not applied
Sam Tannous [Fri, 8 Jul 2016 00:16:22 +0000 (17:16 -0700)]
ifupdown2 defaults for link attributes are not applied

Ticket: CM-11718
Reviewed By: CCR-4931
Testing Done: Tested complete regression suite on hardnode in 3.0.

This patch fixes a problem in the ethtool addon module where a single iface stanza was
configured for a link-speed (1G) other then the default (10G). The link-speed config is then
removed or commented out but the link-speed is not restored to its default value (10G) because of
incorrect logic.

7 years agoaddons: moving vxlan creation from iproute2 to netlink (via nlmanager)
Julien Fortin [Tue, 5 Jul 2016 12:45:08 +0000 (14:45 +0200)]
addons: moving vxlan creation from iproute2 to netlink (via nlmanager)

Ticket: CM-8035
Reviewed By: CCR-4896
Testing Done: ifupdown smoke, -t vxlan tests

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
7 years agonetlink: adding support for netlink vxlan call via nlmanager
Julien Fortin [Tue, 5 Jul 2016 12:42:54 +0000 (14:42 +0200)]
netlink: adding support for netlink vxlan call via nlmanager

Ticket: CM-8035
Reviewed By: CCR-4896
Testing Done: ifupdown smoke, -t vxlan tests

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
7 years agopython-nlamanger: importing vxlan creation support commit
Julien Fortin [Tue, 5 Jul 2016 12:40:19 +0000 (14:40 +0200)]
python-nlamanger: importing vxlan creation support commit

Ticket: CM-8035
Reviewed By: CCR-4896
Testing Done: ifupdown smoke, -t vxlan tests

julien@hydra-01:~$ time runtests.sh -d cel-redxp-06 -r result_vxlan_all.txt -f . -T vxlan_all.log -l INFO -k $VM_BASE_KERNEL -i $VM_BASE_IMG $TESTS_HOME/tests/ -t vxlan

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
7 years agoaddons: bridge: ifquery -c fix for port attributes
Nikhil [Wed, 29 Jun 2016 23:38:50 +0000 (16:38 -0700)]
addons: bridge: ifquery -c fix for port attributes

Ticket: CM-11195
Reviewed By: roopa, julien
Testing Done: used the configuration mentioned in bug description

Signed-off-by: Nikhil <nikhil@cumulusnetworks.com>
running values for bridge-portmcrouter, bridge-portmcfl, and bridge-portprios
were accessed using invalid keys.

7 years agoaddons: vrf: remove the FIB rules for vrf devices
Nikhil [Wed, 22 Jun 2016 19:06:42 +0000 (12:06 -0700)]
addons: vrf: remove the FIB rules for vrf devices

Ticket: CM-11392
Reviewed By: roopa, dsa, julien
Testing Done: multiple vrf devices on dell-s3000-02

Now that the l3mdev FIB rule is in the CL3.1 kernel tree,
ifupdown2 no longer needs to manage FIB rules for VRF devices.

Signed-off-by: Nikhil <nikhil@cumulusnetworks.com>
7 years agonlmanager: nlpacket: throw an error if the user of nlmanager tries to encode an attri...
Julien Fortin [Sun, 26 Jun 2016 23:24:18 +0000 (00:24 +0100)]
nlmanager: nlpacket: throw an error if the user of nlmanager tries to encode an attribute that we haven't added an encode() method for
+ adding one byte attribute class for protodown operations.

Ticket: CM-11581
Reviewed By: CCR-4721
Testing Done: Smoke + custom interface file with clag bond that requires protodown.

- nlmanager will now throw an exception if a user is trying to use the default
attribute class when in fact he should use a more specific attribute class.

- The protodown implementation needed to use a one byte attribute to set the protodown state

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
7 years agoifupdown2: Disable IPv6 duplicate address detection on VRR interfaces
Scott Emery [Thu, 23 Jun 2016 21:58:14 +0000 (14:58 -0700)]
ifupdown2: Disable IPv6 duplicate address detection on VRR interfaces

Ticket: CM-11511
Reviewed By: CCR-4890
Testing Done: Used "address-virtual" keyword to create VRR interface with IPv6
address. Checked sysctl and dad failures.

In a VRR setup, both switches are programmed with the same IPv6 address and that
address is active on both switches. This causes the IPv6 duplicate address
detection to kick in and diable the use of one of the address on one of the
switches. This patch causes duplicate address detection to be disabled on VRR
interfaces by setting the net.ipv6.conf.<ifname>.accept_dad and
net.ipv6.conf.<ifname>.dad_transmits sysctl's to 0. The only IPv6 addresses
which are defined on these interfaces are the virtual addresses and the link
local address (which is unused). No other operational IPv6 addresses should ever
be assigned to these interfaces. Instead, operational IPv6 addresses should be
assigned to the "base", or lower, interface of the VRR interface.

7 years ago'this is an ACK' message should be log.debug() not log.info()
Julien Fortin [Thu, 23 Jun 2016 23:51:26 +0000 (00:51 +0100)]
'this is an ACK' message should be log.debug() not log.info()

Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by: Julien Fortin <julien@cumulusnetworks.com>
7 years agoAttribute 20 is not defined in Route.attribute_to_class
Julien Fortin [Thu, 23 Jun 2016 23:48:13 +0000 (00:48 +0100)]
Attribute 20 is not defined in Route.attribute_to_class

Ticket: CM-11515

Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by: Julien Fortin <julien@cumulusnetworks.com>
7 years agoRemove dependancy on tabulate
Julien Fortin [Tue, 21 Jun 2016 21:03:10 +0000 (22:03 +0100)]
Remove dependancy on tabulate

Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by: roopa@cumulusnetworks.com
7 years agoaddons: vlan: ifquery will try to get the vlan-id from the ifacename if vlan-id attr...
Julien Fortin [Tue, 21 Jun 2016 14:17:09 +0000 (15:17 +0100)]
addons: vlan: ifquery will try to get the vlan-id from the ifacename if vlan-id attr is missing

Ticket: CM-11485
Reviewed By: Roopa
Testing Done: config from the github issue

First reported here https://github.com/CumulusNetworks/ifupdown2/issues/10
ifquery just like ifupdown should try to get the vlan-id from the iface name
if vlan-id attr is not specified.

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
7 years agoaddons: vrf: moving replacing rtnetlink_api call with the new netlink api
Julien Fortin [Thu, 16 Jun 2016 02:39:12 +0000 (03:39 +0100)]
addons: vrf: moving replacing rtnetlink_api call with the new netlink api

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
7 years agoaddons: bond: reverting validvals "<mac>" change
Julien Fortin [Tue, 7 Jun 2016 17:47:54 +0000 (18:47 +0100)]
addons: bond: reverting validvals "<mac>" change

Ticket: CM-11331
Reviewed By:
Testing Done:

7 years agosmall easy: support (0|1) or (off|on) attribute while keeping backward compatibility
Julien Fortin [Tue, 7 Jun 2016 17:37:40 +0000 (18:37 +0100)]
small easy: support (0|1) or (off|on) attribute while keeping backward compatibility

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

added support for:
* bond-lacp-bypass-allow (0|1)
* bond-use-carrier (0|1)
* bridge-mcqifaddr (0|1)
* bridge-mcquerier (0|1)
* bridge-mcrouter (0|1)
* bridge-mcsnoop (0|1)
* bridge-portmcrouter (0|1)
* link-autoneg (off|on)
* vxlan-learning (off|on)

these 2 are not yet supported by ifupdown2:
* bond-lacp-bypass-all-active (0|1)
* bond-lacp-fallback-allow (0|1)

This one is left untouched. yes/no doesn't make sense for this attribute.
* bond-lacp-rate (0|1)

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
7 years agoAdd validvals to addons, to be used by iface/ifedit wrapper
Daniel Walton [Tue, 31 May 2016 20:12:21 +0000 (13:12 -0700)]
Add validvals to addons, to be used by iface/ifedit wrapper

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

<DETAILED DESCRIPTION (REPLACE)>

7 years agoImport python-nlmanager mirror copy
Julien Fortin [Sun, 29 May 2016 17:06:23 +0000 (18:06 +0100)]
Import python-nlmanager mirror copy

Ticket: CM-7360
Reviewed By: CCR-4721
Testing Done: smoke / testifreload / Tested on amd64 platform (by Sam)

For now, we use a mirror copy of nlmanager sources to make sure we don't
depend on it as an external package

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
7 years agoReplace rtnetlink modules with python-nlmanager calls
Julien Fortin [Sun, 29 May 2016 17:04:23 +0000 (18:04 +0100)]
Replace rtnetlink modules with python-nlmanager calls

Ticket: CM-7360
Reviewed By: CCR-4721
Testing Done: smoke / testifreload / Tested on amd64 platform (by Sam)

This patch replaces all calls to rtnetlink with python-nlmanager.

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
7 years agoaddons: vrf: Fix to kill current ssh on 'sudo ifreload -a' to enable mgmt VRF
Nikhil [Wed, 25 May 2016 23:16:22 +0000 (16:16 -0700)]
addons: vrf: Fix to kill current ssh on 'sudo ifreload -a' to enable mgmt VRF

Ticket: CM-11080
Reviewed By: roopa, dsa, dave olson, daniel, julien
Testing Done: yes, with mgmt VRF configured

This patch parses '/usr/bin/pstree -Aps <pid>' output to find
the pid of current ssh session, and send 'sudo ifreload -a'
to background before killing itself.

Signed-off-by: Nikhil <nikhil@cumulusnetworks.com>
7 years agoaddons: bond: support for classical numerical bond modes
Julien Fortin [Wed, 25 May 2016 15:12:19 +0000 (17:12 +0200)]
addons: bond: support for classical numerical bond modes

Ticket: CM-7965
Reviewed By: Roopa, Nikhil G
Testing Done: ifup/down/reload/query iface attr bond-mode with numerical/string values

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
7 years agosbin: start-networking: support hotplug class from init script
Julien Fortin [Tue, 24 May 2016 08:48:27 +0000 (10:48 +0200)]
sbin: start-networking: support hotplug class from init script

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

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
7 years agoaddons: vrf: warn and continue on vrf-helper errors
Roopa Prabhu [Tue, 17 May 2016 20:42:47 +0000 (13:42 -0700)]
addons: vrf: warn and continue on vrf-helper errors

Ticket: CM-11003
Reviewed By: dsa
Testing Done: tested ifup and ifdown of vrf dev

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
7 years agoaddons: bridge: Fix for ifquery -c bridge pvid error to a valid config
Nikhil [Mon, 23 May 2016 16:06:10 +0000 (09:06 -0700)]
addons: bridge: Fix for ifquery -c bridge pvid error to a valid config

Ticket: CM-8623
Reviewed By: Roopa Prabhu, Julien Fortin
Testing Done: yes, using the below mentioned config.

This patch fixes 'ifquery -c' error, bridge pvid error, which is an
unrelated error for the following valid config.

This patch also removes 'bridge-pvid', if configured, from 'bridge-vids' set.
In the below example, 510 is removed from the set bridge-vids 510-550.
The new bridge-vids set is 511-550.

auto swp1
iface swp1 inet6 dhcp
        address 14.0.0.5/30
        down ip addr flush dev swp1

auto Bridge1
iface Bridge1
        address 0.0.0.0/0
        down ip addr flush dev Bridge1
        bridge-vlan-aware yes
        bridge-ports swp1
        bridge-pvid 510
        bridge-vids 510-550
        bridge-stp on
        mstpctl-portnetwork swp1=yes

Signed-off-by: Nikhil <nikhil@cumulusnetworks.com>
7 years agoexamples: generate interfaces: will fetch pci interfaces when porttab is missing
Julien Fortin [Mon, 23 May 2016 08:48:24 +0000 (10:48 +0200)]
examples: generate interfaces: will fetch pci interfaces when porttab is missing

Ticket: CM-10751
Reviewed By: Roopa, Nikhil
Testing Done: exec script without porttab

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
7 years agoifupdownmain: fixing too many argument for format string
Julien Fortin [Fri, 20 May 2016 15:03:00 +0000 (17:03 +0200)]
ifupdownmain: fixing too many argument for format string

Ticket: None
Reviewed By:
Testing Done:

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
7 years agoifupdownbase: missing traceback import
Julien Fortin [Fri, 20 May 2016 15:00:50 +0000 (17:00 +0200)]
ifupdownbase: missing traceback import

Ticket: None
Reviewed By:
Testing Done:

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
7 years agoifreload: address module always reconfigures (dels/adds) addresses when user
Sam Tannous [Thu, 19 May 2016 15:14:13 +0000 (08:14 -0700)]
ifreload: address module always reconfigures (dels/adds) addresses when user

Ticket: CM-8561
Reviewed By: kanna, julien
Testing Done: Tested on amd64 switch

ifreload always deletes and adds back a host IP address
if that address is specified without a "/" and without a "netmask" config.

The problem is fixed so that _inet_address_convert_to_cidr() handles a missing
"/" and a missing "netmask" config. The host addresses is no longer added to a
list of addresses we will del/add. The patch was simply to add a case for the
missing "/" and a missing "netmask".

7 years agodebian: avoid zipping of generate_interfaces.py file
Nikhil [Thu, 19 May 2016 00:16:28 +0000 (17:16 -0700)]
debian: avoid zipping of generate_interfaces.py file

Ticket: CM-10751
Reviewed By: Roopa Prabhu, Julien Fortin
Testing Done: Yes, by extracting and installing .deb onto dell-s3000-02

Signed-off-by: Nikhil <nikhil@cumulusnetworks.com>
7 years agoifupdown: iface: now trimming json values right after parsing
Julien Fortin [Wed, 18 May 2016 11:17:47 +0000 (13:17 +0200)]
ifupdown: iface: now trimming json values right after parsing

Ticket: None
Reviewed By: Roopa
Testing Done: smoke/testifupdown2.py:TestMakoJson

ifupdown2.TestMakoJson test was failing because the json values werent trimmed
Because of a trailing whitespace, a list of iface had an empty value, ifupdown2
was throwing an exception.

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
7 years agoperformance fix: better handling fd to allow subprocess.close_fds=False and code...
Julien Fortin [Fri, 13 May 2016 17:52:57 +0000 (19:52 +0200)]
performance fix: better handling fd to allow subprocess.close_fds=False and code re-organisation

Ticket: None
Reviewed By: CCR-4692
Testing Done: smoke + scale tests

If called with close_fds=True the subprocess module will try to close every fd
from 3 to MAXFD before executing the specified command. This is done in Python
not even with a C-implementation which truly affecting performances.

This patch aims to better handle the file descriptor used by ifupdown2. Either
by closing them after use or by setting the close-on-exec flag for the file
descriptor, which causes the file descriptor to be automatically
(and atomically) closed when any of the exec-family functions succeed.

With the actual patch all tests are passing, I can't think of any future issue
but if any a possible future modification might be to use the parameter
'preexec_fn', which allows us to set function which will be executed in the
child process before executing the command line. We can always manually close
any remaining open file descriptors with something like:

>>> os.listdir('/proc/self/fd/')
['0', '1', '2', ‘3’, etc..]
>>> for fd in os.listdir('/proc/self/fd/')
>>>    if int(fd) > 2:
>>>       os.close(fd)

This patch is also totally re-organising the use of subprocesses. By removing
all subprocess code redundancy.

7 years agoFixing errors and typos
Julien Fortin [Thu, 12 May 2016 14:00:41 +0000 (16:00 +0200)]
Fixing errors and typos

Ticket: None
Reviewed By: Roopa
Testing Done:

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
7 years agofixing typos in bonduitls.py and iproute2.py
Julien Fortin [Tue, 10 May 2016 15:42:48 +0000 (17:42 +0200)]
fixing typos in bonduitls.py and iproute2.py

Ticket: None
Reviewed By: Roopa
Testing Done:

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
7 years agoaddons: mstpctl: bpdu filter and bpdu guard enabled by default for vxlan device
Nikhil [Fri, 6 May 2016 05:09:49 +0000 (22:09 -0700)]
addons: mstpctl: bpdu filter and bpdu guard enabled by default for vxlan device

Ticket: CM-7678
Reviewed By: Roopa Prabhu
Testing Done: yes, with vlan aware/unaware bridge on dell-s3000-02

This patch enables bpdu filter and bpdu guard enabled for vxland device under
the bridge if these two attributes are unconfigured

Signed-off-by: Nikhil <nikhil@cumulusnetworks.com>
7 years agoStaging cl3u3 version for merge to stable and release
John Berezovik [Sun, 5 Jun 2016 16:03:45 +0000 (09:03 -0700)]
Staging cl3u3 version for merge to stable and release

7 years agoifupdownaddons: iproute2: warn when using keywords and better parsing vlanid in ip...
Julien Fortin [Thu, 2 Jun 2016 14:31:43 +0000 (15:31 +0100)]
ifupdownaddons: iproute2: warn when using keywords and better parsing vlanid in ip link show output

Ticket: CM-11214
Reviewed By: Roopa
Testing Done: Tested with customer configuration

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
7 years agoaddons: vrf: error on no master only when ALL interfaces are being
Roopa Prabhu [Tue, 31 May 2016 23:25:07 +0000 (16:25 -0700)]
addons: vrf: error on no master only when ALL interfaces are being
brought up

Ticket: CM-11016
Reviewed By: julien, nikhil
Testing Done: tested with config in the CM bug

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
8 years agoaddons: vrf: Correcting 'vrf-table' usage example
Nikhil [Wed, 18 May 2016 23:33:08 +0000 (16:33 -0700)]
addons: vrf: Correcting 'vrf-table' usage example

Ticket: CM-11041
Reviewed By: Roopa Prabhu
Testing Done: yes, all ifupdown2 commands for a vrf deive

<DETAILED DESCRIPTION (REPLACE)>

Signed-off-by: Nikhil <nikhil@cumulusnetworks.com>
8 years agoifreload: --currently-up fixes
Roopa Prabhu [Tue, 17 May 2016 00:00:39 +0000 (17:00 -0700)]
ifreload: --currently-up fixes

Ticket:
Review: julien, nikhil
Testing: tested reloading currently up interfaces

simplify code:
interfaces-to-reload = saved-interfaces - interfaces-not-present-in-interfaces-file

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
8 years agoifupdownmain: return proper error code on syntax check errors
Roopa Prabhu [Sun, 15 May 2016 21:17:56 +0000 (14:17 -0700)]
ifupdownmain: return proper error code on syntax check errors

Ticket: CM-7168
Reviewed By: julien
Testing Done: Tested ifupdown2 negative testcases and ran ifupdown2 smoke

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
8 years agoaddons: move some warns to errors and make sure all errors set the exit
Roopa Prabhu [Sun, 15 May 2016 20:28:10 +0000 (13:28 -0700)]
addons: move some warns to errors and make sure all errors set the exit
code correctly

Ticket: CM-7168
Reviewed By: julien
Testing Done: Tested ifupdown2 negative testcases and ran ifupdown2 smoke

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
8 years agoifupdownaddons: iproute2: fix set_mtu api to return if --no-act (DRYRUN) is set
Roopa Prabhu [Sun, 15 May 2016 20:49:05 +0000 (13:49 -0700)]
ifupdownaddons: iproute2: fix set_mtu api to return if --no-act (DRYRUN) is set

Ticket: CM-10965
Reviewed By: julien
Testing Done: Tested set mtu with dry run

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
8 years agoaddons: vrf: vrf_slave: up vrf dev only when all interfaces are being
Roopa Prabhu [Sat, 14 May 2016 05:44:50 +0000 (22:44 -0700)]
addons: vrf: vrf_slave: up vrf dev only when all interfaces are being
brought up

Ticket: CM-10954, CM-10953
Reviewed By: julien
Testing Done: ran ifupdown2 smoke and vrf ifup/ifdown testing

- vrf master if not around is brought up when the first slave is brought up
by design (because we want the slaves to be
enslaved to a vrf master before addresses are configured).
and master is not brought up by first because interfaces
are brought up down to top in the dependency tree.

- This patch makes sure a slave brings up a vrf master only
when all interfaces are specified. When an individual interface
is brought up, skip master bring up and throw an error.

- Since the addon modules also need to use the ALL and WITH_DEPENDS
  flags, this patch moves them to the existing global ifupdownflags
  class

- vrf module uses the ifupdownflags.ALL flag to not bring up the master
when only the slave is being brought up

example:
ifup <vrf>      # brings up the vrf device
ifup <vrf> --with-depends  # brings up the vrf dev and
# its slaves
ifup <vrf_slave> # if vrf master is not around,
# an error is thrown
ifup <vrf_slave> --with-depends # will still not bring up the vrf master

ifdown <vrf> # deletes vrf dev and flushes the
# addresses on vrf slaves
ifup <vrf> # brings up vrf dev and does not
# up the adresses on the slaves
ifup <vrf> --with-depends # will bring up vrf and reapply config
# on slaves (including addresses)

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
8 years agoifupdown2: ifreload: enable dry run (--no-act) and other dry run fixes
Roopa Prabhu [Fri, 13 May 2016 05:11:15 +0000 (22:11 -0700)]
ifupdown2: ifreload: enable dry run (--no-act) and other dry run fixes

Ticket: CM-10965
Reviewed By: julien
Testing Done: Tested dry-run option

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
8 years agoaddons: bridge: Deprecating attribute bridge-gcint
Nikhil [Wed, 11 May 2016 00:53:41 +0000 (17:53 -0700)]
addons: bridge: Deprecating attribute bridge-gcint

Ticket: CM-8718
Reviewed By: Roopa Prabhu
Testing Done: yes, by installing ifupdown2 .deb file onto dell-s3000-02

Signed-off-by: Nikhil <nikhil@cumulusnetworks.com>
8 years agoaddons: address virtual: adding 0s to (if necessary) pad address-virtual
Julien Fortin [Tue, 10 May 2016 15:23:28 +0000 (17:23 +0200)]
addons: address virtual: adding 0s to (if necessary) pad address-virtual

Ticket: CM-10853
Reviewed By: Roopa
Testing Done: Tested with the provided interface file and different
address-virtual value.

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
8 years agoaddons: address: force reapply addresses during dhcp to static trasition
Roopa Prabhu [Tue, 10 May 2016 01:48:52 +0000 (18:48 -0700)]
addons: address: force reapply addresses during dhcp to static trasition

Ticket: CM-10857
Reviewed By: julien, nikhil
Testing Done: Tested moving from a dhcp to static addr method for eth0

before the patch:
- when moving from dhcp to static address method, after releasing the dhcp
address, it takes a few seconds for the dhcp address to go away. When we
query addresses to configure, there is a chance that we may end up
getting the dhcp address for a few seconds. Which is ok until when the
static address to be configured is same as the dhcp address.
In which case we end up not configuring the static address because we
think it is already configured (per the running list).

After this patch:
- when moving from dhcp to static address method, we always re-apply the
address config avoiding the chance of not configuring an address due to a
dhcp address sticking around.

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
8 years agoaddons: address: fix call to dhclient is_running
Roopa Prabhu [Mon, 9 May 2016 20:50:56 +0000 (13:50 -0700)]
addons: address: fix call to dhclient is_running

Ticket: CM-10857
Reviewed By: julien, nikhil
Testing Done: Tested moving from a static to dhcp addr method for eth0

the check to see if dhclient is running on an interface was failing.
which caused the following problem:
- interface when moved from dhcp to static addr_method was
not killing the existing dhcp process
- and a subsequent move from static to dhcp addr_method quit starting
dhcp because a dhclient process was already running
- but the original dhcp ip was already removed because of the
static address config which leaves eth0 in a weird state

After this patch:
- move from dhcp to static addr_method will release any
existing dhcp leases on an interface
- a subsequent move from static to dhcp will request a new
dhcp lease

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
8 years agoaddons: mstpctl: deprecate mstpctl-ports in favor of bridge-ports
Roopa Prabhu [Mon, 9 May 2016 14:41:20 +0000 (07:41 -0700)]
addons: mstpctl: deprecate mstpctl-ports in favor of bridge-ports

Ticket:
Reviewed By:
Testing Done: ran l2 smoke

usage of mstpctl-ports will now give you a warning:
warning: attribute mstpctl-ports is deprecated. use bridge-ports instead.

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
8 years agodebian: replace all cumulus email ids to dev-support@cumulusnetworks.com
Roopa Prabhu [Sun, 8 May 2016 03:22:47 +0000 (20:22 -0700)]
debian: replace all cumulus email ids to dev-support@cumulusnetworks.com

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
8 years agoaddons: mstpctl: call disable_ipv6 only if mstpctl_ports is specified
Roopa Prabhu [Sun, 8 May 2016 02:32:23 +0000 (19:32 -0700)]
addons: mstpctl: call disable_ipv6 only if mstpctl_ports is specified

Ticket:
Reviewed By: trivial
Testing Done: tested sanity and bridge bringup and reload

bridge module already disables ipv6 on ports when bridge-ports is
specified. Making this change because i saw redundant calls to
disable_ipv6 on bridge ports by modules bridge and mstpctl
when bridge-ports is specified. It is slowing down ifreload

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
8 years agoifupdownmain: cosmetic fixes to deprecated warning message
Roopa Prabhu [Sun, 8 May 2016 02:31:16 +0000 (19:31 -0700)]
ifupdownmain: cosmetic fixes to deprecated warning message

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
8 years agoifupdownmain: fix error check when an iface is removed but still exists as a dependency
Roopa Prabhu [Sun, 8 May 2016 01:27:05 +0000 (18:27 -0700)]
ifupdownmain: fix error check when an iface is removed but still exists as a dependency

Ticket: CM-8095
Reviewed By: julien, nikhil
Testing Done: Tested ifupdown2 sanity and unclean removal of interfaces from the
interfaces file

example: for the below interfaces file,
{noformat}
auto bond2
iface bond2 inet static
    address 100.0.0.2/16
    bond-slaves swp3 swp4

auto bridge
iface bridge
        bridge-vlan-aware yes
        bridge-ports swp1 swp2 bond2
        bridge-vids 12 505
        bridge-stp on

auto swp1
iface swp1
       mtu 9000

{noformat}

when iface sections for bond2 and swp1 are removed from the interfaces file
but left as dependents of bridge, on an ifreload:

prior to this patch:
===================
- ifreload would throw a warning for both bond2 and swp1
warning: bond2: misconfig ? removed but still exists as a dependency of
['bridge']
warning: swp1: misconfig ? removed but still exists as a dependency of
['bridge']

after the patch:
================
- ifreload  will now correctly throw a warning only for bond2
warning: bond2: misconfig ? removed but still exists as a dependency of
['bridge']

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
8 years agoaddons: address: reset mtu to default for physical interfaces which are
Roopa Prabhu [Thu, 5 May 2016 22:49:41 +0000 (15:49 -0700)]
addons: address: reset mtu to default for physical interfaces which are
not bond slaves

Ticket: CM-9449
Reviewed By: julien
Testing Done: Tested resetting mtu on physical interfaces to default

default mtu is already present in address.json policy file. This patch
continues to take a cautious and conservative approach to
reset mtu of only physical interfaces if different from default mtu
and mtu is not given by the user. bond slaves get their mtu from
the bond when bond has a configured mtu. so this patch only
resets mtu on physical interfaces which are not bond slaves.

{noformat}
$cat /var/lib/ifupdown2/policy.d/address.json
{
    "address": {
"defaults": { "mtu": "1500" }
    }
}
{noformat}

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
8 years agoaddons: vrf: flush addresses and down slaves before deleting vrf device
Roopa Prabhu [Thu, 5 May 2016 20:29:02 +0000 (13:29 -0700)]
addons: vrf: flush addresses and down slaves before deleting vrf device

Ticket: CM-10785
Reviewed By: julien nikhil dsa dwalton
Testing Done: tested vrf device down and reload

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
8 years agodocs: examples: generate_interfaces: display unsupported message when porttab file...
Julien Fortin [Wed, 4 May 2016 23:44:32 +0000 (01:44 +0200)]
docs: examples: generate_interfaces: display unsupported message when porttab file is not found

Ticket: CM-10751
Reviewed By: Roopa, Nikhil
Testing Done: tested the script with and without porttab file

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
8 years agodebian: changelog: update for new release: 1.1-cl3u2
Julien Fortin [Wed, 4 May 2016 18:17:17 +0000 (20:17 +0200)]
debian: changelog: update for new release: 1.1-cl3u2

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
8 years agoDeprecating `mstpctl-stp` attribute
Julien Fortin [Tue, 3 May 2016 15:40:30 +0000 (17:40 +0200)]
Deprecating `mstpctl-stp` attribute

Ticket: CM-10476
Reviewed By: Roopa
Testing Done: Using mstpctl-stp attribute in a stanza will display a warning

8 years agobridge: display warning when (in vlan unware bridge) an untagged bridge is not configured
Julien Fortin [Fri, 29 Apr 2016 19:22:52 +0000 (21:22 +0200)]
bridge: display warning when (in vlan unware bridge) an untagged bridge is not configured

Ticket: CM-8173
Reviewed By: Roopa
Testing Done: smoke + vlan aware and non-aware bridges with untagged bridge without untagged bridge.

8 years agomstp: performances: now globaly caching "mstpctl showportdetail <bridgename> json...
Julien Fortin [Fri, 29 Apr 2016 19:21:45 +0000 (21:21 +0200)]
mstp: performances: now globaly caching "mstpctl showportdetail <bridgename> json" calls

Ticket: CM-10273
Reviewed By: Roopa
Testing Done: Smoke + test from the ticket

8 years agonew ifupdown2.conf variable to adjust logical devices MTU
Julien Fortin [Fri, 29 Apr 2016 19:19:42 +0000 (21:19 +0200)]
new ifupdown2.conf variable to adjust logical devices MTU

Ticket: CM-8736
Reviewed By: Roopa
Testing Done: Smoke tests + the ones from the ticket

By default ifupdown2 will adjust logical devices MTU
based on the physical interface they are running on top of.
set this flag to 0 to disable this behaviour
adjust_logical_dev_mtu=1

8 years agoaddons: vrf: do not write vrf map to disk during query operation
Roopa Prabhu [Thu, 28 Apr 2016 22:49:46 +0000 (15:49 -0700)]
addons: vrf: do not write vrf map to disk during query operation

Ticket: CM-10569
Reviewed By: julien, nikhil
Testing Done: Tested ifquery -c as non root user

unlike ifup/ifdown/ifreload, ifquery can be called by a
non-root user. so make sure we dont write the root owned
vrf map file during ifquery

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
8 years agoaddons: vrf: add a check and error for reserved system table names
Roopa Prabhu [Wed, 27 Apr 2016 23:05:09 +0000 (16:05 -0700)]
addons: vrf: add a check and error for reserved system table names

Ticket:
Reviewed By: dsa, nikhil, julien
Testing Done: Tested with system reserved table names

example: err msg:
$ifquery default
auto default
iface default
vrf-table auto

error: default: cannot use system reserved ['253', '0', '254',
'255'] table names

This patch makes all tables in  /etc/iproute2/rt_tables reserved

$cat /etc/iproute2/rt_tables
255 local
254 main
253 default
0 unspec

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
8 years agoaddons: adding '--with-defaults' option for base ifquery
Nikhil [Tue, 26 Apr 2016 22:00:08 +0000 (15:00 -0700)]
addons: adding '--with-defaults' option for base ifquery

Ticket: CM-7840
Reviewed By: Roopa Prabhu
Testing Done: yes, with different configurations for physical & logical devices

This patch adds 'ifquery --with-defaults' to print the policy default
values for unconfigured attributes.

Signed-off-by: Nikhil <nikhil@cumulusnetworks.com>
8 years agoaddons: bridge: fixing: bridge disable_ipv6 is not handle on down anymore.
Julien Fortin [Tue, 26 Apr 2016 15:10:09 +0000 (17:10 +0200)]
addons: bridge: fixing: bridge disable_ipv6 is not handle on down anymore.

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

8 years agoifreload: enable CACHE flag during up of interfaces
Roopa Prabhu [Tue, 26 Apr 2016 05:27:31 +0000 (22:27 -0700)]
ifreload: enable CACHE flag during up of interfaces

Ticket: CM-10273
Reviewed By: julien
Testing Done: Tested with scale config in the bug

8 years agoaddons: mgmtvrf with static IP needs to support 'gateway'
Nikhil [Tue, 26 Apr 2016 01:48:01 +0000 (18:48 -0700)]
addons: mgmtvrf with static IP needs to support 'gateway'

Ticket: CM-10281
Reviewed By: Roopa Prabhu
Testing Done: Tested with the configuration mentioned in the bug id

Due to bug CM-10188, defualt route via gateway is not installed in time.
It needs 2 sec delay, and fix to CM-10188 shall rectify this issue.

Signed-off-by: Nikhil <nikhil@cumulusnetworks.com>