Commit Graph

1620 Commits

Author SHA1 Message Date
Roopa Prabhu
1720c3921a ifreload: --allow=class support
Ticket: CM-7939
Reviewed By: CCR-3732
Testing Done: Tested ifreload --allow=class
this now

The ifreload classes already supported allow. This just opens up the
option in /sbin/ifupdown

example 1:
---------
auto swp1
iface swp1

allow-test swp2
iface swp2

allow-test swp3
iface swp3

/* should only act on swp2 and swp3 */

example 2:
---------
auto swp1
iface swp1

allow-test swp2
iface swp2

allow-test br1
iface br1
	bridge-ports swp25 swp26

/* change  bridge name and do an ifreload */
auto swp1
iface swp1

allow-test swp2
iface swp2

allow-test br2
iface br2
	bridge-ports swp25 swp26

should delete br1 and create br2
2015-11-13 10:11:36 -08:00
Roopa Prabhu
641cbd1e7d rework mstpctl attribute ordering problem with bridge stp processing
Ticket: CM-6626
Reviewed By: CCR-3768
Testing Done: Tested with testcase specified in bug

There was an earlier implementation for this for 2.5.4 (CCR-3599 a quick
fix for 2.5.4).  This patch re-implements the fix.

This patch essentially handles stp set before and after the port is
processed. It replaces the below commit with the patch in this review

{noformat}
commit 3af351f0a005236e747913bb499c6165e3ec43a4
Author: Roopa Prabhu <roopa@cumulusnetworks.com>
Date:   Tue Sep 29 10:12:07 2015 -0700

    Fix mstp settings ordering issues when bridge stp is toggled on and
off
    (when mstp settings are specified under the port)

    Ticket: CM-6626
    Reviewed By: CCR-3599
    Testing Done: Tested the problem case mentioned in the bug (Plan to
    re-work the fix a bit for 2.5.5)
{noformat}

Example:
{noformat}

auto host1
iface host1
    mtu 9000
    bond-slaves glob swp[25-26]
    bond-mode 802.3ad
    bond-miimon 100
    bond-use-carrier 1
    bond-lacp-rate 1
    bond-min-links 1
    bond-xmit-hash-policy layer3+4
    clag-id 1
    mstpctl-portadminedge yes
    mstpctl-bpduguard yes

auto bridge
iface bridge
    mtu 9000
    bridge-vlan-aware yes
    bridge-ports peerlink host1
    bridge-stp on
    bridge-vids 1000-3000
    bridge-pvid 1

info log stmts:
--------------------
info: host1: ignoring mstpctl-portadminedge config (stp on bridge bridge
is not on yet)
info: host1: ignoring mstpctl-bpduguard config (stp on bridge bridge is
not on yet)
<snip>
info: bridge: processing bridge config for port host1
info: bridge: processing mstp config for port host1
info: executing /sbin/mstpctl showportdetail bridge host1
admin-edge-port
info: executing /sbin/mstpctl setportadminedge bridge host1 yes
info: executing /sbin/mstpctl showportdetail bridge host1
bpdu-guard-port
info: executing /sbin/mstpctl setbpduguard bridge host1 yes

{noformat}
2015-11-13 10:01:28 -08:00
Roopa Prabhu
74a4a724c3 Revert "Fix mstp settings ordering issues when bridge stp is toggled on and off"
This reverts commit 3af351f0a005236e747913bb499c6165e3ec43a4.
2015-11-13 10:01:28 -08:00
Wilson Kok
159dd3e8ec ifupdown: fixed bridge port pvid config on reboot
Ticket: CM-8161
Reviewed By: Roopa
Testing Done:

With vlan-aware bridge, when replacing a port's pvid, the kernel leaves
the port in the original pvid and relies on user space to explicitly
delete the port from that vlan if it is no longer a member of that.

ifupdown does that correctly in ifup and ifreload cases, but missed
removing the port from the default pvid during system reboot.  This
patch fixes that by removing the PERFMODE check specifically for pvid
that causes ifupdown to skip checking running config on reboot which
leads to the bug.

(cherry picked from commit 0461a3f3cc82691cd32b9f6dbefaacf7b23eaeea)
2015-11-10 14:27:43 -08:00
Roopa Prabhu
93b399fb8b Fix regression with ifreload when interface names change
Ticket: CM-8003
Reviewed By: CCR-3664
Testing Done: Tested renaming interfaces + ifreload
2015-10-27 13:02:21 -07:00
Roopa Prabhu
397214a54a Fix refcnt issue when multiple iface stanzas were presented for a white
listed interface that had a blacklisted parent

Ticket: CM-7851
Reviewed By: CCR-3664
Testing Done: Tested with auto/non-auto dependent and non-dependent interfaces

example config from sam:

iface swp3.100

auto swp3
iface swp3

iface swp3
      address 66.66.66.66/24
2015-10-20 14:30:53 -07:00
Sam Tannous
7444feea6d ifupdown2 should allow speed setting even with duplicate iface stanzas
Ticket: CM-6740
Reviewed By: roopa
Testing Done: tested multiple ifreloads with various test cases

In the case of duplicate iface stanzas where one of the stanzas sets
the link attributes, ifupdown2 was confused because the absence
of link attributes forced it to reset them to default values
(when they existed).

This patch tracks link changes and prevents resetting to defaults
only if there are no explicit settings configured.  Furthermore,
only the last interface processed (from the duplicates) will take
care of resetting to defaults.
2015-10-20 13:49:07 -04:00
Roopa Prabhu
1042b7096d Fix a few more minor issues with auto and non-auto interfaces
Ticket: CM-7851
Reviewed By: CCR-3664
Testing Done: Tested with auto/non-auto dependent and non-dependent
interfaces
2015-10-20 08:45:20 -07:00
Roopa Prabhu
e6a66e7998 change address on bridge and slave to an info message instead of a warn
Ticket: CM-6106
Reviewed By: CCR-3637
Testing Done: Tested address under a bridge

We had shipped example files with addresses under bridges and slaves
in 2.5.3. With the warning introduced in 2.5.4, we will start emitting
warnings for existing customer files. And I have recently
learnt that users are relying on warnings to detect errors.

With this commit I am changing the warn to an info message
to avoid breaking existing users. We can change it back to a warn in
3.0.

changed:
"warning: interface bridge is enslaved or a vlan aware bridge and cannot
have an IP Address"

to:
"info: bridge: ignoring ip address. Interface is enslaved or a vlan
aware bridge and cannot have an IP Address"

(cherry picked from commit ecb20279e3d3c123537b9e6fddea4590c63a5013)
2015-10-10 07:33:56 -07:00
Roopa Prabhu
4b5208d822 change shipping default ifupdown2.conf disable_cli_interfacesfile to 0
(ie to allow -i option)

Ticket: CM-7066
Reviewed By: CCR-3636
Testing Done: Tested ifupdown2 -i option

Administrators can protect from sudo users executing files with -i
by changing the disable_cli_interfacesfile=1 in ifupdown2.conf

I have uploaded the patch in CCR-3636. And checked with shm and nolan
before pushing this change in 2.5.4.

The default is being changed because of the fear of breaking existing
users of -i after an upgrade to 2.5.4.

The shipping default behaviour for -i will be revisited in 3.0
timeframe.

(cherry picked from commit 5dce566a94dafc99c441e66c412d8d66a083aa5e)
2015-10-10 07:33:47 -07:00
Roopa Prabhu
19e2bf8c08 Fix the return value for auto interface checks
Ticket: CM-7851
Reviewed By: CCR-3639
Testing Done: Tested a combination of auto and non-auto interfaces.

This fixes a regression introduced in 2.5.4 where ifreload was
picking up non-auto interfaces

This also fixes a minor issue with blacklisting interfaces introduced by
("450c679249b546dbc2cd97d81b49e011fec948bd remove blacklisted interfaces
only if they are upperifaces (ie root of the tree") when an interface
has multiple auto and non-auto stanzas (A rare case, but it was an easy
fix and around the same area).

example, the fix will now blacklist an interface only if all of its stanzas are
blacklisted. In the below example, swp4 is not blacklisted if user
specified auto because one of the iface stanzas is auto.

auto swp4
iface swp4

iface swp4
        address 10.0.14.2/24

(cherry picked from commit ad6d4567fdf9413c804a348c1712d8706934264a)
2015-10-10 07:33:28 -07:00
Sam Tannous
c28fc55eb9 Fix stdin issues with missing config filename ifquery for disable_cli_interfacesfile
Ticket: CM-7066
Reviewed By: roopa
Testing Done: unit tested and wrote new testcase in testifupdown2

Use case for ifquery where stdin used with -i breaks
because interfacesfileiobuf was not checked in addition to interfacesfilename.

Testcase like:

echo '[{"name": "swp1","auto": true,"config": {"address": "10.10.10.10/24"}}]' | ifquery -i - -t json swp1

would fail because while -i was given with stdin, the check for missing filename would produce an error.

It was also decided by consensus that the ifquery command does not need to have a check for
disable_cli_interfacesfile since a query "should" not pose a security check.

(I've also added some test cases for this in cl-tests).

(cherry picked from commit 4d37e932b43da87a9240a866be2d8b9508a9c7eb)
2015-10-10 07:33:07 -07:00
Roopa Prabhu
67cfaeb1cf remove blacklisted interfaces only if they are upperifaces (ie root of
the tree)

Ticket: CM-7765
Reviewed By: CCR-3621
Testing Done: tested interface dependencies with auto and non-auto
interfaces

This commit fixes a change in behaviour introduced by "460906d0552d" ("skip adding
filtered or blacklisted interfaces in the dependency graph") that
skipped non-auto (or blacklisted) interfaces.

Turns out we have files out there that do have non-auto
dependents. This patch makes sure blacklisted interfaces who are
dependents of other interfaces are always picked up.
2015-10-02 13:18:03 -07:00
Roopa Prabhu
a33e94f72b Introduce a lock file in non-persistent storage /run/network/ifstatelock
to make sure the state file in persistent storage is cleaned up
correctly

Ticket: CM-7774
Reviewed By: CCR-3623
Testing Done: Tested statefile accross reboots

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
2015-10-02 12:31:51 -07:00
Roopa Prabhu
97a907c5fe Fix mstp settings ordering issues when bridge stp is toggled on and off
(when mstp settings are specified under the port)

Ticket: CM-6626
Reviewed By: CCR-3599
Testing Done: Tested the problem case mentioned in the bug (Plan to
re-work the fix a bit for 2.5.5)

problem:
    mstp parameters can be specified under the port or under the bridge
    When they are specified under the bridge, there should be no problem
(When you process the bridge, all things on the bridge port are set in
order)
    When they are specified under the port:
    we check if the bridge is up, if yes, and stp is already configured,
we process mstpctl settings
    This check today only checks running stp_state
    We should also check the user configured stp state for the bridge
    Note that the problem exists only if the bridge and ports are
already up and user executes ifup again and when we need to re-evaluate
the bridge port settings

solution:
    When the bridge port is being checked for mstp settings, not only
check running stp state, but also check user specified stp state and
correct bridge stp state before proceeding with mstp configuration

Few things to note with this patch:
    - If user changed stp state on bridge to 'on', and did `ifup
    <bridge_port>'`,
    though the user has not ifup'ed the bridge yet, the bridge stp state
    will be applied (very few people will run into this and practically this
    should not be a problem atall. But from correctness POV it is
    a voilation. ).

    - To avoid this, the other solution would have been to let the bridge
    port code be as is, but handle this during bringing up the bridge,
    but, this can confuse the user, because when processing the
    bridge_port, you will still throw warnings even if the port stp config
    is later reapplied when the bridge comes up

    - note that the patch only handles the case when stp state is not on and
    somebody turned it on.  For the case where stp state was on and somebody
    turned it off, this patch wont throw warnings for the mstpctl config. But
    it will not cause any issues because once stp is off things will be ok
    everywhere. I want to keep any changes here out of this patch. I will
    document this in the bug...and see if i can handle this in 2.5.5
2015-09-29 10:22:58 -07:00
Roopa Prabhu
f012209e19 Fix ifquery json output for --running and other options
Ticket: CM-7635
Reviewed By: CCR-3575
Testing Done: Tested failing ifquery output in json format

This patch fixes a bug introduced by 0dea0cfeeec8b342ee2e2b767daa4071ac760f31
("Add support to display status (pass, fail) in ifquery --check json
output").

This patch separates the json encoders for iface objects with and
without status (ifaceJsonEncoder and ifaceJsonEncoderWithStatus) so
that they dont interfere with each other.
2015-09-24 15:47:31 -07:00
Roopa Prabhu
fb10449e55 Add support to display status (pass, fail) in ifquery --check json output
Ticket: CM-7464
Reviewed By: CCR-3507
Testing Done: Tested ifquery check sanity

ifquery --check non-json output displays 'pass' and 'fail' for
each attribute on the same line (see below). This output is not json
friendly. For json, include status in 'config_status' a dictionary
whose keys are similar to the 'config' dictionary but values are status
for the corresponding keys in the 'config' dictionary (see example below)

auto bond4
iface bond4 inet static
[pass]
    bond-mode 802.3ad                                           [pass]
    bond-miimon 100                                             [pass]
    bond-use-carrier 1                                          [pass]
    bond-lacp-rate 1                                            [pass]
    bond-min-links 1                                            [pass]
    bond-xmit-hash-policy layer3+4                              [pass]
    bond-slaves swp3 swp4                                       [pass]

[
  {
    "name": "bond4",
    "addr_method": "static",
    "addr_family": "inet",
    "auto": true,
    "config": {
      "bond-use-carrier": "1",
      "bond-miimon": "100",
      "bond-lacp-rate": "1",
      "bond-min-links": "1",
      "bond-slaves": "swp3 swp4",
      "bond-mode": "802.3ad",
      "bond-xmit-hash-policy": "layer3+4"
    },
    "config_status": {
      "bond-use-carrier": "pass",
      "bond-miimon": "pass",
      "bond-lacp-rate": "pass",
      "bond-min-links": "pass",
      "bond-slaves": "pass",
      "bond-mode": "pass",
      "bond-xmit-hash-policy": "pass"
    },
    "status": "pass"
  }
]
2015-09-17 21:57:06 -07:00
Roopa Prabhu
264dcaa073 Make sure an interface is down (in the bond case, its slaves are also
down) when setting mac address

Ticket: CM-6982
Reviewed By: CCR-3516
Testing Done: Tested ifreload setting of mac on an already up bond
2015-09-17 11:26:56 -07:00
Roopa Prabhu
b4ea30ca2c Fix batch_commit to reset vars if batch buffer is NULL.
Ticket: CM-6982
Reviewed By: trivial but imp
Testing Done:

This will make sure a stale batch.start() with no real batch commands
is ended cleanly.
2015-09-17 11:26:38 -07:00
Wilson Kok
dae9c5dee0 ifupdown: vxlan-remoteip not getting applied when vxrd is not configured to run
Ticket: CM-7410
Reviewed By: CCR-3470
Testing Done:

When vxrd is not enabled in /etc/default/vxrd, the 'service vxrd status'
command returns 0, causing the vxlan-remoteip to be not applied even
though it should have. Fix is to change to checking pidfile of vxrd.
2015-09-10 14:00:53 -07:00
Roopa Prabhu
42a9d19335 Add a check to see if it is indeed a bridge port before applying mstpctl
config

Ticket: CM-6965
Reviewed By: CCR-3472
Testing Done: Tested with interfaces file specified in the bug
2015-09-09 11:43:19 -07:00
Roopa Prabhu
f6d2d5eab5 fix errors in examples that were generate warnings
Ticket:
Reviewed By: trivial
Testing Done: Tested all example files with latest from 2.5.4
2015-09-09 11:21:24 -07:00
Roopa Prabhu
21289e4a74 warn on stale interfaces left as dependents + warn on reuse of bond
slaves under other interfaces

Ticket: CM-7322, CM-6772
Reviewed By: CCR-3464
Testing Done: Tested with faulty configs and checked for warnings
2015-09-04 16:16:12 -07:00
Balakrishnan Raman
a794fb3142 ifupdown2 changes for vxlan anycast_ip, head-end fdb entries, protodown
Ticket: CM-7087
Reviewed By: CCR-3379
Testing Done: unit testing with clag_vxlan_clos_spec/cfg.py

On clag pairing, clagd changes local address of vxlan device to anycast ip.
If user does ifreload now, ifupdown2 will overwrite local address with
individual ip contained in /etc/netwrok/interfaces. vxlan.py caches
anycast_ip configuration so that ifquery -c can skip it from flagging error
and ifreload skip overwriting vxlan device's local ip.

vxrd provisions head-end replication endpoints by adding bridge fdb entries.
If /etc/network/interfaces doesn't have remote-ip attribute, then on ifreload
ifupdown2 will delete all vxrd provisioned entries. ifupdown will check for
presence of vxrd service and skip add/delete bridge fdb entries for
head-end replication

On ifreload vxlan device are put in proto-down even if they are up and running.
Check for operstate and put it in proto-down only if operstate transitions from
down to up.
2015-09-04 00:38:47 -07:00
Balakrishnan Raman
0be01c1048 Fix ifupdown2 pre-up order
Ticket: CM-7313
Reviewed By: trivial
Testing Done: tested in active-active vxlan scale testbed

With recent change to ifupdown2 to create dummy devices (CM-3525), pre-up
sequence has been inadvertently changed to invoke clag before vxlan. This
causes protodown of vxlan device by clag addon to happen before vxlan device
gets added. Revert the pre-up order to have vxlan pre-up before clag's.
2015-08-31 16:28:52 -07:00
Roopa Prabhu
2ec2da0cf9 new ifupdown2 link module to create dummy devices
Ticket: CM-3525
Reviewed By: CCR-3326
Testing Done: Tested creating dummy devices using ifupdown2

This is modification to gospos loopback module. It solves the same
purpose ie using linux dummy device like a loopback device but there were
objections on calling it loopback so i have renamed it to link and i have changed it
into a generic module that can do any 'ip link'. Can be extended for
link args in the future.

below example creates a loopy device

$ifquery loopy
auto loopy
iface loopy
link-type dummy

$ifup loopy
$ifquery -c loopy
auto loopy
iface loopy [pass]
link-type dummy [pass]

(cherry picked from commit 1151420408a53c106d29183a1e0da5562c8b03a3)
2015-08-29 07:02:50 -07:00
Sam Tannous
7496605db3 ifupdown2 ethtool does not handle link-* settings on enslaved ports
Ticket: CM-7128
Reviewed By: Trivial
Testing Done: unit tested on Ken's machine

The ifupdown2 ethtool addon module fails to set/check
the link-speed on bridge ports.
I removed excessive ifaceLinkKind checking since CM-6619
(03642a9a) added BRIDGE_PORT and BOND_SLAVE.  This is ok
since we now check to see if ports have defaults (only swp do)
before showing or changing settings).
2015-08-20 23:12:26 -04:00
Sam Tannous
1e6d7bd76c add param in ifupdown2.conf to prevent fupdown2 users from specify interface config file on the CLI
Ticket: CM-7066
Reviewed By: scotte,roopa,olson
Testing Done: Unit testing and regression testing

This patch does two things:

1. It moves the interfaces config file name to the ifupdown2.conf file in /etc/network/ifupdown2.
This should allow administrators to specify a config file location different from the default and allow
subsets of users to use it without giving them access to specifying their own with the -i option in ifup/ifdown.

2. It also adds a new config setting called "disable_cli_interfacesfile" used to prevent users
from specifying their own interfaces file. This defaults to "1" (even if it is not configured).

Note: this new default takes away users ability to specify an interfaces file.

This should close the vulnerability where users could specify their own interfaces file
and add arbitrary user commands.

This leaves the shell=True option in the user commands add-on module since the ifup/ifdown/ifreload/ifquery
commands already require root access to run and the interfaces config file also requires root access to modify.
2015-08-20 22:59:44 -04:00
Wilson Kok
a2f424643a ifupdown: added bridge-allow-untagged bridge port option
Ticket: CM-6862
Reviewed By: CCR-3278
Testing Done:

Currently, ifupdown implicitly configures pvid on a bridge port
in case user doesn't configure it.  There is no way to configure
a bridge port to not accept untagged packets.  The new option
allows user to do that without changing the current default
behavior.
2015-08-10 14:38:57 -07:00
Wilson Kok
b37ec99a0c ifupdown: fixed warning when apply lacp attributes to non lacp bonds
Ticket: CM-6161
Reviewed By: Roopa
Testing Done:

Check bond mode when applying lacp attributes.
2015-08-10 14:19:09 -07:00
Roopa Prabhu
69cbf895be change /bin/bridge path to /sbin/bridge to be same as upstream
Ticket: CM-6519
Reviewed By:
Testing Done: sanity test

(cherry picked from commit 8b1ce802d6d156dd6657d6e350ebc356a285e528)
2015-08-08 23:59:57 -07:00
Roopa Prabhu
4994b48f42 change /bin/bridge path to /sbin/bridge to be same as upstream
Ticket: CM-6519
Reviewed By:
Testing Done: sanity test
2015-08-08 23:14:55 -07:00
Roopa Prabhu
ff50f301d5 move ifupdown2/* .
ifupdown2 code was one level deeper because ifupdown2 initially
had ifupdown2 and ifupdown2-addons as two separate packages.
Since they were combined into one package, it makes sense to
move all combined code under the top level directory

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
2015-08-02 05:05:52 -07:00
Satish Ashok
34cdd4a39c break down the bridge port batch add in ifupdown2
Ticket:  CM-6496
Reviewed By: CCR-3196
Testing Done:

The "ip batch command to add a bridge port and flush the dev" command with 1k netdevices was taking 1.4G of memory. With 2k netdevices batch, this command was causing a OOM condition. To avoid this, commit the batch after 250 ports. Ideally we have to look at the internal batch implementation to see if there is an underlying issue.
2015-07-30 15:01:24 -07:00
Sam Tannous
4dcac660c2 Document --exclude option a little better for ifupdown2
Ticket: CM-6587
Reviewed By: roopa
Testing Done: checked man paged

If we do an ifdown on all ports and try to exclude a bond or bridge port.
But we also have an iface defined for swp1 or swp4
(even if these are empty).
The lower interfaces will not be excluded. So if we
do an "ifdown -a -X bridge", swp ports in the bridge or bond
will go down effectively bringing a bond or bridge down.

This patch simply adds some documentation to the man pages.

ifupdown2 never follows dependents if the user has given an
interface list (unless explicitly requested with --with-depends
option which is available with some options).
2015-07-30 11:15:17 -04:00
Sam Tannous
55072bd128 ifupdown2 patch to properly remove address-virtual mac addresses
Ticket: CM-6702
Reviewed By: roopa
Testing Done: unit and smoke tested with ifupdown2 suite

When address-virtual mac adddress is modified, removed from an SVI, or the SVI is removed,
the permanent mac address is not removed.

This patch addresses all three cases but creating a global statemanager instance
and removing address-virtual FDB entries that were previously configured.
2015-07-23 15:43:45 -04:00
Balakrishnan Raman
27f2a937d8 ifupdown2 fixes for svcnode, vxlan-ageing, bridge-vlan-aware
Ticket: CM-6815, CM-6816, CM-6817
Reviewed By: CCR-3234
Testing Done: unit testing

CM-6815 : ip link set syntax for svcnode has been changed. Absence of svcnode
will retain the existing values. svcnode 0.0.0.0 is needed to wipe out service
node addresses in vxlan device. Modified ifupdown2 to use svcnode 0.0.0.0 to
clean up service node address.

CM-6816: "bridge-clan-aware no" is not handled in query-check and hence ifquery
on bridge interface with "bridge-vlan-aware no" fails. Modified bridge's
query-check to take care of this.

CM-6817: With default ageing value (300), if query -c <vxlan device> was
failing. Set ageing to 300 if not specified and compare it with running config.
2015-07-23 12:17:47 -07:00
Roopa Prabhu
65e0c27674 Dont up a vlan aware bridge during upper iface bringup (optimization)
Ticket: CM-6619
Reviewed By: CCR-3191
Testing Done:  Tested upperiface bringup for bridge and vlan devices

'up' on bridge was always done to add the newly created port to the bridge
in cases where the bridge is not part of the interfaces being brought
up. But This will try to re-apply bridge port attributes on all bridge
ports and that can take a while when there are large number of bridge
ports. This patch currently avoids the bridge up for only the vlan
aware bridge case.
2015-07-23 10:17:02 -07:00
Roopa Prabhu
56e6d1009c Merge branch 'CumulusLinux-2.5_br' of ssh://stash.cumulusnetworks.com:7999/ccmr/cumulus into CumulusLinux-2.5_br 2015-07-23 10:15:43 -07:00
Sam Tannous
6cb589dfdf Allow customer set bond defaults for CL with ifupdown2
Ticket: CM-6723
Reviewed By: roopa
Testing Done: unit tested and testifupdown2 test suite

This patch installs bond interface defaults in

     /etc/network/ifupdown2/policy.d/bond_defaults.json

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
2015-07-22 18:38:07 -04:00
Roopa Prabhu
cb5ee151ff Merge branch 'CumulusLinux-2.5_br' of ssh://stash.cumulusnetworks.com:7999/ccmr/cumulus into CumulusLinux-2.5_br 2015-07-13 15:19:47 -07:00
Roopa Prabhu
31b2afbe89 Merge branch 'CumulusLinux-2.5_br' of ssh://stash.cumulusnetworks.com:7999/ccmr/cumulus into CumulusLinux-2.5_br 2015-07-13 15:02:14 -07:00
Roopa Prabhu
c78cae3d24 Fix ip addr parsing breakage on sid
Ticket:
Reviewed By: stannous
Testing Done: sanity testing
2015-07-13 14:33:01 -07:00
Roopa Prabhu
f63fb59d27 Merge branch 'CumulusLinux-2.5_br' of ssh://stash.cumulusnetworks.com:7999/ccmr/cumulus into CumulusLinux-2.5_br 2015-07-13 14:26:28 -07:00
Sam Tannous
29de56fe14 apt-get remove of python-ifupdown2 fails due to postrm script error
Ticket: CM-6655
Reviewed By: Trivial
Testing Done: tested install and removal of python-ifupdown2

There was an invalid equality test in the postrm script for
ifupdown2.  In Dash, equality is tested with a single '='
and not '=='.
2015-07-13 11:12:44 -04:00
Roopa Prabhu
06e398ff47 Move interface name check to networkinterfaces.py where all other parse
errors are reported

Ticket: CM-5882
Reviewed By: stannous
Testing Done: Tested with a long interface name
2015-07-09 11:07:06 -07:00
Roopa Prabhu
cabbb4dc93 Merge branch 'CumulusLinux-2.5_br' of ssh://stash.cumulusnetworks.com:7999/ccmr/cumulus into CumulusLinux-2.5_br 2015-07-09 11:04:39 -07:00
Sam Tannous
9fe90c103e 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.
2015-07-09 13:40:00 -04:00
Roopa Prabhu
9432c6717e Catch the interface long error during parsing
Ticket: CM-5882
Reviewed By:
Testing Done:
2015-07-08 21:08:43 -07:00
Sameer Ladiwala
0f6dc7e67a vxfld: ifupdown2 addon for vxrd
Ticket: CM-6358
Reviewed By: roopa
Testing Done: Yes

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
2015-07-06 13:42:37 -07:00