<div dir="ltr"><div><div><div><div><div><div>Hello<br></div><div><br>I'm trying to configure systemd networking for a bridge, using v217-stable from <a href="http://anongit.freedesktop.org/systemd/systemd-stable" target="_blank">anongit.freedesktop.org/systemd/systemd-stable</a><br><br></div><div>I mostly have 3 problems:<br></div><div><br>1- 3 - I do not understand how to properly use systemd-networkd-wait-online<br><br></div><div>I have one service (establishing the uplink) with:<br></div><div>After=network-online.target<br><br></div><div>Yet it its status I  see it failed because it could not resolve the remote host. <br><br></div><div>The services are properly enabled:<br></div><div><br>$ find . |grep network<br>./multi-user.target.wants/systemd-networkd.service<br>./systemd-networkd-wait-online.service<br>./network-online.target.wants<br>./network-online.target.wants/systemd-networkd-wait-online.service<br><br>So I tried to check systemd-networkd-wait-online :<br></div><div><br>$ systemctl status systemd-networkd-wait-online<br>● systemd-networkd-wait-online.service - Wait for Network to be Configured<br>   Loaded: loaded (/etc/systemd/system/systemd-networkd-wait-online.service; enabled)<br>   Active: inactive (dead)<br>     Docs: man:systemd-networkd-wait-online.service(8)<br><br></div><div>If I try to start it manually, it hangs, even if I specify --interface=wlan0 in its service.<br><br>I think the reason might be br0, that is seen as "not ready" because of the uplink issue:<br><br></div><div>$ networkctl status 3<br>● 3: br0<br>   Link File: n/a<br>Network File: /etc/systemd/network/bridge.network<br>        Type: ether<br>       State: no-carrier (configuring)<br></div><div>(...)<br><br></div><div>If I manually start the uplink, networkctl is happy (State: routable (configured) and systemd-networkd-wait-online works. So it's a catch 21: uplink can't start because systemd-networkd-wait-online does not indicate success because uplink can't start.<br><br></div><div>Is there an option I could use on bridge.network to indicate it shouldn't be considered by systemd-network-wait-online (a bit like it ignores the loopback interfaces)?<br></div><div><br></div><div>2- Updating the bridge configuration without requesting too many DHCP addresses.<br></div><div><br></div>The bridge is properly brought up by systemd-networkd, but I do not see how to take it down or how to change some options when say the .netdev file has changed (ex: changed the mac address, new dhcp option, etc).<br><br>At the moment, I work around the problem with systemctl stop 
systemd-networkd && systemctl start systemd-network but this cause some dhcp weirdness on the other network interfaces using DHCP, with a new IP being configured every time.<br><br></div><div>For exemple, after a few tries I currently have:<br></div><div><br></div></div>$ networkctl status<br>       State: routable<br>     Address: 192.168.2.44<br>              192.168.2.43<br>              192.168.2.42<br>              192.168.2.41<br>              192.168.2.40<br>              192.168.2.39<br>              192.168.2.38<br>(...)<br><br></div><div>I'm not sure why it's  hogging  the DHCP addresses since the corresponding .network file is quite simple:<br></div><div><br>$ cat wireless.network <br>[Match]<br>Name=w*<br>Virtualization=no<br><br>[Network]<br>DHCP=both<br><br>[DHCP]<br>UseHostname=false<br><br>Does networkctl supports turning interfaces up/down and restarting them? Is it a planned feature?<br><br></div>If not, I would suggest adding a least a restart feature,  so that the interface can be reconfigured in isolation without affecting the DHCP IPs of the other interfaces. For bridges, this restart feature could do the ifconfig down and brctl delbr.<br><br>It might be good to do the same when systemd-network is restarted, so that the new options (ex: cloned mac addres) are applied.<br></div><div><br></div>3- Acquiring DHCP leases *AND* serving DHCP on br0<br><br></div><div>br0 is configured as:<br>$ cat bridge.network <br>[Match]<br>Name=br0<br><br>[Network]<br>DHCP=both<br>Address=<a href="http://192.168.3.224/28" target="_blank">192.168.3.224/28</a><br>DHCPServer=yes<br><br>[DHCP]<br>UseHostname=false<br>UseDNS=false<br>RequestBroadcast=yes<br><br></div><div>ap0 is a local access point, bridged to an uplink on br0<br></div><div><br></div><div>The idea is to have 192.168.3.224 configured and serve DHCP address in the /28 (16 addresses) during the uplink confirmation. When the uplink is up, it  will provide better addresses and configuration to the clients. With the configuration above, the DHCP address offered by the uplink is properly seen by networkctl, and configured. It respond to pings. <br><br>The DHCP range is properly used to give IP addresses like 192.168.3.225 to clients.<br><br></div><div>I tested with a OSX Yosemite client : when the uplink is established, the clients get the new lease, yet they still seem to try and use the old one, as I can see packets trying to use the local link instead of the uplink :<br>ip6tables forward denied: IN=br0 OUT=wlan0 PHYSIN=ap0 MAC=xxxxx  SRC=192.168.3.225 DST=local-endpoint<br><br></div><div>With another OSX Yosemite, only the original lease is acquired (weird)<br></div><div><br></div><div>Would it be possible  to make the DHCPServer release the ip and stop as soon as the uplink is up? (which relates to the previous question of being able to apply changes to a single interface without affecting the others)<br><br></div><div><br></div><div>Thanks<br>Charles<br></div></div>