I’m trying to generate a “/etc/sysconfig/network-scripts/route-eth0” to add custom routes to my VM. The reason why I need to do this, is simply because we have 2 sets of FW/Routers. 1 is the public firewall, 2 is the internal firewall providing network access to private subnets.
The way I was hoping to achieve this is by adding a custom attribute named “INTERNAL_GATEWAY” (in this case 10.4.4.4) to the virtual network. And using the the START_SCRIPT in the VM template, I would populate the file like this:
# File generated by opennebula 10.0.0.0/8 via 10.4.4.4 192.168.0.0/16 via 10.4.4.4
I was trying to access the network templates values from the start script but it doesn’t seem possible as $NETWORK is empty. I also tried to create a custom var in the VM template like this
but is seems the nested variables are not supported, see the following error:
one.template.instantiate result FAILURE [one.template.instantiate] Error allocatin g a new virtual machine template. Error parsing: DISK_ID=1@^_^@INTERNAL_GATEWAY=$NETWORK[INTERNAL_GATEWAY, NETWORK_ID=$NIC[NETWORK_ID]] @^_^@NETWORK=YES... syntax error, unexpected OBRACK ET, expecting CBRACKET at line 1869902689, columns 74:75
What would be way to achieve what I am trying to do here ?
**Versions of the related components and OS (frontend, hypervisors, VMs): 5.4.13 **