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

22 Commits

Author SHA1 Message Date
Roopa Prabhu
cfa06db648 ifupdown2: syntax-check: exit with 1 if syntax errors
Ticket: CM-7995
Reviewed By: CCR-3850
Testing Done: Tested exit code on syntax errors

This patch adds members 'errors' and 'warns' to networkinterfaces.py
to track errors and warns during parsing interfaces file.

This patch also adds --syntax-check option to ifreload
given people seem to use ifreload more than ifup these days.

$ ifreload --syntax-check -a
error: /etc/network/interfaces: iface swp1.200: unsupported keyword (roopa-attr)
$ echo $?
1

(cherry picked from commit e643a136fcf5d387ff0f9a31cb6a6af4983e1012)
2015-12-09 13:53:55 -05: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
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
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
Sam Tannous
139662ee08 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.
2015-06-16 20:58:15 -04:00
Sam Tannous
6f10696cc3 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)
2015-06-04 15:32:48 -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
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
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
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
27f6acf555 Fix -a option documentation
Ticket: CM-3931
Reviewed By:
Testing Done:
2014-10-29 16:44:43 -07:00
Roopa Prabhu
15ef32ea14 Move ifupdown2addons into ifupdown2 pacakge
Ticket: CM-3864
Reviewed By:
Testing Done: Tested build and install

open item:
- cleanup stale ifupdown2-addons package files
2014-10-09 16:02:46 -07:00
Roopa Prabhu
c2e8e93e1d Fix a few options
Ticket: CM-3529
Reviewed By:
Testing Done: checked man pages
2014-08-26 14:19:13 -07:00
Roopa Prabhu
1b0b81a23f prefix ethtool attributes with "link-" to be compatible with
native ifupdown + documentation fixes

Ticket: CM-3000
Reviewed By: trivial + doc related
Testing Done: Ran precommit
2014-07-16 12:02:31 -07:00
Roopa Prabhu
522bf8e68b Fix bash completion for sudo users (mostly cosmetic) + man page and
example fixes

Ticket: CM-2911
Reviewed By: CCR-1637
Testing Done: tested ifupdown2 sanity and bash completion

The python argcomplete module that i use for ifupdown2 has a limitation
that it does not work with sudo when used in the global mode. But there is
a workaround for it online (long story short...instead of enabling the global
argparse complete ...the author recommends registering argparse complete bash
completion individually for your script). This patch does just that.

This patch also moves the udev overrides to their respective packages.
Two of them are owned by ifupdown2.

Conflicts:
	rootconf/default/home/cumulus/sysroot-complete
2014-06-10 19:31:50 -07:00
Roopa Prabhu
dbba401f4d remove native ifupdown support from bridge-utils, vlan, ifenslave and
mstpctl + some ifupdown2 documentation cleanup

Ticket: CM-1438
Reviewed By:
Testing Done: ifupdown2 sanity testing

Conflicts:
	patches/bridge-utils/series
2014-05-29 15:45:55 -07:00
roopa
93e8319a1f Move interfaces example generation script to under
/usr/share/python-ifupdown2

Ticket: CM-2643
Reviewed By:
Testing Done: Tested ifupdown2 sanity
2014-05-21 12:39:30 -07:00
roopa
d40e96ee4e man page cleanup + cleanup + minor fixes
Ticket: CM-1438
Reviewed By:
Testing Done: Tested ifupdown sanity
2014-04-25 16:09:14 -07:00
roopa
bbc7c379dc Fix manpage formatting
Ticket: CM-1438
Reviewed By:
Testing Done: Checked man page
2014-04-11 12:29:31 -07:00
roopa
91067b3d23 Remove batch support when deleting addresses. batching code does not
update the cache yet and that can cause problems during add

Ticket: CM-2491
Reviewed By:
Testing Done:

Still working on the cache update support during batching.
2014-03-27 16:36:54 -07:00
roopa
83c1f241fd minor fixes + cleanup + update manpage
Ticket: CM-1438
Reviewed By:
Testing Done:

- simplified the dot generator
2014-02-15 21:39:13 -08:00
roopa
e37ad4a607 cleanup, documentation and enable ifupdown2 by default
Ticket: CM-1438
Reviewed By:
Testing Done:

There are a few known issues listed in the TODO and KNOWN_ISSUES files
2014-02-14 09:55:19 -08:00