]> git.proxmox.com Git - mirror_ifupdown2.git/blame - ifupdown2/README.rst
Fix ifquery check for mstpctl-ports
[mirror_ifupdown2.git] / ifupdown2 / README.rst
CommitLineData
2c8c4ce7
RP
1python-ifupdown2
2================
3
4This package is a replacement for the debian ifupdown package.
5It is ifupdown re-written in python. It maintains the original ifupdown
6pluggable architecture and extends it further.
7
8The python-ifupdown2 package provides the infrastructure for
9parsing /etc/network/interfaces file, loading, scheduling and state
10management of interfaces.
11
12It dynamically loads python modules from /usr/share/ifupdownmodules (provided
13 by the python-ifupdown2-addons package). To remain compatible with other
14packages that depend on ifupdown, it also executes scripts under /etc/network/.
15To make the transition smoother, a python module under
16/usr/share/ifupdownmodules will override a script by the same name under
17/etc/network/.
18
19It publishes an interface object which is passed to all loadble python
20modules. For more details on adding a addon module, see the section on
21adding python modules.
22
23
24pluggable python modules:
25=========================
26Unlike original ifupdown, all interface configuration is moved to external
27python modules. That includes inet, inet6 and dhcp configurations.
28
29A set of default modules are provided by the python-ifupdown2-addons deb.
30
31python-ifupdown2 expects a few things from the pluggable modules:
32- the module should implement a class by the same name
33- the interface object (class iface) and the operation to be performed is
34 passed to the modules
35- the python addon class should provide a few methods:
36 - run() : method to configure the interface.
37 - get_ops() : must return a list of operations it supports.
38 eg: 'pre-up', 'post-down'
39 - get_dependent_ifacenames() : must return a list of interfaces the
40 interface is dependent on. This is used to build the dependency list
41 for sorting and executing interfaces in dependency order.
42 - if the module supports -r option to ifquery, ie ability to construct the
43 ifaceobj from running state, it can optionally implement the
44 get_dependent_ifacenames_running() method, to return the list of
45 dependent interfaces derived from running state of the interface.
46 This is different from get_dependent_ifacenames() where the dependent
47 interfaces are derived from the interfaces config file (provided by the
48 user).
49
50Example: Address handling module /usr/share/ifupdownaddons/address.py
51
52
53build
54=====
55- get source
56
57- install build dependencies:
58 apt-get install python-stdeb
59 apt-get install python-docutils
60
61- cd <python-ifupdown2 sourcedir> && ./build.sh
62
63 (generates python-ifupdown2-<ver>.deb)
64
65install
66=======
67
68- remove existing ifupdown package
69 dpkg -r ifupdown
70
71- install python-ifupdown2 using `dpkg -i`
72
73- or install from deb
74 dpkg -i python-ifupdown2-<ver>.deb
75
76- note that python-ifupdown2 requires python-ifupdown2-addons package to
77 function. And python-ifupdown2-addons deb has an install dependency on
78 python-ifupdown2