Please check the status of this specification in Launchpad before editing it. If it is Approved, contact the Assignee or another knowledgeable person before making changes.
Launchpad Entry: modular-etc-network-interfaces
Packages affected: ifupdown, gnome-system-tools-backends, and whatever kubuntu uses
We want to split out /etc/network/interfaces into one file per (logical) interface.
/etc/network/interfaces has been split up and put into /etc/network/interfaces.d with one file per interface. This prevents a single incorrectly configured interface from breaking the entire network configuration, and also makes handling network configuration easier for configuration systems such as eBox, and GNOME's network admin tool.
We do this to obtain two things: To contain accidentally wrongfully configured interfaces from affecting other interfaces. To make life easier for anyone who wants to programmatically read or alter the network configuration on Ubuntu.
- Ante manages some servers remotely. He changes the network configuration of one of the interfaces, makes a typo and reboots the server. He cannot get in contact with the server, and cannot access the any of the other interfaces on ther server either.
- Soren wants to edit his network configuration with a clever script, but he can't because he only knows grep and sed.
- Soren wants to quickly extract the ip's for configuration of all the networks named eth* on his machine. He gives up trying to hack something together to parse /etc/network/interfaces.
Instead of a stanza /etc/network/interfaces such as:
iface eth0 inet dhcp
...we'll have a file called /etc/network/interfaces.d/eth0
family inet method dhcp
auto eth4 iface eth4 inet static address 192.168.1.77 netmask 255.255.255.0 broadcast 192.168.1.255 network 192.168.1.0 gateway 192.168.1.1
family inet method static address 192.168.1.77 netmask 255.255.255.0 broadcast 192.168.1.255 network 192.168.1.0 gateway 192.168.1.1 auto
auto ath0=homewifi iface homewifi inet dhcp wireless-key s:VerySecret123 wireless-essid FooBarNet
probably becomes two files. First /etc/network/interfaces.d/homewifi:
family inet method dhcp wireless-key s:VerySecret123 wireless-essid FooBarNet
the rest, I'm not sure about right now.
Maybe a separate file that would contain automatically configured interfaces. It could look like
lo eth0 ath0=homewifi
or something like that.
ifupdown is well known and well tested, so the implementation will likely be based on that.
Keywords, plugins (like wireless-tools and such) and most everything else is just fine as it is, so the changes are limited to making it not bother parsing anything it will not need, so if asked to "ifup ath0=homewifi" it will only have to open /etc/network/interfaces.d/homewifi, and apply the settings found to ath0. There will also be slight changes to the parser to take care of the new method and family configration.
The current /etc/network/interfaces will be parsed and put into the new scheme. A big notice will be put in place telling the user that his config is now in the new directory structure.
It's important that we are able to test new features, and demonstrate them to users. Use this section to describe a short plan that anybody can follow that demonstrates the feature is working. This can then be used during CD testing, and to show off after release.
This need not be added or completed until the specification is nearing beta.
Changes in the tools using this file will need to be implemented, but in all fairness, this new syntax should make this much simpler.