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

40 Commits

Author SHA1 Message Date
Julien Fortin
3218f49d81 use "except Exception:" instead of "except:"
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2020-06-24 01:12:24 +02:00
Julien Fortin
62d960cc1b completion: removing argcomplete support
this feature doesn't seem to be working anyway. This can be revisited in the
future but this allows us to drop the python3-argcomplete dependency for now

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2020-04-14 16:50:04 +02:00
Julien Fortin
3b01ed7618 python3: 2to3 changes
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2019-12-17 16:55:49 +01:00
Maximilian Wilhelm
b1a2d2417b Add addon module for B.A.T.M.A.N. advanced interface configuration. #12
batman wasn't in master-next so it got removed during the last merge
this commit adds it back to master.
See PR #12

From Maximilian Wilhelm:
  This commit adds support for configuring B.A.T.M.A.N. advanced interfaces
  with ifupdown2. B.A.T.M.A.N. advanced is a protocol to build Layer2 based
  mesh networks with. It's supported in the Linux kernel and thus available
  in many Linux environments.

  A configuration could look like this

  auto bat0
  iface bat0
      batman-ifaces eth1 eth2.23
      batman-ifaces-ignore-regex .*_nodes
      batman-hop-penalty 23
      #
      address 192.0.2.42/24

  where »bat0« would be the local connection to the mesh network.

  The interfaces »eth1« and »eth2.23« would be used by the B.A.T.M.A.N. adv.
  protocol to communicate to other member of the mesh network.

  Any interfaces matching the »ifaces-ignore-regex« will be gently ignored
  by ifquery and ifreload as there might be some tunnels or interfaces
  added to the mesh network by other means which should not be removed by
  any subsequent ifreload run.

  The »hop-penalty» parameter set the penalty of this node within the mesh
  network.

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
Signed-off-by: Maximilian Wilhelm <max@rfc2324.org>

Author: Maximilian Wilhelm <max@rfc2324.org>
2018-12-19 07:12:58 +01:00
Julien Fortin
d486dd0df0 ifupdown2 2.0.0 release
This is a major update coming all at once from master-next branch
master-next branch was started with --orphan option which is basically a new
branch without history.

The major changes are:
    - repackaging
    - cleanup the directory tree
    - rewritte setup.py to allow install from deb file or pypi (pip install)
    - add a Makefile to make things (like building a deb) easier
    - review all debian files

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2018-12-13 11:43:32 -08:00
Julien Fortin
f00d85a17a docs: examples: new batman_adv folder with configuration script and example
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2018-03-13 14:43:59 +11:00
Julien Fortin
1a1f332dda docs: examples: fixing merge errors
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2016-10-05 20:13:28 +02:00
Julien Fortin
ea18ed2c47 docs: examples: interfaces: fixing merge error
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2016-10-05 20:06:19 +02:00
Julien Fortin
baadcc71e4 docs: examples: adding new example interface file
Ticket: None
Reviewed By: Roopa
Testing Done:

This new interface file uses bridge, vlan, vxlan, bond and vrf interfaces.
It's a good way to try ifupdown2 capabilities.

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2016-10-05 16:53:46 +02:00
Roopa Prabhu
d6dd6fe653 Merge remote-tracking branch 'cumulus/dev' 2016-06-06 13:18:39 -07:00
Julien Fortin
594fb088e8 small easy: support (0|1) or (off|on) attribute while keeping backward compatibility
Ticket: CM-8866
Reviewed By: Roopa
Testing Done:

added support for:
* bond-lacp-bypass-allow (0|1)
* bond-use-carrier (0|1)
* bridge-mcqifaddr (0|1)
* bridge-mcquerier (0|1)
* bridge-mcrouter (0|1)
* bridge-mcsnoop (0|1)
* bridge-portmcrouter (0|1)
* link-autoneg (off|on)
* vxlan-learning (off|on)

these 2 are not yet supported by ifupdown2:
* bond-lacp-bypass-all-active (0|1)
* bond-lacp-fallback-allow (0|1)

This one is left untouched. yes/no doesn't make sense for this attribute.
* bond-lacp-rate (0|1)

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2016-06-16 03:37:36 +01:00
Julien Fortin
e909bd85c3 examples: generate interfaces: will fetch pci interfaces when porttab is missing
Ticket: CM-10751
Reviewed By: Roopa, Nikhil
Testing Done: exec script without porttab

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2016-06-16 03:37:34 +01:00
Julien Fortin
3f917631c3 docs: examples: generate_interfaces: display unsupported message when porttab file is not found
Ticket: CM-10751
Reviewed By: Roopa, Nikhil
Testing Done: tested the script with and without porttab file

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2016-05-05 01:47:04 +02:00
David Ahern
dad6af7eb7 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>
2016-03-16 17:33:40 -06:00
David Ahern
fc7e1fa2cc 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>
2016-02-29 15:22:56 -08:00
Roopa Prabhu
59dad2ca80 debian: sync debian files with from upstream debian repo
These include changes that were done to move ifupdown2
to use pybuild and some debian policy fixes

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
2015-12-20 23:06:12 -08: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
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
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
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
547084c312 un-glob expression in sample file
Ticket:
Reviewed By: trivial
Testing Done: Tested that sample works fine
2015-07-01 15:00:07 -07: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
Roopa Prabhu
0edaee373f merge docs.addons content into docs directory
Ticket:
Reviewed By:
Testing Done:
2015-03-10 14:18:30 -07: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
anuradhak
c4842479ad Added clag-id to the interfaces example file.
Ticket:
Reviewed By:
Testing Done:
2015-01-12 13:52:33 -08:00
Roopa Prabhu
7ce1bb50e9 Fix a few more s/br/bridge/g
Ticket: CM-3346
Reviewed By:
Testing Done:
(cherry picked from commit e63e03e90af531ab660dca03f437f8432337c5d3)
2014-11-26 13:08:08 -08:00
Roopa Prabhu
5e4f0612fa Delete stale example files
Ticket: CM-3346
Reviewed By:
Testing Done: sanity tests
(cherry picked from commit ea6f72f628abc3758f4bf665a1c90e6d50860aea)
2014-11-26 13:07:55 -08:00
Roopa Prabhu
8c8dab1a3f Change names and s/br/bridge/
Ticket: CM-3346
Reviewed By:
Testing Done: Tested ifupdown2 sanity with all example files
(cherry picked from commit 40a3f646548c35bda34f4d41adb2e935374bb029)
2014-11-26 13:07:12 -08:00
Roopa Prabhu
84bf47c60a Fix clag example
Ticket: CM-3346
Reviewed By: scotte
Testing Done:
2014-11-17 04:45:45 -08:00
Roopa Prabhu
a5bbc8ed41 Fix comment
Ticket: Cm-3346
Reviewed By:
Testing Done:
2014-11-15 23:32:56 -08:00
Roopa Prabhu
7e39bbdfcf Add vlan aware bridge examples
Ticket: CM-3346
Reviewed By: pending review
Testing Done: example files are tested
2014-11-15 23:22:01 -08:00
Roopa Prabhu
904908bc5f Documentation cleanup
Ticket:
Reviewed By:
Testing Done:

- these changes are mainly related to api doc generation using sphinx
2014-07-22 11:15:56 -07:00
Roopa Prabhu
2c0ad8b338 Doc updates + cleanup
Ticket: CM-2297
Reviewed By:
Testing Done: compile tested

more updates coming ...
2014-07-17 11:44:36 -07:00
Roopa Prabhu
c25e5b6521 Add a new ifupdown2 example to cover bridge igmp and mstp attributes
Ticket: CM-1438
Reviewed By: TBD
Testing Done: Tested the example file with ifupdown2
2014-07-16 14:07:41 -07:00
Roopa Prabhu
f102ef630d Fix splits everywhere to include space and tabs. Use regex split
Ticket: CM-3121
Reviewed By:
Testing Done: Ran precommit

Conflicts:
	packages/ifupdown2-addons/pkg/modulebase.py
2014-07-16 13:51:00 -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
883f7f83f2 Add examples and script to generate sample interfaces file
Ticket: CM-2643
Reviewed By:
Testing Done: Tested build/install

This also pulls in python-gvgen package from wheezy sid into our
upstream dir. Previously i had packaged the gvgen module directly
into the ifupdown package
2014-05-19 07:00:12 -07:00
roopa
47cd15c473 Update examples file
Ticket: CM-1438
Reviewed By:
Testing Done:
2014-01-30 19:46:52 -08:00
roopa
4716e0e5c9 Some fixes + enhancements
Ticket: CM-1438
Reviewed By:
Testing Done: Tested installing new ifupdown on the box

- fixed a few things in ifquery
- added new perfmode to skip some of the checks (useful during boot when there is
  no previous state)
- updated doc dir with example
- Added README, TODO and KNOWN_ISSUES file
2013-11-10 22:35:40 -08:00