openSUSE/wicked — pull request #398 by okirch (2014-09-02 16:19:48+00:00)
Title: Intrinsic leases

This is a patch set to help address bnc #865573 - PPP daemon not setting DNS servers. The idea is to use "wicked lease" from the ip-up/ip-down scripts of pppd to inform wickedd about the lease to install. I haven't done anything about the pppd side of things - but the idea here is to do something like this in ip-up:

lf=/var/run/whatever/mylease.xml
netif=ppp0

wicked lease $lf new family ipv4 state granted hostname my.funky.hostname.org
wicked lease $lf add-address 192.168.7.8 netmask 255.255.255.248
wicked lease $lf add-route 0/0 gateway 192.168.7.1
wicked lease $lf set-resolver default-domain funky.hostname.org server 192.168.1.1 server 192.168.8.1
wicked lease $lf install --device $netif
rm -f $lf

Note, it's up to you whether you actually ask wickedd to take care of the
addresses, or whether your external network service does this natively.
It's just as easy to just install a lease with eg resolver information.

To revoke a lease when the link goes down:

lf=/var/run/whatever/mylease.xml
netif=ppp0

wicked lease $lf new family ipv4 state released
wicked lease $lf install --device $netif
rm -f $lf

The continued use of "--device" rather than "device" is admittedly ugly, I admit, and I'll fix it tomorrow.