kickstart/brctl

Issues related to configuring your network
s0ke
Posts: 11
Joined: 2015/02/13 18:55:50

kickstart/brctl

Post by s0ke » 2015/03/30 18:54:57

How would I do a brctl addif br0 eth1 with kickstart? I tried just the command itself in my kickstart file but once the box is up. brctl show does not show the interface.

Thanks

User avatar
jlehtone
Posts: 4530
Joined: 2007/12/11 08:17:33
Location: Finland

Re: kickstart/brctl

Post by jlehtone » 2015/03/30 22:50:47

s0ke wrote:... but once the box is up.
You mean when the just-installed system boots?

You have to store the configuration into file(s).
The kickstart file has option "network", but apparently attribute 'bridge' is known by el7 installer but not yet in el6.
Plan B is obviously to do the deed in %post
https://access.redhat.com/documentation ... onfig.html

s0ke
Posts: 11
Joined: 2015/02/13 18:55:50

Re: kickstart/brctl

Post by s0ke » 2015/03/31 20:50:18

Thank you. Yes I ended up just using sed to put the commands into the rc.local during %post.

Thanks

gerald_clark
Posts: 10642
Joined: 2005/08/05 15:19:54
Location: Northern Illinois, USA

Re: kickstart/brctl

Post by gerald_clark » 2015/03/31 23:15:42

You should be creating the proper ifcfg files in /etc/sysconfig/network-scripts instead.

s0ke
Posts: 11
Joined: 2015/02/13 18:55:50

Re: kickstart/brctl

Post by s0ke » 2015/04/02 18:49:35

Yes I am doing that.

cat << BRIDGE >>/etc/sysconfig/network-scripts/ifcfg-br0
DEVICE=br0
TYPE=Bridge
BOOTPROTO=none
ONBOOT=yes
IPADDR=172.16.204.1
NETMASK=255.255.255.0
NM_CONTROLLED=no
DELAY=0
BRIDGE

cat << ETH1 >>/etc/sysconfig/network-scripts/ifcfg-eth1
Bridge=br0
ETH1

...etc for my eth2,eth3,eth4 interfaces. But after the install the bridge isn't actually up according to brctl.

gerald_clark
Posts: 10642
Joined: 2005/08/05 15:19:54
Location: Northern Illinois, USA

Re: kickstart/brctl

Post by gerald_clark » 2015/04/02 19:19:12

What is that 'BRIDGE' line ifcfg-br0 ?

Your ifcfg-eth1 needs
DEVICE=eth1
ONBOOT=YES

WHAT is that "ETH1" line?

s0ke
Posts: 11
Joined: 2015/02/13 18:55:50

Re: kickstart/brctl

Post by s0ke » 2015/04/02 19:33:36

It ends the operator:

Ex:
hostname:~> cat << TEST >> /tmp/test.txt
> Blue
> Red
> Green
> TEST

hostname:~> cat test.txt
Blue
Red
Green


The devices are set in my %pre config
network --onboot yes --device eth1 --bootproto static
network --onboot yes --device eth2 --bootproto static
network --onboot yes --device eth3 --bootproto static
network --onboot yes --device eth4 --bootproto static

Could that be the issue?

User avatar
jlehtone
Posts: 4530
Joined: 2007/12/11 08:17:33
Location: Finland

Re: kickstart/brctl

Post by jlehtone » 2015/04/03 14:34:44

gerald_clark wrote:What is that 'BRIDGE' line ifcfg-br0 ?
Bash "here document" EOF. s0ke did show what code the kickstart %post contains.

@s0ke:
Please show the ifcfg-{eth1,br0} as they are after the installation.
Do you have interface br0 at all after install?

BRIDGE=br0 or Bridge=br0?

The br0 is logically BOOTPROTO=static and the eth? are 'none'.

s0ke
Posts: 11
Joined: 2015/02/13 18:55:50

Re: kickstart/brctl

Post by s0ke » 2015/04/03 16:57:30

It does create the .cfg files after the install.

#ifcfg-br0
DEVICE=br0
TYPE=Bridge
BOOTPROTO=none
ONBOOT=yes
IPADDR=172.16.204.1
NETMASK=255.255.255.0
NM_CONTROLLED=no
DELAY=0

#ifcfg-eth1
DEVICE="eth1"
BOOTPROTO="none"
HWADDR="00:00:24:D1:3E:15"
IPV6INIT="yes"
NM_CONTROLLED="no"
ONBOOT="yes"
TYPE="Ethernet"
Bridge=br0

#ifcfg-eth2
DEVICE="eth2"
BOOTPROTO="none"
HWADDR="00:00:24:D1:3E:16"
IPV6INIT="yes"
NM_CONTROLLED="no"
ONBOOT="yes"
TYPE="Ethernet"
Bridge=br0

...etc for eth3, eth4.

Code: Select all

# brctl show                                    
bridge name     bridge id               STP enabled     interfaces              
br0             8000.000024d13e15       no


If I add:
brctl addif br0 eth1
brctl addif br0 eth2
brctl addif br0 eth3
brctl addif br0 eth4

To the rc.local in my ks file. Then it works:

Code: Select all

# brctl show                                    
bridge name     bridge id               STP enabled   interfaces              
br0             8000.000024d13e15        no                 eth1                    
                                                            eth2
                                                            eth3
                                                            eth4
                                                                 
I do see that BOOTPROTO for br0 is set to none instead of static.

gerald_clark
Posts: 10642
Joined: 2005/08/05 15:19:54
Location: Northern Illinois, USA

Re: kickstart/brctl

Post by gerald_clark » 2015/04/03 17:09:50

#ifcfg-eth1
DEVICE="eth1"
BOOTPROTO="none"
HWADDR="00:00:24:D1:3E:15"
IPV6INIT="yes"
NM_CONTROLLED="no"
ONBOOT="yes"
TYPE="Ethernet"
Bridge=br0

should be:

DEVICE=eth1
ONBOOT=yes
BRIDGE=br0

as I stated earlier

Post Reply