Write Using DHCP

This commit is contained in:
Reynir Björnsson 2020-11-10 12:03:14 +01:00
parent 4608755fe9
commit 15939950d9

View file

@ -4,4 +4,21 @@ author: reynir
--- ---
# Using DHCP for the unikernels # Using DHCP for the unikernels
TBD... Setting up a simple DHCP server for the bridge was fairly simple using systemd-networkd.
It's as simple as adding `DHCPServer=true` in the `.network` file for the bridge.
It is possible to configure more options under the `[DHCPServer]` section.
While DHCP *does* work, I *did* have problems using Canopy.
The unikernel would crash with an exception caused by DNS failing to resolve the hostname for the git repository.
The problem was especially evident with the default DNS resolver of anycast.censurfridns.dk as well as Google's 8.8.8.8.
With the ISPs DNS resolver it worked *most* of the time.
It seems the unikernel waits no more than *five seconds* for the hostname to resolve, or fetching the git repository.
Browsing the code, it was not immediately obvious where the five seconds is coming from or how to change it.
When it crashes it seems it took a bit longer than usual to get a lease through DHCP.
A possible contributing factor is that systemd-networkd creates with `no-carrier`.
A workaround mentioned in the corresponding [issue](https://github.com/systemd/systemd/issues/9252) suggests creating a configured dummy interface.
When there's already a running unikernel connected to the bridge it forces systemd-networkd to configure the bridge.
However, this does not seem to remove the problem entirely.
More investigation is required...