NetworkManager 0.9.10 should:
- Cooperate with changes made outside of it
- Examples of external changes
- address and route changes made with /sbin/ip or ifconfig
- (bonus) changes to parent/child relationships made via sysfs, brctl, or vconfig
- interface renames done with /sbin/ip
- These changes should be recognized and reflected in the D-Bus API
- in the IP4Config and IP6Config interfaces of NMDevice, which should be updated with new/removed addresses and routes
- The changes should be propagated to the device's active NMConnection and the connection marked 'unsaved'
- Examples of external changes
- Read and use existing ("foreign") interface configuration on start/restart without touching the interface, until an administrator tells NM to do something with the interface.
- addresses and routes assigned to the interface should be preserved and exported via D-Bus
- parent/child relationships should be preserved (eg, if interface is a slave, NM should recognize that)
- an immediate restart of NM should not change any networking configuration or settings
- if an interface was started externally using DHCP:
- if it was started by NM (easy to determine from the DHCP client's /proc/xxx/cmdline), and NM was restarted, then NM should recognize this and kill + respawn DHCP with its helper
- if it was not started by NM, NM should not touch the existing DHCP client, but simply read the addresses/routes from the interface; yes, this means NM cannot provide the DHCP4Config and DHCP6Config objects, nor does it know anything about DNS servers or search domains, but so be it.
Basically, if a device has existing configuration when NM starts, it is "read-only" until something tells NM to touch it. This doesn't mean we need a "gboolean read_only" in NMDevicePrivate, but that we should modify NetworkManager to ensure that when managing these devices, nothing gets changed at start. This probably involves bypassing most of the activation process and jumping directly from UNMANAGED to ACTIVATED, since we already have all the IP/L2 configuration required, there's no need to go through all those stages. This also ensures the device is not touched.
this does not apply to WiFi, 3G/WWAN, WiMAX, Bluetooth, ADSL, VPNs, or wired 802.1x
- we may try to make this work in the future, but this often requires modifying helpers like vpnc, openvpn, ppp, etc to report current runtime settings, otherwise there's no way to figure out what the non-address/route values (like DNS, searches, gateway, etc) were when the connection was started
- how do we determine that an externally modified device is "down"? one possibility is if all routes and addresses are removed, but this ignores Layer2-only configurations
How do we handle IPv6? NetworkManager sets accept_ra=0 and does userspace RA, while an externally changed device may have accept_ra=1 and be using kernel RA. I think the best thing to do is to leave accept_ra=1 on startup and only switch to userspace RA if NM is told to touch the device by the administrator. NM would still listen for and recognize the kernel-determined routes and addresses, but how would it get DNS servers and search domains since the kernel doesn't cache them? We removed all that netlink code to parse NDUSEROPT.