2

I'm using the CentOS 7 Anaconda installer.

I want the file /etc/sysconfig/network-scripts/route-eth0 to be created, if possible, by this installer. The file route-eth0 should have the contents after installation such as:

11.22.33.44 dev eth0
default via 11.22.33.44 dev eth0

I'm doing this because my data center provider is OVH and they have the requirement that this file have this content. The IP address above is the gateway address of the KVM server on which I'm creating a VM via the CentOS installer.

Presently, I'm doing this as a post-provisioning activity. I'm hoping it can be done as part of the CentOS 7.2 installation. If not, can someone show how to do this as part of a kickstart file?

Michael Hampton
  • 237,123
  • 42
  • 477
  • 940
Steve Amerige
  • 403
  • 2
  • 5
  • 11
  • @MichaelHampton I can confirm that just using the hypervisor gateway IP address worked. It surprised me that the gateway IP address could be in a different subnet than the guest VM. I had assumed from the above-cited documentation that the route-eth0 was needed because they were in different subnets. Many thanks for dispelling my assumption! – Steve Amerige Dec 30 '15 at 17:45

1 Answers1

2

You don't need to do this. Just enter in the failover IP, netmask 32, and gateway address in the installer, and everything will work. The routes that used to go in route-eth0 are auto-generated by the kernel now.

To use it in a kickstart is the same way:

network --bootproto=static --ip=203.0.113.81 --netmask=255.255.255.255 --gateway=198.51.100.254 --nameserver=192.0.2.2 --ipv6=2001:db8:de10:4f95::51/64

Unfortunately, you can't fully configure IPv6 (yet) from the installer or kickstart; you will need to make one change after installation. Edit the /etc/sysconfig/network-scripts/ifcfg-enp2s1 file and remove the IPV6_AUTOCONF=no line which was inserted by anaconda. Once you restart networking, (ifdown enp2s1; ifup enp2s1) IPv6 will then be functional using the route advertised by OVH's on-link router(s).

Michael Hampton
  • 237,123
  • 42
  • 477
  • 940