Network config with routes before bringing eth0 up

Hello all,
I my current setup, it’s required that I set IP address 1.2.3.4 with netmask /32 while gateway is 5.6.7.8 (completely different subnet).
When booting from ISO, I can do
sudo route add 5.6.7.8 dev eth0 sudo ros config set rancher.network.interfaces.eth0.address 1.2.3.4/32 sudo ros config set rancher.network.interfaces.eth0.gateway 5.6.7.8 sudo ros config set rancher.network.interfaces.eth0.dhcp false sudo netconf
and I’d get networking.

How can I put this in a cloud-config.yml file please? Note that the route command needs to executed before bringing up/configuring networking.
runcmd, bootcmd are not allowed for rancheros, also I can’t seem to be able to add any sort of user, or set a password to rancher user, in order to setup networking manually via console screen.

Thanks!

Have you tried something like:

#cloud-config

rancher:
  network:
    interfaces:
      eth0:
        address: 1.2.3.4/32
        gateway: 5.6.7.8
        mtu: 1500
        dhcp: false
      pre_up:
        - ip route add 5.6.7.8 dev eth0

One really nice thing I use is that after making ros config set changes, you can find out what the cloud-config.yml file would look like by running ros config export.