]> git.proxmox.com Git - mirror_ifupdown2.git/commit - etc/network/ifupdown2/ifupdown2.conf
ifupdownmain: squash multiple iface stanzas for the same interface
authorRoopa Prabhu <roopa@cumulusnetworks.com>
Wed, 9 Mar 2016 04:40:02 +0000 (20:40 -0800)
committerRoopa Prabhu <roopa@cumulusnetworks.com>
Wed, 9 Mar 2016 21:20:51 +0000 (13:20 -0800)
commit99ce689411b78f031ebeac19beb0f94e631c27c7
tree2f7362d576ef2bb22b056a1414127413819a8f87
parentd34bbafef9f5e4013e8892c10804cd73f41b70b7
ifupdownmain: squash multiple iface stanzas for the same interface

Ticket:
Reviewed By: CCR-4268
Testing Done: Tested squashing of interfaces with multiple iface stanzas

This is controlled by ifaceobj_squash config variable in
/etc/network/ifupdown2/ifupdown2.conf.

With ifaceobj_squash=1, ifquery and all commands will
output squashed interfaces.

$cat /etc/network/interfaces
auto swp3
iface swp3
    mtu 9000

auto swp3
iface swp3 inet static
    address 10.0.17.3/24

auto swp3
iface swp3 inet static
    address 10.0.18.3/24
    address 2000:1000:1000:1000:3::5/128

$ifquery -a
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp

auto swp3
iface swp3
        mtu 9000
        address 10.0.17.3/24
        address 10.0.18.3/24
        address 2000:1000:1000:1000:3::5/128

When and why do we need this ?
- If we preserve multiple ifaceobjects for the same iface,
it gets tricky in some cases to set default policy
values because the addon module run methods are called
on each ifaceobject.
- Each ifaceobject belonging to the same interface
is treated as a separate interface. It is difficult
to remember things accross addon module run methods
- we have a few hacks in place which we would like to
get rid of

Why not turn it on by default ?
- still debating about it. Dont want to break existing
scripts with change of output. Will get some feedback before
I switch the default to squash.
config/ifupdown2.conf
ifupdown/iface.py
ifupdown/ifupdownmain.py