Long title - this is what I mean:
When doing a commit, any property of an interface, that gets set with the '_set_command' in vyos/ifconfig/control.py only gets applied to the interface if it's up at the time of the commit. If the interface comes up later the property doesn't get applied to the interface.
To give an example:
set interfaces openvpn vtun10 mode client ... set interfaces openvpn vtun10 vrf MY-VRF
If the server we're trying to connect to isn't available at commit vtun10 doesn't come up and therefor it doesn't get added to MY-VRF.
Some time later, we can connect to the server and the vtun10 comes up. But it won't be part of MY-VRF.
This is a special problem with OpenVPN client interfaces on reboot. Even if the server is available, the vtun interface doesn't come up immidiatly and won't join the VRF.
This problem is not specific to OpenVPN and VRF, but applies to all properties set with the '_set_command' on all interfaces that use it.
I don't have a solution for this, since it can be solved in several ways and the core maintainers should decide how to do it.
My suggestions are to use the if-up script calls from Debian:
- Make a script file on commit, that contains all the properties for the interface and put it in if-up.d/
- Put a permanent script file if-up.d/ that makes a callback to a python file, passing the interface as a parameter. The python file could then run the '_set_command's as they are done now. Instead of running them on commit.
Personally I think 2) is better.