• David Johnson's avatar
    Add a candidate systemd-networkd control net path for Ubuntu 18. · bbf4824b
    David Johnson authored
    Drop 99-emulab-networkd.rules into /etc/udev/rules.d,
    emulab-networkd@.service into /lib/systemd/system, and do
    `systemctl enable systemd-networkd.service`.  I would also do
    `ln -sf /run/systemd/resolve/resolv.conf /etc/resolv.conf`; we don't
    want any part of systemd-resolved.
    
    This is the only way I could come up with to make systemd-networkd
    listen on all wired ethernet ifaces, and get it into the right state.
    systemd-networkd is like NetworkManager in some ways.  I don't know if
    it's better or worse.  The main problem for us is that it doesn't
    support hooks, and that it runs its own dhcp client (which is crappy and
    inflexible compared to dhclient).  We don't need anything super flexible
    though since we don't use custom options, and it has an option to ignore
    the lease lifetime and leave the iface up even if expiry happens before
    renewal can take place.
    
    Anyway, here's the flow: udev rules tell systemd to require a unit
    (emulab-networkd@$iface.service) for each physical wired ethernet
    device.  These files write runtime .network files into
    /run/systemd/network, which are read by systemd-networkd.service if it
    is enabled.  We just tell systemd-networkd to listen on them all, then
    we use its waiter script.  However, its wait script is broken and/or the
    documentation is contradictory, so we don't trust it to tell us which
    interface comes up; we invoke its networkctl client to tell us.  We then
    write the up iface to /run/emulab/cnet, rm -f the .network files for all
    ifaces other than the control net device (cause we don't want
    systemd-networkd to manage expt network devices), and restart
    systemd-networkd so it can appropriately report that it is "managing"
    the control net device, but not the expt devices.  It is very
    unfortunate that we have to restart systemd-networkd, but there is no
    other way to tell it about new configuration.  If you HUP it, it dies.
    These systemd folks must live in a box where all use cases look alike.
    
    Note that if the user overrides with their own .network scripts in
    /etc/systemd/network that Match any of the physical NICs, those take
    precedence over our per-interface scripts, which is what we want.
    
    Note also that to do something like move the real control net into a
    bridge, you can just remove or update the .network file in
    /run/systemd/network, and restart systemd-networkd.  It should re-dhcp
    on the bridge.  It does not remove NIC configuration at exit; it just
    "catches up" with any NIC address when it is restarted.
    
    I have not done all the dhclient-exit-hook normal goo (i.e. writing the
    control net controlif/IP into the right place, etc), but that should all
    be possible.
    
    Finally: I haven't yet decided that this is the path for Ubuntu 18.  We
    might well ignore this and fall back to the old /etc/network/interfaces
    ifupdown strategy.  At least there it is possible to use a real
    dhclient.
    bbf4824b
Name
Last commit
Last update
account Loading commit data...
apache Loading commit data...
apt Loading commit data...
assign Loading commit data...
autoconf Loading commit data...
autofs Loading commit data...
backend Loading commit data...
bugdb Loading commit data...
cdrom Loading commit data...
clientside Loading commit data...
collab Loading commit data...
daikon Loading commit data...
db Loading commit data...
delay Loading commit data...
dhcpd Loading commit data...
discvr Loading commit data...
doc Loading commit data...
event Loading commit data...
firewall Loading commit data...
flash Loading commit data...
fwrules Loading commit data...
hw_config Loading commit data...
hyperviewer Loading commit data...
image-test Loading commit data...
install Loading commit data...
ipod Loading commit data...
mobile Loading commit data...
mote Loading commit data...
named Loading commit data...
node_usage Loading commit data...
ntpd Loading commit data...
os Loading commit data...
patches Loading commit data...
pelab Loading commit data...
protogeni Loading commit data...
pxe Loading commit data...
rc.d Loading commit data...
robots Loading commit data...
rpms Loading commit data...
security Loading commit data...
sensors Loading commit data...
sql Loading commit data...
ssl Loading commit data...
sysadmin Loading commit data...
tbsetup Loading commit data...
testsuite Loading commit data...
tip Loading commit data...
tmcd Loading commit data...
tools Loading commit data...
utils Loading commit data...
vis Loading commit data...
wiki Loading commit data...
www Loading commit data...
xmlrpc Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
.gitmodules Loading commit data...
.loc-ignore Loading commit data...
AGPL-COPYING Loading commit data...
GNUmakefile.in Loading commit data...
GNUmakerules Loading commit data...
GPL-COPYING Loading commit data...
LGPL-COPYING Loading commit data...
MOVED-TO-WIKI Loading commit data...
Makeconf.in Loading commit data...
README Loading commit data...
TODO Loading commit data...
TODO.plab Loading commit data...
VERSION Loading commit data...
WEBtemplate.in Loading commit data...
config.h.in Loading commit data...
configure Loading commit data...
configure.ac Loading commit data...
defs-apt Loading commit data...
defs-cloudlab-clemson Loading commit data...
defs-cloudlab-utah Loading commit data...
defs-cloudlab-wisc Loading commit data...
defs-default Loading commit data...
defs-duerig-emulab Loading commit data...
defs-elabinelab Loading commit data...
defs-example Loading commit data...
defs-gtw-apt Loading commit data...
defs-gtw-emulab Loading commit data...
defs-johnsond-emulab Loading commit data...
defs-kwebb-apt Loading commit data...
defs-kwebb-cloudlab Loading commit data...
defs-kwebb-emulab Loading commit data...
defs-mike-emulab Loading commit data...
defs-onelab Loading commit data...
defs-ricci-emulab Loading commit data...
defs-stoller-apt Loading commit data...
defs-stoller-emulab Loading commit data...
defs-stoller-home Loading commit data...
defs-stoller-lbsdb Loading commit data...
defs-uky Loading commit data...
defs-utahclient Loading commit data...
defs-wbsun-emulab Loading commit data...
defs-wide Loading commit data...
pnet-favicon.ico Loading commit data...