and allows users to modify this file. Users can then leave out these
bond attributes in their configs to save typing and space.
It also changes the ifenslave and ifenslaveutil module to bond and
bondutil, respectively to be consistent with other modules
(and also because customers think of "bond" interfaces not
"ifenslave" interfaces.)
For example, the default file installed looks like the following:
{
"README": "This file is user generated and modifiable.",
"bond": {
"defaults": {
"bond-mode": "802.3ad",
"bond-miimon": "100",
"bond-use-carrier": "1",
"bond-lacp-rate": "0",
"bond-min-links": "1",
"bond-xmic-hash-policy": "layer3+4"
}
}
}
Please enter the commit message for your changes. Lines starting
Sam Tannous [Thu, 9 Jul 2015 17:40:00 +0000 (13:40 -0400)]
ifupdown2 ethtool add-on module should not get unnecessary running configs for performance reasons
Ticket: CM-6630
Reviewed By: roopa
Testing Done: unit tested
We still run ethtool on most interfaces even if we don't have defaults to use.
The last bug I fixed (CM-6557) should have also fixed that (even if it was specific to
ifquery).
We now check if there is a configured attribute and if there is a default
value. If we do not have both, we continue without calling ethtool to get the running value.
ifupdown2 creates overrides vxrd's config when either (or both) the vxrd-src-ip and vxrd-svcnode-ip appear under the loopback interface's configuration.
Example
address 12.0.0.4/32
vxrd-src-ip 12.0.0.4
vxrd-svcnode-ip 99.99.99.9
Sam Tannous [Thu, 2 Jul 2015 21:14:24 +0000 (17:14 -0400)]
Running ifquery --running -a will truncate the pvid number to a single digit
Ticket: CM-6284
Reviewed By: roopa
Testing Done: unit tested change
Running ifquery --running -a will truncate the pvid number to a single digit for the bridge.
This patch appendis the entire pvid instead of only the first character.
Sam Tannous [Thu, 2 Jul 2015 19:59:34 +0000 (15:59 -0400)]
ifquery --running should not show link attributes on logical interfaces
Ticket: CM-6557
Reviewed By: roopa, gospo
Testing Done: unit tested
ifquery should not show link attributes for interfaces we do not have defaults for.
Although somewhat useful, we don't want people saving the bond link attributes
to try to use then in a config
Sam Tannous [Tue, 30 Jun 2015 17:47:08 +0000 (13:47 -0400)]
ifreload causes unnecessary dhcp restart for eth0
Ticket: CM-5730
Reviewed By: roopa
Testing Done: tested change on Sean and Jason's lab setup
The dhcp restart on all interfaces using dhcp causes a reconnection
for NTP and in addition, a recent addition of rack management packages
(CM-5782) added ntp and a exit-hook script that also interrupted NTP
for a second time. This patch will check for dhclient running (IPv4 and IPv6)
and not restart dhcp if it's already running.
Sam Tannous [Wed, 24 Jun 2015 15:39:56 +0000 (11:39 -0400)]
ifupdown2 should not allow IP address command under vlan aware bridge stanza
Ticket: CM-6106
Reviewed By: roopa,scotte
Testing Done: ran ifupdown2 regression suite and hand tested
This patch prevents IP address assignment under vlan aware bridges.
This prevents some confusion because a bridge subinterface is required
for layer 3 termination.
Roopa Prabhu [Mon, 22 Jun 2015 00:37:27 +0000 (17:37 -0700)]
skip adding filtered or blacklisted interfaces in the dependency graph
Ticket:
Reviewed By: CCR-3043
Testing Done:
This was resulting in lower interfaces not being brought up at boot
when their upper-ifaces were not-marked auto. And this was because
the dependency graph continued to have the non-auto upper interfaces
and the whole tree was ignored by the scheduler.
This fix eliminates filtered interfaces from the dependency graph
to simplify the scheduler and also to avoid scheduler picking up
non-auto (or non-class interfaces).
testcase (Without this patch swp1 was skipped at boot)
iface swp1.100
Sam Tannous [Sat, 20 Jun 2015 01:27:49 +0000 (21:27 -0400)]
Eliminate confusing and unnecessary ethtool calls
Ticket: CM-6275
Reviewed By: roopa,dustin
Testing Done: Unit tested and ran complete ifupdown2 test suite
There are unnecessary calls to the ethtool module that cause some error messages to be printed.
We currently don't check ifaceobj.link_kind at the start
so this check was added.
If someone creates a new interface without setting link_kind, we still printed error message.
This patch adds a check at the start of ethtool.
This patch also removes the global link defaults (used by ifupdown2/ethtool)
created when update-ports is called. The defaults are created for each swp port
so we don't have defaults (and therefore will not attempt to set) for interfaces
like eth0, loopbacks, dummys, vxlans, or any other non swp interface.
Ticket: CM-3715
Reviewed By: CCR-3065
Testing Done: unit testing
Changes to proto down vxlan devices to avoid packet loops or duplicates before
clagd checks consistency and installs egress acl rules. When vxlan device is
brought up, check for presence of peer link and proto-down the device if peer
link exists.
- get_dependent_ifacenames is used to eliminate order dependency in specifying
peer link and vxlan configuration in /etc/network/interfaces.
- A separate script clagVxlanProtoDown is used to protodown vxlan devices if
peer link is configured separately (ifup peerlink) and vxlan devices are
already functional in the system.
Sam Tannous [Wed, 17 Jun 2015 00:58:15 +0000 (20:58 -0400)]
Enhance globbing in ifupdown2 to support breakout cables
Ticket: CM-5365
Reviewed By: roopa,dwalton
Testing Done: Ran regression suite and hand tested.
This patch extends the globbing support in ifupdown2
to handle two levels of square brackets so that breakout
cables can be handled (e.g. swp[2-7]s[0-3]). Also modified
the user's guide and the man pages.
Sam Tannous [Tue, 16 Jun 2015 21:15:57 +0000 (17:15 -0400)]
vxlan error 'str' object has no attribute 'append'
Ticket: CM-6329
Reviewed By: roopa
Testing Done: unit testing with vxlan configs
A bug iproute2.py creates an unnecessary warning
about appending the ageing value to a string.
This patch removes the append and simply sets the ageing value.
Sam Tannous [Wed, 20 May 2015 14:15:39 +0000 (10:15 -0400)]
Document exclude (-X) option in ifreload
Ticket: CM-5419
Reviewed By: Trivial
Testing Done: built ifupdown2 deb and tested on switch
This patch adds man page mention of undocumented (but working)
option to exclude interfaces from a reload (-X option)
(cherry picked from commit 0358905782a4c0290a967d6f730fdcb27f2af3d9)
Sam Tannous [Sun, 10 May 2015 19:42:47 +0000 (15:42 -0400)]
Add default link parameter support for ethtool module
Ticket: CM-5254
Reviewed By: roopa
Testing Done: tested master and 2.5_br images with testifupdown2 suite and hand tested
This patch creates a json defaults file upon bootup
(which can be overridden by customer configs in /etc)
which the ethtool module in ifupdown2 will consult
when "link-x" configs are removed in order to restore
them to the initial settings used by the switch.
(cherry picked from commit 8388664f5a5a85f2a813cafbf40ac92d7b86f4bf)
Sam Tannous [Thu, 5 Mar 2015 17:54:55 +0000 (12:54 -0500)]
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)
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
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.
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>
Jonathan Toppins [Tue, 21 Apr 2015 21:07:46 +0000 (14:07 -0700)]
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
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)
Sam Tannous [Fri, 24 Apr 2015 00:19:22 +0000 (20:19 -0400)]
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.
Jonathan Toppins [Mon, 20 Apr 2015 20:41:05 +0000 (13:41 -0700)]
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.
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.
Replaced vxlan-peernodeip attribute with vxlan-remoteip. Updated
the vxlan and iproute2 modules to configure head end replication
using bridge fdb commands.
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.
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.
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.
Roopa Prabhu [Tue, 10 Feb 2015 19:17:00 +0000 (11:17 -0800)]
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.
anuradhak [Mon, 2 Feb 2015 17:54:53 +0000 (09:54 -0800)]
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.
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.
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.
Roopa Prabhu [Thu, 1 Jan 2015 07:43:27 +0000 (23:43 -0800)]
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.
Roopa Prabhu [Thu, 1 Jan 2015 06:51:46 +0000 (22:51 -0800)]
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.
anuradhak [Sun, 28 Dec 2014 15:07:47 +0000 (07:07 -0800)]
Changes to replace clagid setting in the bonding driver with -
1. clag_enable flag in the bonding driver
2. And clagid in clagd
Ticket: CM-4091
Reviewed By:
Testing Done: yes
1. Two new commands have been introduced in clagctl - setclagid and showclagid.
These commands will be used by ifupdown2 to set and read/check the clagid.
2. In addition a bit will be maintained per-bond in the bonding driver to
indicate if a bond is a CLAG bond.
(cherry picked from commit cb160bad45d330fe5f544d0d9a40c1c77b9b563f)
anuradhak [Tue, 2 Dec 2014 19:32:53 +0000 (11:32 -0800)]
CLAG id for 2.5.0
Ticket:
Reviewed By:
Testing Done: Yes
1. ifupdown2/bonding-driver changes to show/store clag-id (errDisabled/dormant states for bond slaves will follow in 2.5.1)
2. clagd changes for
a. --forceDynamic - clagid is ignored in this mode
b. (default) static mode - clagid is matched along with partner mac for dualConnection; also ad_sys_mac is only changed for clag bonds (bonds with a non-zero clag-id).
Roopa Prabhu [Fri, 26 Dec 2014 17:39:52 +0000 (09:39 -0800)]
Suppress 'Network down' warnings when link_master_slave feature is on
Ticket: CM-4462
Reviewed By:
Testing Done: Tested with interfaces file given in the bug.
The 'network down' msg from the kernel is when the lower device is not
'admin up'. In CM-4462 it is seen when the vlan interface on the bond
is 'admin up' when the bond is still in 'admin down' state.
The bond is also a bridge port so, bond will be 'admin up' when
the bridge it belongs to is brought up.
As link_master_slave feature is on only when all network interfaces
are brought up/down, the states of all interfaces will eventually
converge to 'admin up', so ignoring such transient 'network down' messages.
- moved 'admin up' delays that we introduced recently to be
configurable via two ifupdown2.conf attributes
# Let link master (bridges, bonds) own the link state of slaves
link_master_slave=1
# Delay admin state change till the end
delay_admin_state_change=0
- reduced some redundant traversal of dependency trees
Roopa Prabhu [Tue, 9 Dec 2014 21:49:23 +0000 (13:49 -0800)]
Add clagd in the default shipped addons.conf and remove the editing of
addons file
Ticket: CM-4423
Reviewed By:
Testing Done: tested ifupdown2 in the presence and absence of clagd
This is a hack to get around an ifupdown2 limitation.
The real fix should come as part of CM-3782
(cherry picked from commit 6fb63d6cdcb660063cf5d07ff28f49c34a306371)