1
0
mirror of https://github.com/CumulusNetworks/ifupdown2.git synced 2024-05-06 15:54:50 +00:00
Nikhil 22945dd634 addons: mstpctl: complete ifquery -r support
Ticket: CM-7841
Reviewed By: roopa, julien
Testing Done: tested all the bridge attributes

added 'ifquery -r' support for 'mstpctl-portpathcost', 'mstpctl-treeportcost', 'mstpctl-portautoedge', 'mstpctl-portbpdufilter', 'mstpctl-portnetwork'

Below is the sample configuration and output

root@dell-s3000-02:~# ifquery -a
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp

auto br0
iface br0
  bridge-vlan-aware yes
  bridge-ports swp42 swp43
  mstpctl-fdelay 14
  mstpctl-txholdcount 5
  mstpctl-forcevers rstp
  mstpctl-maxhops 14
  mstpctl-treeprio 32768
  mstpctl-maxage 19
  mstpctl-hello 3
  mstpctl-ageing 200

auto swp42
iface swp42
  mstpctl-portadminedge yes
  mstpctl-portbpdufilter yes
  mstpctl-portnetwork yes
  mstpctl-portautoedge yes
  mstpctl-treeportprio 127
  mstpctl-portpathcost 10
  mstpctl-portrestrtcn yes
  mstpctl-portrestrrole yes
  mstpctl-bpduguard yes
  mstpctl-treeportcost 100
  mstpctl-portp2p yes

auto swp43
iface swp43
  mstpctl-portadminedge yes
  mstpctl-portbpdufilter yes
  mstpctl-portnetwork yes
  mstpctl-portautoedge yes
  mstpctl-treeportprio 127
  mstpctl-portpathcost 10
  mstpctl-portrestrtcn yes
  mstpctl-portrestrrole yes
  mstpctl-bpduguard yes
  mstpctl-treeportcost 100
  mstpctl-portp2p yes

root@dell-s3000-02:~# ifquery -ra
auto swp42
iface swp42
  mstpctl-portautoedge yes
  mstpctl-portbpdufilter yes
  mstpctl-portpathcost 10
  mstpctl-treeportcost 100
  mstpctl-portnetwork yes
  mstpctl-portadminedge yes
  mstpctl-portp2p yes
  mstpctl-portrestrrole yes
  mstpctl-portrestrtcn yes
  mstpctl-bpduguard yes
  link-speed 0
  link-duplex half
  link-autoneg off

auto swp43
iface swp43
  mstpctl-portautoedge yes
  mstpctl-portbpdufilter yes
  mstpctl-portpathcost 10
  mstpctl-treeportcost 100
  mstpctl-portnetwork yes
  mstpctl-portadminedge yes
  mstpctl-portp2p yes
  mstpctl-portrestrrole yes
  mstpctl-portrestrtcn yes
  mstpctl-bpduguard yes
  link-speed 0
  link-duplex half
  link-autoneg off

auto br0
iface br0
  vxlan-ageing 300
  bridge-vlan-aware yes
  bridge-mcqifaddr 0
  bridge-mcquerier 0
  bridge-mcsnoop 1
  bridge-mcrouter 1
  bridge-stp yes
  bridge-ports swp43 swp42
  mstpctl-portadminedge  swp42=yes swp43=yes
  mstpctl-fdelay 14
  mstpctl-portnetwork  swp42=yes swp43=yes
  mstpctl-txholdcount 5
  mstpctl-maxage 19
  mstpctl-portbpdufilter  swp42=yes swp43=yes
  mstpctl-maxhops 14
  mstpctl-portrestrtcn  swp42=yes swp43=yes
  mstpctl-portpathcost  swp42=10 swp43=10
  mstpctl-portautoedge  swp42=yes swp43=yes
  mstpctl-hello 3
  mstpctl-portrestrrole  swp42=yes swp43=yes
  mstpctl-bpduguard  swp42=yes swp43=yes
  mstpctl-ageing 200
  mstpctl-treeportcost  swp42=100 swp43=100
  mstpctl-portp2p  swp42=yes swp43=yes

Signed-off-by: Nikhil <nikhil@cumulusnetworks.com>
2016-07-11 09:52:26 -07:00
2014-07-22 11:15:56 -07:00
2014-07-22 11:15:56 -07:00
2016-06-16 03:37:35 +01:00

python-ifupdown2
================

This package is a replacement for the debian ifupdown package.
It is ifupdown re-written in python. It maintains the original ifupdown
pluggable architecture and extends it further.

The python-ifupdown2 package provides the infrastructure for
parsing /etc/network/interfaces file, loading, scheduling and state
management of interfaces.

It dynamically loads python modules from /usr/share/ifupdownmodules (provided
 by the python-ifupdown2-addons package). To remain compatible with other
packages that depend on ifupdown, it also executes scripts under /etc/network/.
To make the transition smoother, a python module under
/usr/share/ifupdownmodules will override a script by the same name under
/etc/network/.

It publishes an interface object which is passed to all loadble python
modules. For more details on adding a addon module, see the section on
adding python modules.


pluggable python modules:
=========================
Unlike original ifupdown, all interface configuration is moved to external
python modules. That includes inet, inet6 and dhcp configurations.

A set of default modules are provided by the python-ifupdown2-addons deb.

python-ifupdown2 expects a few things from the pluggable modules:
- the module should implement a class by the same name
- the interface object (class iface) and the operation to be performed is
  passed to the modules
- the python addon class should provide a few methods:
	- run() : method to configure the interface.
	- get_ops() : must return a list of operations it supports.
		eg: 'pre-up', 'post-down'
	- get_dependent_ifacenames() : must return a list of interfaces the
	  interface is dependent on. This is used to build the dependency list
	  for sorting and executing interfaces in dependency order.
	- if the module supports -r option to ifquery, ie ability to construct the
      ifaceobj from running state, it can optionally implement the
      get_dependent_ifacenames_running() method, to return the list of
      dependent interfaces derived from running state of the interface.
      This is different from get_dependent_ifacenames() where the dependent
      interfaces are derived from the interfaces config file (provided by the
      user).

Example: Address handling module /usr/share/ifupdownaddons/address.py


build
=====
- get source

- install build dependencies:
    apt-get install python-stdeb
    apt-get install python-docutils

- cd <python-ifupdown2 sourcedir> && ./build.sh

  (generates python-ifupdown2-<ver>.deb)

install
=======

- remove existing ifupdown package
  dpkg -r ifupdown

- install python-ifupdown2 using `dpkg -i`

- or install from deb
    dpkg -i python-ifupdown2-<ver>.deb

- note that python-ifupdown2 requires python-ifupdown2-addons package to
  function. And python-ifupdown2-addons deb has an install dependency on
  python-ifupdown2
Description
No description provided
Readme 6.2 MiB
Languages
Python 99.2%
Shell 0.6%
Makefile 0.2%