0

I am trying to setup a bonded network from the %pre section of a CentOS 7 kickstart. I can prove the the following bonded network works:

network --device=mynetwork --bondslaves=eth0,eth1 --bootproto static --ip 192.168.0.1 --activate --onboot yes --noipv6 --netmask=255.255.0.0
network --hostname=testy

However, when I try to add that to /tmp/network.ks and importing, it doesn't work. I am wondering what I am doing wrong.

I add the import in the same place that the above lines were, like so: %include /tmp/network.ks

Then I have the same lines appended directly to the import:

%pre
    echo "network --device=mynetwork --bondslaves=eth0,eth1 --bootproto static --ip 192.168.0.1 --activate --onboot yes --noipv6 --netmask=255.255.0.0" >/tmp/network.ks
    echo "network --hostname=testy" >>/tmp/network.ks
%end

Are those not functional equivalents since the documentation says:

Use the %include /path/to/file command to include the contents of another file in the Kickstart file as though the contents were at the location of the %include command in the Kickstart file.

1 Answer 1

0

It turns out that when I set up the bonded network from the %pre section, I need to set --bondopts. It is unclear why this works when it is not set in the main body as opposed to the %pre section, but I am posting this in case somebody has the same problem:

%pre
    echo "network --device=mynetwork --bondslaves=eth0,eth1 --bootproto static --ip 192.168.0.1 --activate --onboot yes --noipv6 --netmask=255.255.0.0 --bondopts=mode=active-backup,primary=eth0,miimon=80,updelay=6000" >/tmp/network.ks
    echo "network --hostname=testy" >>/tmp/network.ks
%end

That will achieve the desired result.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .