Set up Cobbler after Spacewalk setup, CentOS 6.7

Note down your second adapter MAC address:
I will use 080027964AE6

Set eth adapter setting to satisfy cobbler DHCP default settings:
vi /etc/sysconfig/network-scripts/ifcfg-eth1
Some values to modify:
BOOTPROTO=none
ONBOOT=yes
Some values to add:
IPADDR=192.168.1.5
NETMASK=255.255.255.0
Check the situation at ipconfig:
ifconfig
Bring ethernet 1 up:
ifconfig eth1 up
Check the situation at ipconfig. There are two interfaces, but only eth0 has real IP address:
ifconfig
Restart all network interfaces:
/etc/init.d/network restart
Check the situation at ipconfig:
ifconfig
eth1 has real address IP too :)

The second adapter has static IP addres 192.168.1.5 which will work out out of the box with default cobbler settings.

To work with cobbler you also need install DHCP and DNS server:
yum install dhcp bind syslinux -y
If you do not work then take a look in:
vi /etc/udev/rules.d/70-persistent-net.rules
Make sure that every mac address match correct eth0 or eth1 interface.

Enable cobbler to manage DHCP server:
sed -i "s/^manage_dhcp:.*$/manage_dhcp: 1/" /etc/cobbler/settings
Enable cobbler to manage DNS server:
sed -i "s/^manage_dns:.*/manage_dns: 1/" /etc/cobbler/settings
Set servers IP adress in cobbler configuration:
ipaddress=$(ifconfig | grep "inet.*addr.*Bcast.*Mask" | sed "s/  Bcast.*$//g" | head -1 | sed "s/^.*://g")
sed -i "s/^server:.*/server: `echo $ipaddress`/" /etc/cobbler/settings
sed -i "s/^next_server:.*/next_server: `echo $ipaddress`/" /etc/cobbler/settings
Restart cobbler deamon:
service cobblerd restart
Recreate cobbler service based on new settings:
cobbler sync
At the end of output you should definitely see thet dhcpd and named is started OK:
running: /etc/rc.d/init.d/dhcpd restart
received on stdout: Starting dhcpd: [  OK  ]

received on stderr:
running: /etc/rc.d/init.d/named restart
received on stdout: Stopping named: [  OK  ]
Generating /etc/rndc.key:[  OK  ]
Starting named: [  OK  ]

received on stderr:
running shell triggers from /var/lib/cobbler/triggers/sync/post/*
running python triggers from /var/lib/cobbler/triggers/change/*
running python trigger cobbler.modules.scm_track
running shell triggers from /var/lib/cobbler/triggers/change/*
*** TASK COMPLETE ***
Take a look in DHCP settings:
cat /etc/dhcp/dhcpd.conf
The content should be exactly like this:
# ******************************************************************
# Cobbler managed dhcpd.conf file
# generated from cobbler dhcp.conf template (Sun Dec 13 16:30:00 2015)
# Do NOT make changes to /etc/dhcpd.conf. Instead, make your changes
# in /etc/cobbler/dhcp.template, as /etc/dhcpd.conf will be
# overwritten.
# ******************************************************************

ddns-update-style interim;

allow booting;
allow bootp;

ignore client-updates;
set vendorclass = option vendor-class-identifier;

subnet 192.168.1.0 netmask 255.255.255.0 {
     option routers             192.168.1.5;
     option domain-name-servers 192.168.1.1;
     option subnet-mask         255.255.255.0;
     range dynamic-bootp        192.168.1.100 192.168.1.254;
     filename                   "/pxelinux.0";
     default-lease-time         21600;
     max-lease-time             43200;
     next-server                localhost.localdomain;
}

# group for Cobbler DHCP tag: default
group {
}
Enable DHCP to boot automatically at next system boot up:
chkconfig dhcpd on

No comments: