I have managed to reproduce the “disappearing config” fairly easily and consistently in a VM test environment with a fresh vyos install.
My test environment is a simple kvm vm with a single virtio disk, and two virtio NICs, one connected to a dns server at 192.168.0.7
NICs are configured as follows:
Then, set up dns forwarding:
set service dns forwarding listen-on eth1
set service dns forwarding name-server 192.168.0.7
Commit and save shows pdns recursor running.
Reboot and pdns recursor will start with no issue.
Status verified with
systemctl status pdns-recursor
show configuration also results in expected output.
Now, after poweroff, set eth1’s nic connection to disconnected (simulating unplugged cable), power-on vyos test environment, and observe that
show configuration is blank in the dns forwarding section.
Also observe that running
systemctl status pdns-recursor shows that pdns-recursor is not running.
systemctl start pdns-recursor will fail just like in my production machine, with complaints about binding to an address.
If you then reconnect the virtual cable, and run
systemctl start pdns-recursor, and then check the status, you will see that it starts up no problem.
show configuration after this will not restore the “disappearing” configuration. The missing configuration will only reappear after rebooting with the cable connected…
While I have no spare bare metal hardware to test this on, I suspect we will see the same behavior by physically unplugging cables.
My theory is that the timing of interfaces coming up and assigning of IP addresses is too slow (since on my real machine I’m obviously NOT unplugging cables), and that pdns-recursor tries to start before the interface is fully up and ready.
Is there anything I can do to combat this? Is this a bug?