How to add static routes via cloud-init to atomic host
Issue
-
How to install static routes via
cloud-init
to a newly installed atomic host ? -
We currently have this in the
meta-data
:
instance-id: atomic_01
local-hostname: hostname
network-interfaces: |
auto eth0
iface eth0 inet static
address 10.10.10.10
netmask 255.255.255.192
gateway 10.10.10.1
auto eth1
iface eth1 inet static
address 10.10.10.11
network 10.10.10.0
netmask 255.255.255.0
broadcast 10.10.10.255
dns-nameservers 10.10.10.2 10.10.10.3
dns-search localdomain
bootcmd:
- ifdown eth0
- ifup eth0
- ifdown eth1
- ifup eth1
which configures the interfaces correctly but we can't manage to setup static routes correctly using cloud-init
.
Environment
- Red Hat Enterprise Linux Atomic Host 7.5 (RHELAH)
- Red Hat Enterprise Linux 7.5 (RHEL)
- Red Hat Enterprise OpenStack Platform 13.0 (RHOSP)
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.