1
0
mirror of https://github.com/CumulusNetworks/ifupdown2.git synced 2024-05-06 15:54:50 +00:00

370 Commits

Author SHA1 Message Date
Sam Tannous
88a5c4c89d Added ifupdown2 support for vxlan-ageing config
Ticket: CM-5105
Reviewed By: roopa
Testing Done: tested configs before and after change

We needed a configuration option to add vxlan-ageing to
ifupdown2 configs.  This patch adds the option to change
the vxlan-ageing timer currently set with "ip link"
commands.
(cherry picked from commit 9832462c365bd2b900b98f5675d407d1b11c4a95)

Conflicts:
	packages/ifupdown2/addons/vxlan.py
	packages/ifupdown2/ifupdownaddons/iproute2.py
2015-06-04 15:27:01 -04:00
Wilson Kok
3380b84370 Added lacp bypass all-active parameter in ifupdown2 man page
Ticket: CM-6038
Reviewed By:
Testing Done:
2015-05-16 11:40:16 -07:00
Roopa Prabhu
bb562af1f5 Move stale slave delete to after the adds are done
Ticket: CM-5887
Reviewed By: trivial
Testing Done: Tested with sample config in the bug
(cherry picked from commit e90149a1e8ea3bc94e07fb080361e6909b12e81b)
2015-05-14 23:03:38 -07:00
Roopa Prabhu
77c920f2d9 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
2015-05-12 07:32:53 -07:00
Wilson Kok
137de5d7dc LACP bypass fixes
Ticket: CM-5924, CM-5937, CM-5921, CM-5932
Reviewed By: CCR-2911
Testing Done:

bonding driver:
- renamed bond lacp-bypass-use-priority config option to
  lacp-bypass-all-active with the default value of 0
- ignore clag role when lacp-bypass-all-active is enabled
- added info logging of lacp bypass state changes

iproute2:
- renamed bond lacp-bypass-use-priority config option

ifupdown:
- renamed bond lacp-bypass-use-priority config option
- added default value handling for lacp bypass attributes

switchd:
- macs learned on individual slaves are now sync to kernel with
  the bond's ifindex.  This eliminates flooding when cpu is
  communicating to the host where the bond is in lacp bypass
- fixed bond forwarding state propagation to individual slaves in
  bypass
2015-05-08 11:38:41 -07:00
Roopa Prabhu
458b49fa1e move udev script processing to before restarting networking
Ticket: CM-5764
Reviewed By: jtoppins
Testing Done:
2015-05-07 16:13:52 -07:00
Wilson Kok
48db65f6e9 Added ifupdown support for different lacp bypass modes
Ticket: CM-5716
Reviewed By:
Testing Done:

Added mode to distinguish between priority based and multiple links
lacp bypass modes.
2015-05-02 15:19:51 -07:00
Roopa Prabhu
547640dce8 Merge branch 'CumulusLinux-2.5_br' of ssh://dev.cumulusnetworks.com/home/trac/cumulus into CumulusLinux-2.5_br 2015-04-30 13:03:07 -07:00
Roopa Prabhu
978e17d23f Fix bridge pvid add/del order
Ticket: CM-5832
Reviewed By: CCR-2875
Testing Done: Tested with test case in the bug and other orders

kernel(upstream and us) does not seem to honor the vidinfo flags
during the deletes. Hence, this reordering becomes necessary.

tested with the example in the bug and also some other examples.

code wise this combines two existing methods but leaves the two existing methods
around for future use. Will remove them if they become completely
unnecessary.
2015-04-30 12:59:16 -07:00
Roopa Prabhu
e7dd09ca52 Fix ifreload man page to include the new behaviour where it does not
down all changed interfaces

Ticket: CM-5819
Reviewed By: trivial
Testing Done: Tested man page
(cherry picked from commit 93ecf73b22d317dcf2a0924030f34f008fc25c33)
2015-04-28 22:15:46 -07:00
Roopa Prabhu
26434da621 Dont down an interface during ifreload just because the number of iface
sections for that interface changed

Ticket: CM-5841
Reviewed By:
Testing Done: tested ifreload with new iface section

<email_notes>
problem stmt:
if the user adds a new section for an existing interface, I mark the
interface for down.
Basically the below:

               if len(newifaceobjlist) != len(lastifaceobjlist):
                    ifacedownlist.append(ifname)
                    continue

You rarely need to add a new section to the interfaces file. It is not
recommended even by the user guide.
sankaran was trying to add a new address. Which he could have added to
the same iface section.

But, looking at his trivial example, i am thinking of not marking an
interface for down if the user merely tried to add a new section to an
existing interface
</email_notes>
2015-04-27 21:18:14 -07:00
Roopa Prabhu
be1faadac3 Fix addons man page for a few mstpctl defaults
Ticket: CM-5813
Reviewed By: sashok
Testing Done: build and tested man page
2015-04-27 15:38:07 -07:00
Jonathan Toppins
d1017fec7a ifupdown2: fixup maintainer scripts
Ticket: CM-5764
Reviewed By: TBA
Testing Done: of course none ;) Will update when I have some time to test

fupdown2's postinst and postrm scripts do not conform to Debian's policy
for maintainer scripts [1]. Specific non-conformance follows:

* fixed maintainer scripts so they only use /bin/sh as other shells are
  non-essential packages and may not exist on the system
* fixed maintainer scripts so only actions specified by $1 are performed
  per run of the script
* fixed maintainer scripts to only support specific values for $1, and
  will otherwise exit with error
* included at the bottom of the postrm script the "#DEBHELPER#" tag as
  during package building debianhelper will inject extra code at this
  location

[1] https://www.debian.org/doc/debian-policy/ch-maintainerscripts.html
(cherry picked from commit 2289fe4e90a0134fcb07fe7e2e838de755d73e68)
2015-04-27 15:33:54 -07:00
Roopa Prabhu
e308cb8280 add new ifupdown2.conf option ifreload_down_changed to control ifreload
ifdown behaviour.

Ticket: CM-5819
Reviewed By: CCR-2846
Testing Done: tested ifreload evo test case

ifreload_down_changed is 0 by default which will make
sure ifreload will not execute down on changed interfaces
but only on deleted interfaces making it non-disruptive.

some notes from CCR:

ifreload was designed to be an optimization for 'service networking
restart' or 'ifdown -a + ifup -a'.
essentially it is a combination of 'ifdown + ifup' with some smarts in
which interfaces it will execute ifdown on.

By default it does the below:
ifdown all interfaces that were deleted from the interfaces file
ifdown all interfaces that were changed from the last time they were
ifup'ed
ifup -a (execute ifup on all interfaces marked auto)

Did not realize people will use ifreload as much as they do today. Also,
they may execute it on a production box when changes are made. ifdown on a production box can be
disruptive because if the ifdown which is part of the ifreload.

To have a non-disruptive option to ifreload, 2.5 added a new option -c
that only executed 'ifup' on all interfaces. Thus reloading all auto +
any other interfaces that were once brought up on the box (essentially
all interfaces present in the saved state file). This by default did not
do anything to the interfaces that got deleted from the file. But had an
ifupdown2.conf toggle to do so.

Looking at the evo use case, they do want to use a single command that
modifies, adds, deletes with
minimum disruption. we can achieve maybe what they want with multiple
commands (But there is also a case of a bug in the build evo is running
which makes it not so easy ).

This patch fixes the bug and also tries to change the default ifreload
behaviour controllable via a variable in ifupdown2.conf.
when ifreload_down_changed=0 in ifupdown2.conf, ifreload will only
ifdown interfaces that were deleted
from the file but not the ones that changed. subsequent ifup as part of
ifreload on the interfaces
that changed will apply the delta. And ifreload_down_changed default
value is '0'.

WIth the patch, ifreload by default will do the below (going back to the
previous default is just a toggle in the ifupdown.conf file):
ifdown all interfaces that were deleted from the interfaces file
ifup -a (execute ifup on all interfaces marked auto)

It sounds like a big change of behaviour for a hotfix release, but
essentially the patch just moves a few things around. And the change in
behaviour is so subtle that it is not very visible.
It just makes it non-disruptive.
(cherry picked from commit 2f7977834d4912a69159d27e54ba201f58a321d8)
2015-04-25 19:12:16 -07:00
Sam Tannous
4c773918da ifupdown2 loses interfaces on second down of swp port
Ticket: CM-5693
Reviewed By: roopa
Testing Done: tested bridge and bonds with interfaces with configs

Both bridge and mstpctl modules set priv_flags on interfaces
that have configs (like link-speed) even when used as bridge-ports.
And this collision causes statemanager.ifaceobj_sync() to never get called
because ifaceobj.priv_flags is 1 (we return immediately):
The fix was to create a new iface module_flags array to carry module info.
2015-04-23 20:27:44 -04:00
Jonathan Toppins
ef7b7c04b4 ifupdown2: fixup maintainer scripts to not crash on files not existing
Ticket: CM-5735
Reviewed By: no one
Testing Done: lots of repo upgrade testing by John B.

This partially reverts commit 8959e8e4ec93487228733b17ef2b220ed47c1260 ("Fix
bash completion for sudo users (mostly cosmetic)") in the sections where
the Debian maintainer scripts were modified.

In addition fixed up the Debian maintainer scripts to prevent a
potential upgrade failure, discussion follows:

The Cause For the upgrade Failure
=================================

Commit 8959e8e4ec93487228733b17ef2b220ed47c1260 introduced changes to
ifupdown2's package maintainer scripts to override some files provided
by the bridge-utils and udev packages as they conflict with ifupdown2.

The change to ifupdown2's postrm script is currently causing the script
to exit with a failure code if the following files do not exist on the
box:
/etc/udev/rules.d/80-networking.rules
/etc/udev/rules.d/60-bridge-network-interface.rules

The reason for this is in how the script is written.

Since the postrm script is configured to exit on the first command
failure, the "set -e" on line 3, the commands on lines 20 and 22 will
fail if the files being looked for do not exist, causing the script to
exit with a non-zero exit code. Causing apt to fail the upgrade.

.postrm script excerpt
----------
20 udevlink=$(readlink /etc/udev/rules.d/80-networking.rules 2>/dev/null)
21 [ -n "$udevlink" -a "$udevlink" == "/dev/null" ] && rm -f /etc/udev/rules.d/80-networking.rules
22 udevlink=$(readlink /etc/udev/rules.d/60-bridge-network-interface.rules 2>/dev/null)
23 [ -n "$udevlink" -a "$udevlink" == "/dev/null" ] && rm -f /etc/udev/rules.d/60-bridge-network-interface.rules
----------

Solution
--------

The solution requires having the newer version of the ifupdown2 package
provide a preinst script that gets run before the older package's postrm
script is run[1,2]. This gives us the opportunity to quietly fix the
problem. We also fix the postrm script in newer versions of the package
so it cannot bomb out in this way.

Finally, removed what appears to be a poor merge from commit
5f5d84e3261bf70dd3541666a3d3a7f817727ce6.

Fixes: 8959e8e4ec93487228733b17ef2b220ed47c1260
(cherry picked from commit 0eab79eb5aed4cdf0674e3f0ddad3631dd457bdc)
2015-04-20 15:11:11 -07:00
Wilson Kok
44533c7298 Modified ifupdown support for vxlan head end replication
Ticket: CM-5637
Reviewed By: CCR-2755
Testing Done:

Replaced vxlan-peernodeip attribute with vxlan-remoteip.  Updated
the vxlan and iproute2 modules to configure head end replication
using bridge fdb commands.
2015-04-15 10:15:22 -07:00
Roopa Prabhu
1cda1e437b rework error message
Ticket: CM-5373
Reviewed By:
Testing Done: tested interfaces file with shared dependents
2015-04-03 22:33:53 -07:00
Roopa Prabhu
45ca0b6d42 Add check for shared dependents during building dependency list
Ticket: CM-5373
Reviewed By: sam
Testing Done: Tested with shared slaves in bridge and bonds
2015-04-03 22:18:32 -07:00
Roopa Prabhu
a4912b996e Dont follow dependents during down of interfaces as part of ifreload
Ticket: CM-5571
Reviewed By:
Testing Done: tested ifreload with example in the bug

ifdown of the bridge svi was following the lowerdev and downing the
bridge. kernel implicitly deletes all svi's on bridge down.
ifup of the bridge usually handles it, but a change done in 2.5.1
was causing it not to. Thinking about this some more, its safe
to not follow dependents on down during a ifreload. This patch does
just that.
2015-04-03 20:47:06 -07:00
Roopa Prabhu
acf9264497 Add config len check to iface compare
Ticket: CM-5253
Reviewed By: sam
Testing Done: Tested ifreload with steps in the bug
2015-04-03 20:33:28 -07:00
Sam Tannous
1321132890 Prevent MTU from being set to 1500 on interface downing.
Ticket: CM-5355
Reviewed By: roopa
Testing Done: Tested config in ticket

MTU settings are defaulted 1500 when interface is ifdowned.
This has the effect of changing the MTU on the interface and any subinterfaces to
1500.  And if these subinterfaces are in a bridge, the bridge will pick the MIN MTU
so the bridge keeps this MTU even after the interface is brought back up. The sub
interface does not change to a higher value then 1500 (kernel VLAN driver only
moves the MTU is the decreasing direction.
2015-03-17 21:59:15 -04:00
Roopa Prabhu
d9357cd07c Merge branch 'CumulusLinux-2.5_br' of ssh://dev.cumulusnetworks.com/home/trac/cumulus into CumulusLinux-2.5_br 2015-03-10 14:19:41 -07:00
Roopa Prabhu
0edaee373f merge docs.addons content into docs directory
Ticket:
Reviewed By:
Testing Done:
2015-03-10 14:18:30 -07:00
Sam Tannous
fa714fa248 Correct error message for unsupported ifupdown2 attributes
Ticket: CM-5349
Reviewed By: Trivial
Testing Done: Tested on cel box

Corrected a minor error in how we handle unsupported config attributes.
Instead of

     error: not enough arguments for format string

we will now print this:

     warning: peerlink.4000: unsupported attribute 'clagd-foobar'
(cherry picked from commit 44c6004a33d59ee234f8ee3d5f450e158c9e5bdc)
2015-03-10 16:54:41 -04:00
Roopa Prabhu
c65c2ccde1 Wrong initialization of iface link kind (still puzzled how i had it this
way)

Ticket:
Reviewed By: trivial
Testing Done: Tested interface upperiface bring up

This was causing the auto upperiface bringup to pick all upperifaces on
malliks setup. This is a large number in a 500 svi setup.
2015-02-26 14:26:58 -08:00
Roopa Prabhu
f28e72e544 move link_set 'up' errors to debug
Ticket: CM-5199
Reviewed By: trivial
Testing Done: tested with interfaces file in the bug
2015-02-25 13:45:37 -08:00
Wilson Kok
ba1b38298b Increase LACP bypass period max to 900 seconds
Ticket: CM-5000
Reviewed By: Roopa
Testing Done:
2015-02-24 09:44:20 -08:00
Roopa Prabhu
3fc16f816d Merge branch 'CumulusLinux-2.5_br' of ssh://dev.cumulusnetworks.com/home/trac/cumulus into CumulusLinux-2.5_br 2015-02-18 12:32:05 -08:00
Roopa Prabhu
5b65654f85 Call mako renderer before rendering backslashes ('\')
Ticket: CM-5104
Reviewed By:
Testing Done: Tested with interfaces file listed in the bug
2015-02-18 12:28:50 -08:00
anuradhak
fa6a36a90d Replace bond-slave "link down" with "link protodown" for CLAG bond proto_down
handling.

Ticket: CM-4802
Reviewed By: CCR-2565
Testing Done: Yes

1. Earlier various clag components where using link admin state for enforcing
proto_down. With the introduction of a seperate proto_down state this is no
longer needed. Now on clag bond "proto_down" the bond and its slaves are
explicitly placed in a proto_down state. This carrier downs the slaves and
oper-downs the clag-bond. Change has been done in clagd, clag-monit script and
bonding driver.
2. Earlier misc tricks where needed in ifupdown2 to prevent slave state changes
for clag bond outside of clagd. These tricks are no longer needed and have been
reverted to keep ifupdown2 handling simple/consistent. This change basically
reverts #6985e1a376b538fbfa2346ef657427ae7e8f117a.
2015-02-18 08:44:37 -08:00
Sam Tannous
b6c1f5513a ifupdown2 must handle JSON input that is non-list
Ticket: CM-4417
Reviewed By: roopa
Testing Done: Build powerpc image and tested alternate json format

ifupdown2 was patched to handle nonlist JSON input since this
is a valid format.
(cherry picked from commit 2597194f6f34344495f3a2b44bfe1d05887e1e77)
2015-02-11 11:41:16 -05:00
Roopa Prabhu
496745cdc0 Add checks for BRIDGE_VLAN interfaces during link up/down
Ticket: CM-4718
Reviewed By:
Testing Done: tested ifup/ifdown of vlan interfaces
2015-02-10 11:28:53 -08:00
Roopa Prabhu
5828d8c5f9 Check for zero address on bridge ports before enslaving it to the bridge
Ticket: CM-4859, CM-4382
Reviewed By:
Testing Done: Tested with config which included bond bridge ports with
zero address on the bond.

The bridge driver rejects the port add with -EINVAL.
A bond with no slaves is one usecase where the bond interface
has a zero hw address and is rejected by the bridge.
EINVAL currently is very confusing.

This patch checks for a valid ether add before enslaving the port to the
bridge.
2015-02-10 11:17:00 -08:00
Roopa Prabhu
49e5c096bd Add dependency on python-argcomplete, python-ipaddr and python-gvgen
Ticket: CM-4453
Reviewed By:
Testing Done: Build tested
(cherry picked from commit ee9aa1a1bf510f950030f72cbc12ed41b0bc880d)
2015-02-09 17:27:35 -08:00
anuradhak
ff01349dd4 Move clag_enable setting to ifupdown2 ifenslave.
Ticket: CM-4802
Reviewed By:
Testing Done: yes

1. clag_enable needs to be set before slaves are added to the bond. Otherwise
bonding driver will bring the slaves up independent of clagd.
2. also added post_down clagd addon to cleanup the clag-id on ifdown.
2015-02-02 12:53:14 -08:00
anuradhak
67b8126335 [Change by Roopa] To prevent ifupdown2 setting clag-bond slave states on ifup.
Ticket: CM-4802
Reviewed By: CCR-2507
Testing Done: Yes

1. For clag bonds the slaves are kept down under various conditions (when clagd
is holding the bond in an errDisabled state). ifupdown2 should not set the slave
states for clag bonds.
2. Bonding driver sets the slave states on enslave and release (also for
non-clag bonds) so ifupdown2 doesn't need to set the slave state.
2015-02-02 12:53:14 -08:00
Roopa Prabhu
64db332a85 s/portautoedge/portadminedge/ + configure BA on uplink port
Ticket:
Reviewed By:
Testing Done:
2015-01-28 17:06:51 -08:00
Roopa Prabhu
7bbc934097 Handle blank lines correctly in addons.conf
Ticket: (Reported by gospo)
Reviewed By:
Testing Done: Tested with blank lines in the file
2015-01-22 12:56:56 -08:00
Roopa Prabhu
a53e80bca9 Fix typo in comment in default config file
Ticket:
Reviewed By: trivial
Testing Done: no code change
2015-01-16 09:54:19 -08:00
anuradhak
c4842479ad Added clag-id to the interfaces example file.
Ticket:
Reviewed By:
Testing Done:
2015-01-12 13:52:33 -08:00
Balakrishnan Raman
a57fc3a0bb change ifupdown example for vxlan-learning to the non-default option
Ticket: CM-4723
Reviewed By: CCR-2408
Testing Done:

Change example to non-default option - "vxlan-learning off"
2015-01-06 22:12:08 -08:00
Balakrishnan Raman
fce93c54de Fix BCM SDK tunnel termination object cleanup on vxlan tunnel delete
Ticket: CM-4723
Reviewed By: CCR-2408
Testing Done: vxlan_fld_test.py:test_bond_vxlinux_convergence_flaps, manual testing

On tunnel delete, tunnel termination object in BCM sdk is not cleaned properly.
As a result, mpls_entry in the hardware is left around even though software has
deleted the tunnel. This prevents subsequent dynamic creation of the same tunnel
and also mac learning, as mpls_entry points to invalid SVP with no CML setting
to do hardware learning.

Also, changes in ifupdown2 to make "vxlan-learning on" as default, so that
user/script doesn't have to explicitly turn on the learning.
2015-01-06 21:16:39 -08:00
Roopa Prabhu
404cc695a5 Move disable ipv6 error to info in mstpctl module (test scripts are
still using mstpctl-ports)

Ticket: CM-4622
Reviewed By:
Testing Done: Tested bridge sanity
2015-01-03 22:35:45 -08:00
Roopa Prabhu
d462f1fa2d Document ifreload new option + add it into init.d networking script
Ticket:
Reviewed By: trivial
Testing Done: Tested build/install/boot + ifupdown2 sanity
2015-01-03 00:27:35 -08:00
Roopa Prabhu
782fa53938 Warn when bond-min-links is absent or set to '0'
Ticket: CM-4327
Reviewed By:
Testing Done: Tested bond config without the bond-min-links attribute
2015-01-02 18:20:15 -08:00
Roopa Prabhu
0ba357128e Always set lacp-bypass-allow value to default if lacp-bypass-allow is
not given by the user

Ticket: CM-4552
Reviewed By:
Testing Done: Tested with and without lacp-bypass-allow in the file
2015-01-01 20:43:10 -08:00
Roopa Prabhu
a8f0880820 Moved warning to info level
Ticket: CM-4622
Reviewed By:
Testing Done: Tested ifup/ifdown on a bridge

If the file is not present, we will just log it.
2014-12-31 23:47:18 -08:00
Roopa Prabhu
00f6105d9f Add hack to flap macvlan dev if it already exists and if the route to the vrr network is pointing to it (part of commit 1ef86ab1930d198b0fba7ac33576c22f34d89f14)
Ticket: CM-4639
Reviewed By:
Testing Done: Tested with interfaces file and steps from the bug

This is a Hack to make sure the primary address
is the first in the routing table. Its not a full proof solution.

We use `ip route get` on the vrr network to see which
device the kernel returns. if it is the mac vlan device,
flap the macvlan device to adjust the routing table entry.
flapping the macvlan device makes sure the macvlan
connected route goes through delete + add, hence adjusting
the order in the routing table.
2014-12-31 23:43:27 -08:00
Roopa Prabhu
f8858144ef Add hack to flap macvlan dev if it already exists and if the route to
the vrr network is pointing to it

Ticket: CM-4639
Reviewed By:
Testing Done: Tested with interfaces file and steps from the bug

This is a Hack to make sure the primary address
is the first in the routing table. Its not a full proof solution.

We use `ip route get` on the vrr network to see which
device the kernel returns. if it is the mac vlan device,
flap the macvlan device to adjust the routing table entry.
flapping the macvlan device makes sure the macvlan
connected route goes through delete + add, hence adjusting
the order in the routing table.
2014-12-31 22:51:46 -08:00