One of the features provided by Satellite 6 is both provisioning of hosts (via
PXE or other methods), and automated network configuration. We can use Satellite
to automatically configure our bonds and vlan tagging for us.
Let's review how this all is done using the Satellite web UI. My suggestion is
to configure these details one by one, and examine how the generated kickstart
changes in each step. This will help us identifies issues and mistakes before
starting a lenghty trial and error process provisioning physical servers :-)
The kickstart rendered template is available under https://SATELLITE/unattended/provision?hostname=your.host.name .
VLAN tagging
This is the simplest scenario; we just want to configure vlan tagging in an
existing interface.
Imagine we want to configure the following interfaces:
eth0: PXE (no specific configuration mentioned here)
eth1: Base NIC for vlan tagging
eth1.666 : 192.168.0.10/24 , using vlan 666.
We need to ensure that:
- We have configured a domain.
- We have configured a subnet, and is attached to that domain.
- The network is configured to use Static boot mode (this is a personal
preference of mine -- I'd prefer all my interfaces to become up regardless
the availabity of a DHCP capsule).
Once we perform that, we can perform a server discovery and start editing the
network interfaces with the relevant info.
So we'd configure the following interfaces in Satellite :
-
eth0:
- Mac address:
<autodiscovered>
- Device identifier:
eth0
- DNS name:
<none>
- Domain: your.domain
- Subnet: your-subnet-with-Static-bootproto
- IP Address:
<blank>
- Managed:
true
-
eth0.666:
- Mac address:
<blank>
- Device identifier:
eth0.666
- DNS name:
<none>
- Domain: your.domain
- Subnet: your-subnet-with-Static-bootproto
- IP Address:
192.168.0.10
- Managed:
true
- Virtual:
true
- Attached device:
eth0
- Tag: 666
It's important that you configure the eth0
interface itself; otherwise when
eth0.666
is enabled, it'll fail because the parent device isn't ready.
All in all, your generated configuration should look like :
####### parent device #######
# eth0 interface
real=`ip -o link | grep 00:50:56:04:1a:8a | awk '{print $2;}' | sed s/:$//`
# ifcfg files are ignored by NM if their name contains colons so we convert colons to underscore
sanitized_real=$real
cat << EOF > /etc/sysconfig/network-scripts/ifcfg-$sanitized_real
BOOTPROTO="none"
IPADDR=""
NETMASK="255.255.255.0"
GATEWAY="172.16.16.1"
DEVICE=$real
HWADDR="00:50:56:04:1a:8a"
ONBOOT=yes
PEERDNS=no
PEERROUTES=no
EOF
###### vlan tagging #######
# eth0.666 interface
real=`ip -o link | grep 00:50:56:04:1a:8a | awk '{print $2;}' | sed s/:$//`
real=`echo eth0.666 | sed s/eth0/$real/`
# ifcfg files are ignored by NM if their name contains colons so we convert colons to underscore
sanitized_real=$real
cat << EOF > /etc/sysconfig/network-scripts/ifcfg-$sanitized_real
BOOTPROTO="none"
IPADDR="192.168.0.10"
NETMASK="255.255.255.0"
GATEWAY="192.168.0.1"
DEVICE=$real
ONBOOT=yes
PEERDNS=no
PEERROUTES=no
VLAN=yes
EOF
Bonding
In the same way as before, we need to configure the underlying interfaces before
we configure the bonded one.
eth0: PXE (no specific configuration mentioned here)
eth1: Bond slave
eth2: Bond slave
bond0: Active-Passive bond enslaving eth1 and eth2
For this example we'll be configuring eth1
and eth2
as a slaves of bond0
,
that will have an IP assigned to it. It is very important you configure both
bond slaves first, then the bond interface. Otherwise the bond won't be properly
linked to the slaves and the template won't properly generate the kickstart.
-
eth1:
- Mac address:
<autodiscovered>
- Device identifier:
eth1
- DNS name:
<none>
- Domain: your.domain
- Subnet: your-subnet-with-Static-bootproto
- IP Address:
<blank>
- Managed:
true
-
eth2:
- Mac address:
<autodiscovered>
- Device identifier:
eth2
- DNS name:
<none>
- Domain: your.domain
- Subnet: your-subnet-with-Static-bootproto
- IP Address:
<blank>
- Managed:
true
-
bond0:
- Type: bond0
- Mac address:
<none>
- Device identifier:
bond0
- DNS name:
<none>
- Domain: your.domain
- Subnet: your-subnet-with-Static-bootproto
- IP Address:
192.168.0.11
- Managed:
true
- Bond configuration:
- Mode:
Active-Backup
- Attached devices:
eth0,eth1
- Bond options:
""
The generated config looks like :
# bond0 interface
real="bond0"
cat << EOF > /etc/sysconfig/network-scripts/ifcfg-$real
BOOTPROTO="none"
IPADDR="172.16.16.230"
NETMASK="255.255.255.0"
GATEWAY="172.16.16.1"
DEVICE=$real
ONBOOT=yes
PEERDNS=no
PEERROUTES=no
DEFROUTE="no"
TYPE=Bond
BONDING_OPTS=" mode=active-backup"
BONDING_MASTER=yes
NM_CONTROLLED=no
EOF
# eth1 interface
real=`ip -o link | grep 00:50:56:04:1a:8f | awk '{print $2;}' | sed s/:$//`
# ifcfg files are ignored by NM if their name contains colons so we convert colons to underscore
sanitized_real=$real
cat << EOF > /etc/sysconfig/network-scripts/ifcfg-$sanitized_real
BOOTPROTO="none"
DEVICE=$real
HWADDR="00:50:56:04:1a:8f"
ONBOOT=yes
PEERDNS=no
PEERROUTES=no
NM_CONTROLLED=no
MASTER=bond0
SLAVE=yes
EOF
# eth2 interface
real=`ip -o link | grep 00:50:56:04:1a:90 | awk '{print $2;}' | sed s/:$//`
# ifcfg files are ignored by NM if their name contains colons so we convert colons to underscore
sanitized_real=$real
cat << EOF > /etc/sysconfig/network-scripts/ifcfg-$sanitized_real
BOOTPROTO="none"
DEVICE=$real
HWADDR="00:50:56:04:1a:90"
ONBOOT=yes
PEERDNS=no
PEERROUTES=no
NM_CONTROLLED=no
MASTER=bond0
SLAVE=yes
EOF
Bonding + VLAN tagging
In this final example we want to configure a bond and add different vlan-tagged
interfaces to it :
eth0: PXE (no specific configuration mentioned here)
eth1: Bond slave
eth2: Bond slave
bond0: Active-Passive bond enslaving eth1 and eth2
bond0.666: Interface in vlan 666 (192.168.6.6/24)
bond0.777: Interface in vlan 777 (192.168.7.7/24)
-
eth1:
- Mac address:
<autodiscovered>
- Device identifier:
eth1
- DNS name:
<none>
- Domain: your.domain
- Subnet: your-subnet-with-Static-bootproto
- IP Address:
<blank>
- Managed:
true
-
eth2:
- Mac address:
<autodiscovered>
- Device identifier:
eth2
- DNS name:
<none>
- Domain: your.domain
- Subnet: your-subnet-with-Static-bootproto
- IP Address:
<blank>
- Managed:
true
-
bond0:
- Type: Bond
- Mac address:
<none>
- Device identifier:
bond0
- DNS name:
<none>
- Domain: your.domain
- Subnet: your-subnet-with-Static-bootproto
- IP Address:
192.168.0.11
- Managed:
true
- Bond configuration:
- Mode:
Active-Backup
- Attached devices:
eth0,eth1
- Bond options:
""
-
bond0.666:
- Type: interface
- Mac address:
<blank>
- Device identifier:
bond0.666
- DNS name:
<none>
- Domain: your.domain
- Subnet: your-subnet-with-Static-bootproto
- IP Address:
192.168.6.6
- Managed:
true
- Virtual:
true
- Attached device:
eth0
- Tag: 666
-
bond0.777:
- Type: interface
- Mac address:
<blank>
- Device identifier:
bond0.777
- DNS name:
<none>
- Domain: your.domain
- Subnet: your-subnet-with-Static-bootproto
- IP Address:
192.168.7.7
- Managed:
true
- Virtual:
true
- Attached device:
eth0
- Tag: 777
Happy hacking!