]> git.proxmox.com Git - mirror_ifupdown2.git/blob - ifupdown2/README.rst
Merge 'vlan filtering bridge + vxlan + mlag + vrr' support from internal
[mirror_ifupdown2.git] / ifupdown2 / README.rst
1 python-ifupdown2
2 ================
3
4 This package is a replacement for the debian ifupdown package.
5 It is ifupdown re-written in python. It maintains the original ifupdown
6 pluggable architecture and extends it further.
7
8 The python-ifupdown2 package provides the infrastructure for
9 parsing /etc/network/interfaces file, loading, scheduling and state
10 management of interfaces.
11
12 It dynamically loads python modules from /usr/share/ifupdownaddons.
13 To remain compatible with other packages that depend on ifupdown,
14 it also executes scripts under /etc/network/.
15 To make the transition smoother, a python module under
16 /usr/share/ifupdownaddons will override a script by the same name under
17 /etc/network/.
18
19 It publishes an interface object which is passed to all loadble python
20 modules. For more details on adding a addon module, see the section on
21 adding python modules.
22
23
24 pluggable python modules:
25 =========================
26 Unlike original ifupdown, all interface configuration is moved to external
27 python modules. That includes inet, inet6 and dhcp configurations.
28
29 A set of default modules are included in the package.
30
31 python-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
50 Example: Address handling module /usr/share/ifupdownaddons/address.py
51
52
53 build
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
65 install
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