]> git.proxmox.com Git - mirror_ifupdown2.git/log
mirror_ifupdown2.git
8 years agodebian: Add new SKIP_DOWN_AT_SYSRESET /etc/init.d/networking config option to skip...
Roopa Prabhu [Sun, 3 Apr 2016 17:29:33 +0000 (10:29 -0700)]
debian: Add new SKIP_DOWN_AT_SYSRESET /etc/init.d/networking config option to skip deconfiguring interfaces

Ticket: CM-5900
Reviewed By: CCR-2921
Testing Done: Tested 'service networking stop' during system reboot and shutdown

this is cherry-pick of cumulus-3.2.y commit ac231e966a04eb78153d9b53f0d236a149c7bba5

8 years agoRevert "addons: vrf: ifquery fixes for vrf"
Nikhil [Sat, 2 Apr 2016 04:29:48 +0000 (21:29 -0700)]
Revert "addons: vrf: ifquery fixes for vrf"

This reverts commit 934c4c49c0e77289e7d56349c44d14ca2c307621.

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

default addr fix for vrf check is deleting lo addrs accidentally
info: rtnetlink: setting link lo up
info: executing ip addr del ::1/128 dev lo
info: executing ip addr del 127.0.0.1/8 dev lo
info: eth0: running ops ...

Signed-off-by: Nikhil <nikhil@cumulusnetworks.com>
8 years agoaddons: bridge: make sure bridge port enslavement is done by the bridge
Roopa Prabhu [Fri, 1 Apr 2016 04:39:55 +0000 (21:39 -0700)]
addons: bridge: make sure bridge port enslavement is done by the bridge
when it is non-vlan filtering bridge

Ticket: CM-10083
Reviewed By: nikhil, julien
Testing Done: Tested ifreload testcase with CM-10083

Without this patch a bridge port could enslave itself to the bridge
when it finds that the bridge is around. This is a required feature
for vlan filtering bridge because vlan filtering bridge port attributes
are specified under the bridge port and the bridge port needs the power
to enslave to the bridge and apply bridge port attrs.

For the non-vlan filtering bridge, a few bridge port combinations are
not allowed by default (eg, mixing different vlans under the same bridge).
The bridge has the understanding of which ports are allowed. so only it
should have the power to enslave bridge ports. This patch enforces that
power. With this patch the sequence of deleting and enslaving bridge
ports is done at the bridge with deletes followed by adds.

example verbose snippent from ifreload output:
ip -force -batch - [link set dev swp49s0 nomaster
link set dev swp49s1 nomaster
link set dev swp49s0.300 master Oldbr
addr flush dev swp49s0.300
link set dev sidelink.300 master Oldbr
addr flush dev sidelink.300
link set dev swp49s1.300 master Oldbr
addr flush dev swp49s1.300
link set dev swp4 master Oldbr
addr flush dev swp4]

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
8 years agoaddons: vrf: redo iproute2 vrf interface map handling
Roopa Prabhu [Thu, 31 Mar 2016 23:09:37 +0000 (16:09 -0700)]
addons: vrf: redo iproute2 vrf interface map handling

Ticket: CM-10188, CM-10061
Reviewed By: dsa, nikhil, julien
Testing Done: Tested static routes with vrf names for tables

This patch does the following:
- if a single vrf device is present in the config,
builds the vrf map by reading vrf interfaces from the kernel (with
existing link cache. Builds a shadow vrf only attribute cache)
- reads existing table map and adjusts it if required
- main change is the iproute2 map file on disk is updated
immediately on vrf creation, so that static routes used along with the
vrf slaves can use the vrf name for the table. This also helps dhclient dns
hook script which may use mgmt table name directly.
- cleans up default routes on down

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
8 years agoaddons: vrf: more fixes and cleanups for mgmt and data vrf handling
Roopa Prabhu [Thu, 31 Mar 2016 06:32:59 +0000 (23:32 -0700)]
addons: vrf: more fixes and cleanups for mgmt and data vrf handling

Ticket: CM-10188, CM-9881
Reviewed By: nikhil, julien, dsa, daniel
Testing Done: Tested mgmt vrf bringup, teardown, static routes at boot
etc

This patch fixes a few things:
- kill existing ssh clients on enslavement change for mgmt vrf (original patch by NikhilG)
- bring vrf master up first during vrf slave enslavement if
master does not exist. This was originally done only for
vrf dhcp slaves. With this patch we do it for all vrf slaves.
needed for static routes on vrf slaves (CM-10188).
- cleanup: reorganize code and a few cleanups and corner case handling

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
Signed-off-by: Nikhil Gajendrakumar <nikhil@cumulusnetworks.com>
8 years agoifupdownmain: redo shared dependent checks
Roopa Prabhu [Wed, 30 Mar 2016 18:54:58 +0000 (11:54 -0700)]
ifupdownmain: redo shared dependent checks

Ticket: CM-10027
Reviewed By: julien, nikhil
Testing Done: Tested with an interfaces file with shared dependents

In the process of fixing this saw a few more issues with link kind
handing. Its better to separate kind from interface private flags
like bond slave and bridge port. this patch cleans up all that handling.

Example errors:
error: misconfig..? swp5.2 vrfslave  is enslaved to multiple interfaces
['vrf1012', 'br2']
error: misconfig..? swp5.2 bridgeport  is enslaved to multiple
interfaces ['vrf1012', 'br2']

8 years agoifupdownmain: don't down vrf master in sched callback ops
Roopa Prabhu [Fri, 25 Mar 2016 04:55:58 +0000 (21:55 -0700)]
ifupdownmain: don't down vrf master in sched callback ops

This was bringing down vrf master earlier than required
leading to ssh session hangs in case of management vrf

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
8 years agoaddons: vrf: ifquery fixes for vrf
Nikhil [Wed, 30 Mar 2016 23:56:37 +0000 (16:56 -0700)]
addons: vrf: ifquery fixes for vrf

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

This patch fixes inappropriate ifquery fails.
This patch also include a review comment update for addressvirtual.py
[CCR-4310], ticket: [CM-8658]
Signed-off-by: Nikhil <nikhil@cumulusnetworks.com>
8 years agoaddons/bridge.py: fixing potential None type issue
Julien Fortin [Tue, 29 Mar 2016 02:29:24 +0000 (04:29 +0200)]
addons/bridge.py: fixing potential None type issue

8 years agosbin/ifupdown2: cleanup unreachable code and refactor update_ifupdown2_argparser...
Julien Fortin [Mon, 28 Mar 2016 23:50:47 +0000 (01:50 +0200)]
sbin/ifupdown2: cleanup unreachable code and refactor update_ifupdown2_argparser to update_common_argparser

Ticket: CM-8564

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
8 years agoaddons/bridge.py: warn and ignore bridge-ports duplicate lines
Julien Fortin [Mon, 28 Mar 2016 22:47:03 +0000 (00:47 +0200)]
addons/bridge.py: warn and ignore bridge-ports duplicate lines

Ticket: CM-8744
Reviewed By: CCR-4321

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
8 years agosbin/ifupdown2: Adding -V/--version argument to display current ifupdown2 version
Julien Fortin [Mon, 28 Mar 2016 19:23:03 +0000 (21:23 +0200)]
sbin/ifupdown2: Adding -V/--version argument to display current ifupdown2 version

Ticket: CM-8564
Reviewed By: CCR-4369

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
8 years agoifupdownmain: Reverting commit 25f41c2ab3c3daeee81d7ed371b8c4ca29091011
Nikhil [Sat, 26 Mar 2016 01:51:57 +0000 (18:51 -0700)]
ifupdownmain: Reverting commit 25f41c2ab3c3daeee81d7ed371b8c4ca29091011

Ticket: CM-10112
Reviewed By: Shrijeet Mukherjee, Natarajan Sankaran
Testing Done: yes, by installing ifupdown .deb file onto act-5712-09

Signed-off-by: Nikhil <nikhil@cumulusnetworks.com>
8 years agoaddons: vrf: temporarily disable kill_ssh
Roopa Prabhu [Fri, 25 Mar 2016 15:22:09 +0000 (08:22 -0700)]
addons: vrf: temporarily disable kill_ssh

Ticket: CM-10094
Reviewed By:
Testing Done:

It is killing ifupdown2 and setsid is not working as expected

8 years agoaddons: vrf: drop ssh connections over eth0 on enable or disable
Nikhil [Fri, 25 Mar 2016 07:45:24 +0000 (00:45 -0700)]
addons: vrf: drop ssh connections over eth0 on enable or disable

Ticket: CM-9881
Reviewed By: Roopa Prabhu
Testing Done: yes

This patch is the second version of drop ssh sessions
changes:
    added try catch around os.setsid()

Signed-off-by: Nikhil <nikhil@cumulusnetworks.com>
8 years agoaddons: vrf: more ordering fixes for management vrf and dhcp vrf slaves
Roopa Prabhu [Fri, 25 Mar 2016 04:59:54 +0000 (21:59 -0700)]
addons: vrf: more ordering fixes for management vrf and dhcp vrf slaves

fixes the following:
- if the vrf slave had a master but is no longer a slave
according to ifaceobj, look at running state and
undo vrf enslavement
- add support to cl-vrf service disable <vrf>

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
8 years agoifupdownmain: don't down vrf master in sched callback ops
Roopa Prabhu [Fri, 25 Mar 2016 04:55:58 +0000 (21:55 -0700)]
ifupdownmain: don't down vrf master in sched callback ops

This was bringing down vrf master earlier than required
leading to ssh session hangs in case of management vrf

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
8 years agoaddons: vrf: drop ssh connections over eth0 on enable or disable
Nikhil [Thu, 24 Mar 2016 18:55:52 +0000 (11:55 -0700)]
addons: vrf: drop ssh connections over eth0 on enable or disable

Ticket: CM-9881
Reviewed By: Roopa Prabhu
Testing Done: yes

***initial version ***
SSH clients will be closed to avoid the connection hang
when management VRF is enabled or disabled using a login through eth0
Signed-off-by: Nikhil <nikhil@cumulusnetworks.com>
8 years agoaddons: vrf: down the slave after unslaving during down
Roopa Prabhu [Thu, 24 Mar 2016 06:51:11 +0000 (23:51 -0700)]
addons: vrf: down the slave after unslaving during down

Ticket: CM-10050
Reviewed By:
Testing Done: tested with bridge testcase described in the bug

8 years agoscheduler: do not propagate upperiface bring up error state
Roopa Prabhu [Thu, 24 Mar 2016 05:24:30 +0000 (22:24 -0700)]
scheduler: do not propagate upperiface bring up error state

Ticket: CM-10016
Reviewed By:
Testing Done: Tested with the upperiface bring up case described in
CM-10016

upperiface bringup is best effort and does not imply that the current
interface bring up has an error. It only means that the upperiface may
be in an incomplete state. Hence this patch resets scheduler error state
before returning from upperiface bringup.

8 years agoaddons: vrf: delete rules before deleting the vrf interface on down
Roopa Prabhu [Thu, 24 Mar 2016 04:12:47 +0000 (21:12 -0700)]
addons: vrf: delete rules before deleting the vrf interface on down

Ticket: CM-10057
Reviewed By: trivial
Testing Done: Tested ifdown of a vrf interface

8 years agoaddons: vrf: enforce reserved table id range 1001-5000
Roopa Prabhu [Thu, 24 Mar 2016 02:33:16 +0000 (19:33 -0700)]
addons: vrf: enforce reserved table id range 1001-5000

Ticket:
Reviewed By:
Testing Done: Tested vrf-table id with valid and invalid table ids

currently the reserved table id range is set to 1001-5000
and it comes from a policy file /var/lib/ifupdown2/policy.d/vrf.json

8 years agoaddons: vrf: during down of a vrf device make sure to refresh dhcp slaves
Roopa Prabhu [Thu, 24 Mar 2016 02:04:59 +0000 (19:04 -0700)]
addons: vrf: during down of a vrf device make sure to refresh dhcp slaves

Ticket: CM-10049
Reviewed By:
Testing Done: Tested disabling management vrf

8 years agoaddons: vrf: multiple fixes to vrf enslavement and auto handling
Roopa Prabhu [Wed, 23 Mar 2016 07:08:34 +0000 (00:08 -0700)]
addons: vrf: multiple fixes to vrf enslavement and auto handling

Ticket: CM-10005
Reviewed By:
Testing Done: Tested boot and ifreload after changes

- fix access to addr_method on an object which had no
address method defined. This was a recently introduced
regression that caused vrf enslavement to end per-matuarely.
- few fixes around vrf_table conversion between string
and integer

8 years agoaddons: vrf: use full path to cgdelete
Roopa Prabhu [Wed, 23 Mar 2016 04:38:23 +0000 (21:38 -0700)]
addons: vrf: use full path to cgdelete

Ticket: CM-10018
Reviewed By: trivial
Testing Done: Tested ifdown of vrf device

8 years agoscheduler: fix incorrect check of SCHED_STATUS
Roopa Prabhu [Tue, 22 Mar 2016 21:11:23 +0000 (14:11 -0700)]
scheduler: fix incorrect check of SCHED_STATUS

Ticket: CM-9993
Reviewed By: julien
Testing Done: Tested with interfaces file and steps described in the CM

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
8 years agoifquery --running should not display link attributes unless they are different then...
Sam Tannous [Tue, 22 Mar 2016 19:53:05 +0000 (15:53 -0400)]
ifquery --running should not display link attributes unless they are different then defaults.

Ticket: CM-9995
Reviewed By: julien
Testing Done: Tested on amd64 hardnode

Right now, ifquery -r shows link speed, duplex and autoneg current running values.
This patch changes the behavior to not show link attributes unless they
differ then the defaults for that interface.

8 years agoaddons: vrf: move ip -6 fib rule for local table
Nikhil [Mon, 21 Mar 2016 19:39:18 +0000 (12:39 -0700)]
addons: vrf: move ip -6 fib rule for local table

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

patch to move ip -6 fib rule for local table after vrf rules

Signed-off-by: Nikhil <nikhil@cumulusnetworks.com>
8 years agoaddons: vrf: Avoid adding duplicate fib6 rule
Nikhil [Mon, 21 Mar 2016 18:56:39 +0000 (11:56 -0700)]
addons: vrf: Avoid adding duplicate fib6 rule

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

Avoid adding duplicate ipv6 fib rule when one is missing for IPv4

8 years agoaddons: addressvirtual: vrr virtual mac multicast bit check
Nikhil [Thu, 17 Mar 2016 20:01:26 +0000 (13:01 -0700)]
addons: addressvirtual: vrr virtual mac multicast bit check

Ticket: CM-8658
Reviewed By: Roopa Prabhu, Scott Emery
Testing Done: Yes, by installing ifupdown .deb file onto cel-e1031-01

This patch includes a check for multicast bit of vrr virtual mac
address and set an error

Signed-off-by: Nikhil <nikhil@cumulusnetworks.com>
8 years agonetworkinterfaces: don't warn if sourced lines contain globs
Roopa Prabhu [Sun, 20 Mar 2016 02:45:33 +0000 (19:45 -0700)]
networkinterfaces: don't warn if sourced lines contain globs

Ticket: CM-9908
Reviewed By: julien
Testing Done: tested sourcing files with globs and non-globs

warn if sourced line has a glob ('*')

8 years agoaddons: vrf: fix a few vrf enslavement and table id allocation corner cases
Roopa Prabhu [Sat, 19 Mar 2016 04:25:09 +0000 (21:25 -0700)]
addons: vrf: fix a few vrf enslavement and table id allocation corner cases

Ticket: CM-9957
Reviewed By: dsa, julien, nikhil
Testing Done: Tested vrf enslave/deslave + ifreload

This patch fixes a few corner cases:
- release dhcp on all new enslavement or change of enslavement
- fix a NoneType error on ifreload when a vrf enslavement was removed
- handle a corner case with auto table ids

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
8 years agoifupdownmain: scheduler: propagate sched error on interfaces to upper layers
Roopa Prabhu [Fri, 18 Mar 2016 18:27:42 +0000 (11:27 -0700)]
ifupdownmain: scheduler: propagate sched error on interfaces to upper layers

Ticket: CM-7168
Reviewed By: julien, nikhil, stannous
Testing Done: Tested with errors in interfaces file

This patch changes a few errors to warns. and propagates errors
on ifaceobjects to upperlayers.

- any exception passed to upper layers (/sbin/ifupdown) results in
exit code of 1

- It uses a global SCHED flag to flag a scheduler error (maybe there is
  a better way). But traversing all the interfaces again to check status
is an overkill

- Changes a few errors to warns

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
8 years agoaddons: vrf: fix cases where auto was getting written to iproute2 vrf map
Roopa Prabhu [Fri, 18 Mar 2016 18:22:22 +0000 (11:22 -0700)]
addons: vrf: fix cases where auto was getting written to iproute2 vrf map

Ticket:
Reviewed By: trivial
Testing Done:

This also changes a few errors to warn

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
8 years agoifupdownmain: ifreload: log a message if no new interfaces found
Roopa Prabhu [Thu, 17 Mar 2016 23:23:40 +0000 (16:23 -0700)]
ifupdownmain: ifreload: log a message if no new interfaces found

Ticket:
Reviewed By: trivial
Testing Done:

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
8 years agoaddons: vrf: release any dhcp leases before vrf slave enslavement
Roopa Prabhu [Thu, 17 Mar 2016 23:18:14 +0000 (16:18 -0700)]
addons: vrf: release any dhcp leases before vrf slave enslavement

Ticket: CM-9929
Reviewed By:
Testing Done: Tested vrf dhcp slave enslavement on ifreload

algo:
- when a vrf slave enslavement changes, before performing the
  new master enslavement,
- check if vrf slave has dhcp configured
- if yes, release dhclient running on the vrf slave

8 years agoaddons: vrf: set metric 240 for vrf installed default unreachable routes
Roopa Prabhu [Thu, 17 Mar 2016 19:34:56 +0000 (12:34 -0700)]
addons: vrf: set metric 240 for vrf installed default unreachable routes

Ticket: CM-9934
Reviewed By: trivial
Testing Done: Tested vrf create and destroy

8 years agoaddons: vrf: handle auto table ids for dhcp slaves
Roopa Prabhu [Thu, 17 Mar 2016 16:07:53 +0000 (09:07 -0700)]
addons: vrf: handle auto table ids for dhcp slaves

Ticket: CM-9921
Reviewed By: trivial
Testing Done: Tested with table id auto for management vrf

I have recently added special handling for vrf slaves with dhcp.
And missed handling of vrf-table auto for such slaves.
This patch fixes auto when bringing up vrf masters for dhcp vrf
slaves

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
8 years agoifupdownmain: squash multiple iface stanzas for the same interface by
Roopa Prabhu [Thu, 17 Mar 2016 01:38:43 +0000 (18:38 -0700)]
ifupdownmain: squash multiple iface stanzas for the same interface by
default

Ticket:
Reviewed By: CCR-4268 (previous review)
Testing Done: Tested ifup/ifdown/ifreload/ifquery of multiple iface stanzas for
same interface

This patch is an extension to previous commit 99ce689411b.
The previous commit squashes both external (ifquery) and internal
(ifup/ifdown/ifreload) representation of multiple iface stanzas into
one and it is off by default.

What we really want is internal representation to be squashed by
default. To that effect this patch introduces a new config flag
ifaceobj_squash_internal to only squash internal representation which is
used by ifup/ifdown/ifreload. ifquery forces this flag to off so that
external representations remain unsquashed and user does not see any
difference. This flag is on by default.

User can still get a squashed external representation if he sets
ifaceobj_squash=1 in ifupdown2.conf

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
8 years agodocs: Update mgmt vrf example
David Ahern [Wed, 16 Mar 2016 23:33:40 +0000 (17:33 -0600)]
docs: Update mgmt vrf example

Change mgmt vrf name to just 'mgmt'
Add loopback address
Change table from 252 to auto

Signed-off-by: David Ahern <dsa@cumulusnetworks.com>
8 years agoaddons: vrf: avoids ifupdown2 error when VRF defined but not used
Nikhil [Mon, 14 Mar 2016 23:45:12 +0000 (16:45 -0700)]
addons: vrf: avoids ifupdown2 error when VRF defined but not used

Ticket: CM-9596
Reviewed By: Roopa Prabhu
Testing Done: Yes, by installing ifupdown2 deb onto cel-e1031-01

This patch makes sure ifupdown2 will not report a NoneType error
when VRF is defined but not used

8 years agoDetect and ignore the `ether` keyword in /etc/network/interface
Julien Fortin [Tue, 15 Mar 2016 14:41:04 +0000 (15:41 +0100)]
Detect and ignore the `ether` keyword in /etc/network/interface

Ticket: CM-6896
Reviewed By: CCR-4276
Testing Done:

host: sm-e1031-02

$ # > adding "hwaddress 02:01:02:03:04:08" to eth0 in /etc/network/interfaces
$ ifreload -a
$ ifup -v -a
$ ifdown -a -v
$ ifquery -c -a
$ reboot
$ # > analyze /var/log/syslog for boot error message
$ cat /var/log/syslog | grep ifupdown

I did the same process with "hwaddress ether 02:01:02:03:04:11"
also without the hwaddress statement.

8 years agoaddons: vrf: special handling for vrf slaves configured for dhcp
Roopa Prabhu [Tue, 15 Mar 2016 05:38:37 +0000 (22:38 -0700)]
addons: vrf: special handling for vrf slaves configured for dhcp

Ticket: CM-9868
Reviewed By: dsa, nikhil, julien
Testing Done: tested with vrf slaves with dhcp

Problem:
since vrf slaves are brought up before master, When vrf slaves are
configured for dhcp, the dhclient hook for vrf runs before the master is
up. This was seen with management vrf.
This solution is special logic to handle vrf slaves with
dhcp in the vrf addon module.

currently only supports interface declared with dhcp and
indicated as vrf slave. as in example below (dhcp and vrf must be in the
same iface stanza):

auto eth0
iface eth0 inet dhcp
        vrf mgmt

changes to vrf module:
- make vrf module methods accept the ifaceobj lookup function, which is
already passed as argument to all methods from ifupdown scheduler
- during vrf slave bringup,
        - if master does not exist and slave's address_method is dhcp
        - lookup master object, and bring up the vrf master
        - mark this master as processed so that the next time this vrf
          module sees master it knows that it is already processed
          (this is covered by the vrfPrivFlags)

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
8 years agoaddons: vrf: use full path to cgcreate and cgset
Roopa Prabhu [Tue, 15 Mar 2016 05:05:49 +0000 (22:05 -0700)]
addons: vrf: use full path to cgcreate and cgset

This avoids 'No such file or directory' errors at bootup
when ifupdown2 is called from the init script

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
8 years agoaddons: vrf: fix typo in reading vrf-max-count attribute name get at init
Roopa Prabhu [Mon, 14 Mar 2016 01:17:35 +0000 (18:17 -0700)]
addons: vrf: fix typo in reading vrf-max-count attribute name get at init

Ticket: CM-9105
Reviewed By: trivial
Testing Done: tested vrf bringup and default attributes at boot

8 years agoaddons: vrf: fix typo in vrf default attribute name get at init
Roopa Prabhu [Mon, 14 Mar 2016 01:04:23 +0000 (18:04 -0700)]
addons: vrf: fix typo in vrf default attribute name get at init

Ticket: CM-9105
Reviewed By: trivial
Testing Done: tested vrf bringup and default attributes at boot

also change some policy manager errors to info

8 years agovrf: finish support for vrf-table auto
Roopa Prabhu [Fri, 11 Mar 2016 04:24:33 +0000 (20:24 -0800)]
vrf: finish support for vrf-table auto

Ticket: CM-9105
Reviewed By: dsa, nikhil, julien
Testing Done:

This commit contains:
- few logic fixes in vrf-table auto handling code
- adds a new policy manager api to read module global
attributes like the below:
 "module_globals": {"vrf_table-id-start" : 1001,
                    "vrf_table-id-end" : 5000,
                    "vrf-max-count" : 64 },
                    "vrf-cgroup-create" : "yes" },

- Accepts following new vrf attributes from policy files

{
    "vrf": {
        "module_globals": {"vrf_table-id-start" : 1001,
                           "vrf_table-id-end" : 5000,
                           "vrf-max-count" : 64 },
                           "vrf-cgroup-create" : "yes" },
        "defaults": { "vrf-default-route": "yes" }
    }
}

8 years agoRevert "Detect and ignore the `ether` keyword in /etc/network/interface"
Roopa Prabhu [Fri, 11 Mar 2016 23:56:34 +0000 (15:56 -0800)]
Revert "Detect and ignore the `ether` keyword in /etc/network/interface"

This reverts commit bed653e31b7cae7ac33073ab8ecf5e98c8b3bd21.

Reverting commit because this does not do the right thing and also
prints 'NoneType' errors. We should not be changing anything for
running values. The ether check is only needed for configured values.

8 years agoDetect and ignore the `ether` keyword in /etc/network/interface
Julien Fortin [Fri, 11 Mar 2016 19:59:56 +0000 (20:59 +0100)]
Detect and ignore the `ether` keyword in /etc/network/interface
Upstream syntax : "hwaddress ether 01:02:03:04:05:06"
Our new syntax: "hwaddress [ether] 01:02:03:04:05:06"

Ticket: CM-6896
Reviewed By: CCR-4276
Testing Done:

Modified /etc/network/interfaces adding/removing `ether` and playing around

8 years agovrf: Fix to remove FIB rules on VRF delete
Nikhil [Thu, 10 Mar 2016 23:40:23 +0000 (15:40 -0800)]
vrf: Fix to remove FIB rules on VRF delete

Ticket: CM-9814
Reviewed By: Roopa Prabhu
Testing Done: Yes, by installing ifupdown .deb file onto cel-e1031-01

8 years agovrf: adding default route to ipv6 table
Nikhil [Thu, 10 Mar 2016 21:57:12 +0000 (13:57 -0800)]
vrf: adding default route to ipv6 table

Ticket: CM-9773
Reviewed By: Roopa Prabhu
Testing Done: yes, by installing ifupdown .deb file onto cel-e1031-01

adding default route to ipv6 table when the attribute
vrf-default-route is set to yes

8 years agovrf: check for cgroup existance before creating and deleting them
Roopa Prabhu [Thu, 10 Mar 2016 19:29:30 +0000 (11:29 -0800)]
vrf: check for cgroup existance before creating and deleting them

Ticket: CM-9776
Reviewed By: dsa
Testing Done: tested repeated up and downs

8 years agovrf: add and delete l3mdev task cgroups
Roopa Prabhu [Thu, 10 Mar 2016 00:31:43 +0000 (16:31 -0800)]
vrf: add and delete l3mdev task cgroups

Ticket: CM-9776
Reviewed By:
Testing Done: Tested ifup and ifdown of a vrf dev

$ifup -a -v
info: Executing cgcreate -g l3mdev:blue
info: Executing cgset -r l3mdev.master-device=blue blue

$ifdown -a -v
info: Executing cgdelete -g l3mdev:blue

8 years agomodulebase: add ifaceobj.set_status calls in log_error and log_warn
Roopa Prabhu [Thu, 10 Mar 2016 00:29:48 +0000 (16:29 -0800)]
modulebase: add ifaceobj.set_status calls in log_error and log_warn

Ticket:
Reviewed By: trivial
Testing Done:

This can be used by callers to set iface object status.

8 years agoiface: add status WARNING and a new method set_status
Roopa Prabhu [Thu, 10 Mar 2016 00:26:12 +0000 (16:26 -0800)]
iface: add status WARNING and a new method set_status

Ticket:
Reviewed By: trivial
Testing Done:

This patch adds WARNING to ifaceStatus and adds a new method
iface:set_status

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
8 years agoifquery --check should not check default attributes when not requested
Sam Tannous [Thu, 10 Mar 2016 15:33:13 +0000 (10:33 -0500)]
ifquery --check should not check default attributes when not requested

Ticket: CM-7938
Reviewed By: roopa
Testing Done: tested on amd64 cel-redxp box

If the user has not configured a link attribute,
we should not be checking it against the default config.
This will only confuse users into thinking link attributes
were configured.

Modifications to the ethtool.py addon module
to check of configs exist before checking them.

8 years agoWhen bringing up a bond with a clag id rtnetlink_api is raising an exception
Julien Fortin [Thu, 10 Mar 2016 01:04:48 +0000 (02:04 +0100)]
When bringing up a bond with a clag id rtnetlink_api is raising an exception

Ticket: CM-9615
Reviewed By: CCR-4272
Testing Done:

The protodown calls to rtnetlink_api now have a try/except.

8 years agoEmpty or stale alias on interface when using ifdown
Julien Fortin [Thu, 10 Mar 2016 00:40:15 +0000 (01:40 +0100)]
Empty or stale alias on interface when using ifdown

Ticket: CM-6795
Reviewed By: CCR-4270
Testing Done:

root@debian:~# cat /etc/network/interfaces
auto lo
iface lo inet loopback
  alias foo_bar
root@debian:~# ip link show lo
  1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default
      link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
          alias foo_bar
root@debian:~# ifdown -v lo
  info: loading builtin modules from /usr/share/ifupdown2/addons
  info: module ethtool not loaded (module init failed: no /sbin/ethtool found)

info: module ethtool not loaded (module init failed: no /sbin/ethtool found)

info: looking for user scripts under /etc/network
info: loading scripts under /etc/network/if-pre-up.d ...
info: loading scripts under /etc/network/if-up.d ...
info: loading scripts under /etc/network/if-post-up.d ...
info: loading scripts under /etc/network/if-pre-down.d ...
info: loading scripts under /etc/network/if-down.d ...
info: loading scripts under /etc/network/if-post-down.d ...
info: lo: running ops ...
info: rtnetlink: setting link lo down
info: executing ip -o addr show dev lo
info: Executing echo "" > /sys/class/net/lo/ifalias
info: Executing /etc/network/if-down.d/avahi-autoipd
info: Executing /etc/network/if-down.d/upstart
info: Executing /etc/network/if-down.d/wpasupplicant
info: Executing /etc/network/if-post-down.d/wireless-tools
info: Executing /etc/network/if-post-down.d/avahi-daemon
info: Executing /etc/network/if-post-down.d/wpasupplicant
root@debian:~# ip link show lo
1: lo: <LOOPBACK> mtu 65536 qdisc noqueue state DOWN mode DEFAULT group default
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
root@debian:~# ifup -v lo
    info: loading builtin modules from /usr/share/ifupdown2/addons
    info: module ethtool not loaded (module init failed: no /sbin/ethtool found)

info: module ethtool not loaded (module init failed: no /sbin/ethtool found)

info: looking for user scripts under /etc/network
info: loading scripts under /etc/network/if-pre-up.d ...
info: loading scripts under /etc/network/if-up.d ...
info: loading scripts under /etc/network/if-post-up.d ...
info: loading scripts under /etc/network/if-pre-down.d ...
info: loading scripts under /etc/network/if-down.d ...
info: loading scripts under /etc/network/if-post-down.d ...
info: processing interfaces file /etc/network/interfaces
info: lo: running ops ...
info: Executing /etc/network/if-pre-up.d/wireless-tools
info: Executing /etc/network/if-pre-up.d/wpasupplicant
info: rtnetlink: setting link lo up
info: executing ip -o addr show dev lo
info: executing ip link set dev lo alias foo_bar
info: Executing /etc/network/if-up.d/mountnfs
info: Executing /etc/network/if-up.d/avahi-autoipd
info: Executing /etc/network/if-up.d/openssh-server
info: Executing /etc/network/if-up.d/upstart
info: Executing /etc/network/if-up.d/avahi-daemon
info: Executing /etc/network/if-up.d/wpasupplicant
root@debian:~# ip link show lo
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
        alias foo_bar

8 years agoifupdownmain: squash multiple iface stanzas for the same interface
Roopa Prabhu [Wed, 9 Mar 2016 04:40:02 +0000 (20:40 -0800)]
ifupdownmain: squash multiple iface stanzas for the same interface

Ticket:
Reviewed By: CCR-4268
Testing Done: Tested squashing of interfaces with multiple iface stanzas

This is controlled by ifaceobj_squash config variable in
/etc/network/ifupdown2/ifupdown2.conf.

With ifaceobj_squash=1, ifquery and all commands will
output squashed interfaces.

$cat /etc/network/interfaces
auto swp3
iface swp3
    mtu 9000

auto swp3
iface swp3 inet static
    address 10.0.17.3/24

auto swp3
iface swp3 inet static
    address 10.0.18.3/24
    address 2000:1000:1000:1000:3::5/128

$ifquery -a
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp

auto swp3
iface swp3
        mtu 9000
        address 10.0.17.3/24
        address 10.0.18.3/24
        address 2000:1000:1000:1000:3::5/128

When and why do we need this ?
- If we preserve multiple ifaceobjects for the same iface,
it gets tricky in some cases to set default policy
values because the addon module run methods are called
on each ifaceobject.
- Each ifaceobject belonging to the same interface
is treated as a separate interface. It is difficult
to remember things accross addon module run methods
- we have a few hacks in place which we would like to
get rid of

Why not turn it on by default ?
- still debating about it. Dont want to break existing
scripts with change of output. Will get some feedback before
I switch the default to squash.

8 years agoRevert "Empty or stale alias on interface when using ifdown"
Roopa Prabhu [Wed, 9 Mar 2016 05:01:59 +0000 (21:01 -0800)]
Revert "Empty or stale alias on interface when using ifdown"

This reverts commit b4ffc5276fdef9aa02cbe47b02f414076edcf0f1.

reverting due to incorrect logic.

8 years agoEmpty or stale alias on interface when using ifdown
Julien Fortin [Wed, 9 Mar 2016 03:09:43 +0000 (04:09 +0100)]
Empty or stale alias on interface when using ifdown

Ticket: CM-6795
Reviewed By:
Testing Done: Julien Fortin <julien@cumulusnetworks.com>

When using ifdown the value of the alias field was checked but never used. Instead this string "\'\'" was used.

8 years agoaddons: vrf: fix incorrect check when checking for running vs configured slaves
Roopa Prabhu [Tue, 8 Mar 2016 22:05:35 +0000 (14:05 -0800)]
addons: vrf: fix incorrect check when checking for running vs configured slaves

change 'or' to 'and'. Its valid for one of them to be null.
This was causing vrf enslavement errors during bootup.
This was a recent regression.

Closes: CM-9757
Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
8 years agoifreload: catch errors on dependency graph generation from saved state and proceed
Roopa Prabhu [Tue, 8 Mar 2016 16:12:33 +0000 (08:12 -0800)]
ifreload: catch errors on dependency graph generation from saved state and proceed

We dont need to fail on saved state dependency graph generation errors.
Also dont check for shared dependents during dependency graph generation
on saved state (optimization)

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
8 years agostart-networking: bring back support for SKIP_DOWN_AT_SYSRESET in /etc/default/networking
Roopa Prabhu [Fri, 4 Mar 2016 05:29:53 +0000 (21:29 -0800)]
start-networking: bring back support for SKIP_DOWN_AT_SYSRESET in /etc/default/networking

Ticket: CM-9668
Reviewed By: daveO, roopa (patch by daveO)
Testing Done: Tested reboot/shutdown and made sure network
unconfiguration was not getting triggered

This is controlled by a variable SKIP_DOWN_AT_SYSRESET="yes"
(defaults to yes). Should probably default to 'no' for upstream.

8 years agoaddons: bond: replace bond-ad-sys-priority and bond-ad-sys-mac-addr with equivalent...
Roopa Prabhu [Fri, 4 Mar 2016 00:39:59 +0000 (16:39 -0800)]
addons: bond: replace bond-ad-sys-priority and bond-ad-sys-mac-addr with equivalent upstream attributes

Ticket: CM-9677
Reviewed By: nikhil
Testing Done: Tested with bond config file in CM-9677

This patch replaces the following attributes:
bond-ad-sys-priority with bond-ad-actor-sys-prio
bond-ad-sys-mac-addr with bond-ad-actor-system

The new attributes correspond to the new sysfs files below:
/sys/class/net/sidelink/bonding/ad_actor_sys_prio
/sys/class/net/sidelink/bonding/ad_actor_system

Old values will be accepted with a deprecated warning:
warning: attribute bond-ad-sys-priority is deprecated. Use bond-ad-actor-sys-prio instead
warning: attribute bond-ad-sys-mac-addr is deprecated. Use bond-ad-actor-system instead

8 years agoaddons: address: avoids quagga configured address deletion when no address-purge
Nikhil [Thu, 3 Mar 2016 20:13:23 +0000 (12:13 -0800)]
addons: address: avoids quagga configured address deletion when no address-purge

Ticket: CM-8621
Reviewed By: Roopa Prabhu
Testing Done: Yes, by installing ifupdown2 deb onto cel-e1031-01

This patch makes sure ifupdown2 will not delete the address
configured through quagga when address-purge is set to no

8 years agoDon't timeout networking start
Dave Olson [Wed, 2 Mar 2016 01:07:39 +0000 (17:07 -0800)]
Don't timeout networking start

Ticket: CM-9216
Reviewed By: roopa
Testing Done: installed, verified that even with long sleeps, no timeout

After much discussion with Roopa, Wilson, Anuradha, Mallik, and Scott,
we decided we would go back to the 2.5 behavior of not timeing out
on networking startup.  See the bug for some of the discussion.

This needs clagd changes to not hang forever if clag is to be restarted.

Since this is a oneshot service, the default is to not timeout, so
simply remove the TimeoutSec variable to get the default of no timeout.

8 years agoaddons: vrf: avoids ifupdown2 error when VRF defined but not used
Nikhil [Wed, 2 Mar 2016 21:07:11 +0000 (13:07 -0800)]
addons: vrf: avoids ifupdown2 error when VRF defined but not used

Ticket: CM-9596
Reviewed By: Roopa Prabhu
Testing Done: Yes, by installing ifupdown2 deb onto cel-e1031-01

This patch makes sure ifupdown2 will not report a NoneType error
when VRF is defined but not used

8 years agoifupdownaddons: iproute2: Fix for error while enslaving 'eth0' to a vrf
Nikhil [Wed, 2 Mar 2016 03:39:37 +0000 (19:39 -0800)]
ifupdownaddons: iproute2: Fix for error while enslaving 'eth0' to a vrf

Ticket: CM-9594
Reviewed By: Roopa Prabhu
Testing Done: Yes, by installing ifupdown2 deb onto cel-e1031-01

This patch fixes the failure to execute the command
'ip link set dev eth0 nomaster' when 'eth0' is associated with any vrf

This patch also include a review comment update for CCR-4210

8 years agoifupdownaddons: fix parsing of vlan attributes
Roopa Prabhu [Wed, 2 Mar 2016 06:42:44 +0000 (22:42 -0800)]
ifupdownaddons: fix parsing of vlan attributes

Ticket: CM-8729
Reviewed By: trivial
Testing Done: Tested with a config with vlan-raw-device

'ip -o -d link show' introduced a new attribute between
'vlan and id'. This makes the move to json or netlink
even more necessary.

The fixes were done for the following format:
61: vlan100@swp1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc
noqueue state UP mode DEFAULT group default \    link/ether
00:e0:ec:27:4e:b7 brd ff:ff:ff:ff:ff:ff promiscuity 0 \    vlan protocol
802.1Q id 100 <REORDER_HDR> addrgenmode eui64

8 years agonetworkinterfaces: fix is_keyword to not match attribute names with keywords in them
Roopa Prabhu [Tue, 1 Mar 2016 07:04:08 +0000 (23:04 -0800)]
networkinterfaces: fix is_keyword to not match attribute names with keywords in them

Ticket: CM-8729
Reviewed By: Nikhil
Testing Done: Tested with vlan device with vlan-raw-device in interfaces
file

also reported here: https://github.com/CumulusNetworks/ifupdown2/issues/10

is_keyword was matching iface attribute 'vlan-raw-device' to the vlan
keyword and dropping it from ifaceobj config.

8 years agoifupdownmain: handle more than one upperifaces
Roopa Prabhu [Tue, 1 Mar 2016 06:23:24 +0000 (22:23 -0800)]
ifupdownmain: handle more than one upperifaces

Ticket: CM-9595
Reviewed By:
Testing Done: tested with failing vrf config in CM-9595

due to same upperiface getting processed more than once,
there was an unnecessary refcount inc on the lowerdevice.
This patch aborts processing upperiface if already
processed and also adds a new debug function to
dump lower and uppper ifaces of all interfaces in the
file.

8 years agoaddons: vrf: Ensures fib rule for local table have higher pref than fib vrf rule
Nikhil [Tue, 1 Mar 2016 01:32:23 +0000 (17:32 -0800)]
addons: vrf: Ensures fib rule for local table have higher pref than fib vrf rule

Ticket: CM-9541
Reviewed By: Roopa Prabhu
Testing Done: Yes, by installing ifupdown2 deb onto cel-e1031-01

This patch checks if fib rule for local table have higher pref
than vrf table, if not, it deletes fib rule for local table
with lower pref and adds fib rule for local table with
higher pref than vrf table.

This patch also avoid repeated addition of vrf rules on each ifup

8 years agostart-networking: introduce state lock file /run/network/ifstatelock in
Roopa Prabhu [Mon, 29 Feb 2016 23:31:52 +0000 (15:31 -0800)]
start-networking: introduce state lock file /run/network/ifstatelock in
non-persistant storage

This is a reimport of missing peices of commit
f819c3602e56 in 2.5cl ifupdown2.

commit log from 2.5cl:
Introduce a lock file in non-persistent storage
/run/network/ifstatelock to make sure the state
file in persistent storage is cleaned up correctly

ifupdown2 state file was moved to /var/tmp because /var/tmp was
tmpfs and was large enough (100MB) for the state file. But it
appears it has changed (or is not consistent) across all platforms.
We can move it under /run, but /run again size varies on various
platforms and it is too small on some platforms.

This patch:
- continues to keep the ifupdown2 state file under /var/tmp (because
  it needs the space)
- ntroduces a second level /run/network/ifstatelock file that stays
  on non-persistant storage and is used to delete the state file at
  /boot up

Closes: CM-9573, CM-7774
Review: CCR-3623 (original review)
Tested-by: Mallikarjuna rao Uppalapati <mallik@cumulusnetworks.com>
Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
8 years agodocs: Add example config for mgmt-vrf
David Ahern [Mon, 29 Feb 2016 23:22:56 +0000 (15:22 -0800)]
docs: Add example config for mgmt-vrf

Ticket: none
Reviewed By: none

Add example of how to configure management vrf.

Signed-off-by: David Ahern <dsa@cumulusnetworks.com>
8 years agoaddons: vrf: support to avoid changing table ids
Nikhil [Wed, 24 Feb 2016 21:45:26 +0000 (13:45 -0800)]
addons: vrf: support to avoid changing table ids

Ticket: CM-9107
Reviewed By: Roopa Prabhu
Testing Done: Yes, by installing ifupdown2 deb onto cel-e1031-01

This patch adds a check to detect change in vrf config table id
compared to running table id and throw an error accordingly.

8 years agomstpctlutil: fix strip on NoneType warning
Roopa Prabhu [Fri, 26 Feb 2016 23:32:18 +0000 (15:32 -0800)]
mstpctlutil: fix strip on NoneType warning

saw this during execution of the below command:
ifup --no-act -a

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
8 years agovrf: handle slaves when vrf device is brought up
Roopa Prabhu [Fri, 26 Feb 2016 14:32:28 +0000 (06:32 -0800)]
vrf: handle slaves when vrf device is brought up

The vrf device may not be up when ifup is executed on the
slaves. This commit makes sure:
- vrf slaves dont try to enslave themselves when vrf device is
not present
- And vrf master enslaves any missing slaves during ifup of vrf master
- Also make vrf device the link master, this will make sure
the vrf device brings the vrf slave links up. This is needed to work
around the ipv6 address flush issue

Closes: CM-9493
Review: dsa, nikhil, wkok (via git send-mail)
Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
8 years agoifupdownmain: add support for getting and introducing upperiface dependencies
Roopa Prabhu [Fri, 26 Feb 2016 07:55:27 +0000 (23:55 -0800)]
ifupdownmain: add support for getting and introducing upperiface dependencies

This patch adds a new upperiface module handler get_upper_ifacenames
to get upperifaces from a addon module. This is called during building
dependency graph.

Closes: CM-9493
Review: dsa, nikhil, wkok (via git send-email)
Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
8 years agoifreload: fix handling(downing) of builtin interfaces on changes
Roopa Prabhu [Fri, 26 Feb 2016 01:10:33 +0000 (17:10 -0800)]
ifreload: fix handling(downing) of builtin interfaces on changes

Ticket: CM-8455
Review: CCR-4181
Testing: tested ifreload on builtin interface change

This patch handles removal of builtin interfaces (example swp*.100
below..which dont have iface sections) during a ifreload.

{noformat}
auto bridge
iface bridge
        bridge-vlan-aware yes
        bridge-ports swp3.100 swp15.100
{noformat}

if user changes swp15.100 to another interface and does a ifreload,
before this patch swp15.100 used to be around. This patch makes sure
swp15.100 is deleted in the process

I had to do some cleanup of flags in the process. I might have added
some extra cycles to ifreload. But i dont see an easy way to handle this
case.

8 years agoRemoved lacp bypass priority mode
Wilson Kok [Fri, 26 Feb 2016 15:29:45 +0000 (07:29 -0800)]
Removed lacp bypass priority mode

Ticket: CM-9494
Reviewed By: CCR-4184
Testing Done:

Also removed legacy 'fallback' options.
Now lacp bypass is enabled and disabled on a bond with:

    bond-lacp-bypass-allow [0|1]

8 years agoservice node address config for vxlan device using "remote" attribute
Balakrishnan Raman [Fri, 26 Feb 2016 05:53:05 +0000 (21:53 -0800)]
service node address config for vxlan device using "remote" attribute

Ticket: CM-9520
Reviewed By: CCR-4152
Testing Done: verified service node configuration

Use "remote" attribute in iproute2 command to provision
service node address for service node based replication. Changes also
include allowing only one service node per vxlan device, so its user's
responsiblity to select one service node per vxlan device if there
are multiple nodes to distribute the load.

8 years agoaddons: vrf: support for vrf-default-route attribute
Nikhil [Tue, 23 Feb 2016 00:05:52 +0000 (16:05 -0800)]
addons: vrf: support for vrf-default-route attribute

Ticket:CM-9106
Reviewed By: Roopa Prabhu and Dave Olson
Testing Done: Yes, by installing ifupdown and cumulus-tools deb on to cel-e1031-01

This patch adds per vrf default route: "ip route add table <tbid> unreachable default"

It also accepts a policy file with vrf-default-route [yes/no]

This also includes ifquery fixes for running and check.

8 years agoaddons: address: fix processing of 'preferred-lifetime' attribute
Nikhil [Mon, 8 Feb 2016 21:05:33 +0000 (13:05 -0800)]
addons: address: fix processing of 'preferred-lifetime' attribute

Ticket: CM-8773
Reviewed By: CCR-4079
Testing Done:Yes, with following cofiguration

auto swp1
iface swp1
address 71.12.21.43
address 2001:620:5ca1:160::47
preferred-lifetime 30

Fix for this is, a small update in address.py method '_inet_address_convert_to_cidr'
where there is a check for different addres attributes.

8 years agoSet vlan-filtering on bridge before adding bridge ports
Wilson Kok [Fri, 19 Feb 2016 22:14:29 +0000 (14:14 -0800)]
Set vlan-filtering on bridge before adding bridge ports

Ticket: CM-6806
Reviewed By: CCR-4126
Testing Done:

Currently, when doing ifup of a bridge, the bridge is created
and ports are added to bridge before vlan_filtering is set on
the bridge. This causes extra churn on switchd which has to
configure the hardware one way and then tear it down and
reconfigure it again in the new way. For mlx, it causes even
more problems.

This patch moves the vlan_filtering setting of bridge to before
member ports are being added to the bridge, and it uses the new
iproute2 command for setting the attribute instead of through
sysfs.

8 years agoFix incorrect install location of networking default file
Dave Olson [Fri, 19 Feb 2016 21:14:55 +0000 (13:14 -0800)]
Fix incorrect install location of networking default file

Ticket: none
Reviewed By: roopa,satish
Testing Done: built, installed, verified correct location

The install file resulted in creating /etc/default/networking/ as a
directory and installing the networking.default file in it.  Rename
networking.default to networking, and change the install file.
Normally dh_installinit handles all this, but since the package is
ifupdown2, and the file is networking, that doesn't happen.

Also, because we had created a directory with the name of what we want
to install as a file, we need to remove it if it exists.  This addition
of a preinst file should not go upstream, and should be removed in a few
weeks when everybody has re-installed enough.

8 years agoifupdownaddons: iproute2: support for vrf linkinfo
Roopa Prabhu [Fri, 19 Feb 2016 21:43:08 +0000 (13:43 -0800)]
ifupdownaddons: iproute2: support for vrf linkinfo

Closes: CM-8518
Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
Acked-by: Nikhil Gajendrakumar <nikhil@cumulusnetworks.com>
8 years agoifquery running not showing vlan ranges in 3.0
Sam Tannous [Thu, 18 Feb 2016 21:49:40 +0000 (16:49 -0500)]
ifquery running not showing vlan ranges in 3.0

Ticket: CM-9097
Reviewed By: Trivial
Testing Done: Tested on Chris' config

In 3.0, the bridge vlan show command does not print
VLAN ranges unless you use the "-c" option.
This patch modifies the bridge vlan show call in
iproute2.py to use "-c".

8 years agoRemove clag_enable dependancy from ifupdown2.
Anuradha Karuppiah [Wed, 10 Feb 2016 18:46:11 +0000 (10:46 -0800)]
Remove clag_enable dependancy from ifupdown2.

Ticket: CM-9078
Reviewed By: CCR-4110
Testing Done: clag bond add/del and clag slave add/del

This change basically does the following -
1. Proto-down swpX pre-clag-bond-enslave
2. Proto-up swpX post-clag-bond-release

Setting/clearing of clag-id will result in similar proto-state changes
and those are handled by clagd.

Note:
I really wanted to keep these changes out of ifupdown2 but the
order of setting is critical i.e. protodown has to happen enslave to
prevent additional flaps/STP TCNs. Theoretically #2 can be done by clagd
but there is no easy way to do #1.

8 years agoChanging source format to git to support revisions
John Berezovik [Mon, 15 Feb 2016 19:57:10 +0000 (11:57 -0800)]
Changing source format to git to support revisions

8 years agoReset version to CL3.0 convention. Package builds from jenkins will come as <base...
John Berezovik [Mon, 15 Feb 2016 19:55:30 +0000 (11:55 -0800)]
Reset version to CL3.0 convention. Package builds from jenkins will come as <base>~<time>.<commit id>. First release is cl3u1

8 years agoModified lacp-bypass-all-active support to use the new sysfs
wkok [Fri, 12 Feb 2016 17:18:55 +0000 (09:18 -0800)]
Modified lacp-bypass-all-active support to use the new sysfs
node /sys/class/net/bondx/bonding/lacp_bypass.

Ticket: CM-9266
Reviewed-by: trivial
Testing-done:

8 years agoDisable old LACP bypass options
wkok [Thu, 11 Feb 2016 04:58:23 +0000 (20:58 -0800)]
Disable old LACP bypass options

Ticket: CM-9266
Reviewed-by: trivial
Testing-done:

For now disable old LACP bypass options so that ifreload does
not give errors, as the corresponding sysfs nodes do not exist in
the latest 4.1.y kernel.

8 years agoFixed one more reference to /etc/init.d/networking; remove switchd dependency
Dave Olson [Mon, 8 Feb 2016 22:10:20 +0000 (14:10 -0800)]
Fixed one more reference to /etc/init.d/networking; remove switchd dependency

Ticket:
Reviewed By: trivial
Testing Done:  built, installed

Don't want to leave incorrect confusing references behind.

Instead of having the networking script depend on switchd, since
ifupdown2 is upstream, I'll add the reverse dependency to the
switchd.service.

Added Documentation line

8 years agoifupdown2 needs to set fdelay before maxage in bridge mstpctl.py addon module
Sam Tannous [Tue, 9 Feb 2016 00:43:20 +0000 (19:43 -0500)]
ifupdown2 needs to set fdelay before maxage in bridge mstpctl.py addon module

Ticket: CM-8725
Reviewed By: roopa
Testing Done: tested with user's config on amd64 platform

When setting mstpctl params from user given fdelay and maxage,
ifreload and ifup is setting maxage before fdelay.

Since there is a check for (Bridge Foward Delay - 1 second) >= Bridge Max Age
fdelay must be set before maxage because the fdelay is a default value.

8 years agoRemove /etc/init.d/networking after all - causes loops during image builds
Dave Olson [Mon, 8 Feb 2016 20:41:41 +0000 (12:41 -0800)]
Remove /etc/init.d/networking after all - causes loops during image builds

Ticket:  none
Reviewed By: trivial
Testing Done:  installed, Alex tried for image creations.

apparently with some of our packages like mstpd still using init.d for a
while longer, just having the init.d/networking file causes the original
complaints about loops between services.

So I'm purging it completely.

Also clean up the comments a bit in start-networking

8 years agoifupdown2: After loading bonding driver, continue to create bond
Scott Emery [Mon, 8 Feb 2016 20:47:08 +0000 (12:47 -0800)]
ifupdown2: After loading bonding driver, continue to create bond

Ticket: CM-9182
Reviewed By: Trivial
Testing Done: ifup'd bond when bonding module was not yet loaded.

The bond support in ifupdown2 would check to see if the bonding module is
loaded when creating a bond. If it was not it would load the driver and return.
The correct operation is to load the driver and then continue to create the
bond.

8 years agoCleanup clag enable references.
Anuradha Karuppiah [Sat, 6 Feb 2016 00:01:59 +0000 (16:01 -0800)]
Cleanup clag enable references.

Ticket: CM-9078
Reviewed By: Trivial
Testing Done: bond ifdown/ifup on s6000

This needs to be replaced with protodown of clag bond slaves
pre-enslave (TBD; coming soon).

8 years agoaddons: vrf: iproute2 only reads .conf files
Roopa Prabhu [Fri, 5 Feb 2016 06:00:31 +0000 (22:00 -0800)]
addons: vrf: iproute2 only reads .conf files

Fix iproute2 vrf map file to end with .conf

Closes: CM-9137
Reviewed By: Roopa
Signed-off-by: David Ahern <dsa@cumulusnetworks.com>
8 years agoifupdown2: Modify implementation of nowait option
Scott Emery [Thu, 4 Feb 2016 00:38:18 +0000 (16:38 -0800)]
ifupdown2: Modify implementation of nowait option

Ticket: None
Reviewed By: CCR-4058
Testing Done: ifup'd interface with both dhcp-wait: "no" and dhcp-wait: "yes"
and not specified at all.

A previous patch implemented the nowait option for DHCP. This patch changes the
name of the option to "dhcp-wait" and makes the default, if nothing is specified
in the policy files, to be "yes", which means dhclient will be called without
the "-nw" option, causing it to wait for up to a minute for a response from the
DHCP server before continuing.

The format of the JSON in the policy file for this option was also changed so
that it conforms to the other ifupdown2 policy options. This format is now:

{
    "dhcp": {
        "defaults": { "dhcp-wait": "no" }
    }
}

Also, the documented argument values are "yes" and "no". Any other values, will
be interpreted as "yes".

A subsequent patch in cl-basefiles will be made to include this fragment in
/var/lib/ifupdown2/policy.d/dhcp.json so that Cumulus Linux will default to
not waiting for DHCP to complete.