Linux系统为CentOS6.2, 该配置没有包含DNS支持.

1. Add EPEL yum repository:


2. Install required packages

yum install redhat-rpm-config dhcp tftp-server httpd cobbler cobbler-web pykickstart

3. Stop firewall or add ports to iptables configuration:

service iptables stop


-A INPUT -p icmp --icmp-type any -j ACCEPT

-A INPUT -i lo -j ACCEPT

-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
-A INPUT -m state --state NEW -m udp -p udp --dport 53 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 53 -j ACCEPT
-A INPUT -m state --state NEW -m udp -p udp --dport 68 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 69 -j ACCEPT
-A INPUT -m state --state NEW -m udp -p udp --dport 69 -j ACCEPT
-A INPUT -m state --state NEW -m udp -p udp --dport 123 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 443 -j ACCEPT
# Syslog for cobbler
-A INPUT -m state --state NEW -m udp -p udp --dport 25150 -j ACCEPT
# Koan XMLRPC ports
-A INPUT -m state --state NEW -m tcp -p tcp --dport 25151 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 25152 -j ACCEPT

-A INPUT -j REJECT --reject-with icmp-host-prohibited


4. Disable SELinux or

setsebool -P httpd_can_network_connect true

5. Run cobbler check and fixed the configrations:

cobbler check

The output looks like this:

The following are potential configuration items that you may want to fix:

1 : The 'server' field in /etc/cobbler/settings must be set to something other than localhost, or kickstarting features will not work.  This should be a resolvable hostname or IP for the boot server as reachable by all machines that will use it.
2 : For PXE to be functional, the 'next_server' field in /etc/cobbler/settings must be set to something other than, and should match the IP of the boot server on the PXE network.
3 : some network boot-loaders are missing from /var/lib/cobbler/loaders, you may run 'cobbler get-loaders' to download them, or, if you only want to handle x86/x86_64 netbooting, you may ensure that you have installed a *recent* version of the syslinux package installed and can ignore this message entirely.  Files in this directory, should you want to support all architectures, should include pxelinux.0, menu.c32, elilo.efi, and yaboot. The 'cobbler get-loaders' command is the easiest way to resolve these requirements.
4 : change 'disable' to 'no' in /etc/xinetd.d/rsync
5 : debmirror package is not installed, it will be required to manage debian deployments and repositories
6 : ksvalidator was not found, install pykickstart
7 : The default password used by the sample templates for newly installed machines (default_password_crypted in /etc/cobbler/settings) is still set to 'cobbler' and should be changed, try: "openssl passwd -1 -salt 'random-phrase-here' 'your-password-here'" to generate new one
8 : fencing tools were not found, and are required to use the (optional) power management features. install cman or fence-agents to use them

Restart cobblerd and then run 'cobbler sync' to apply changes.

6. Change default root password

Generate password:

openssl passwd -1

Edit /etc/cobbler/settings and change the value of default_password_crypted to the generated password.

7. Change the server and next_server to you server IP(e.g. in /etc/cobbler/settting

8. Configure /etc/cobbler/dhcp.template

Sample snippet:

ddns-update-style interim;

allow booting;
allow bootp;

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

subnet netmask {
     option routers   ;
     option domain-name-servers,;
     option subnet-mask;
     range dynamic-bootp;
     filename                   "/pxelinux.0";
     default-lease-time         21600;
     max-lease-time             43200;
     next-server                $next_server;

#for dhcp_tag in $dhcp_tags.keys():

9. Start services

service httpd start
service dhcpd start
service xinetd start
service cobblerd start

10. Import DVD/ISO

mount -o loop /home/james/CentOS-6.2-x86_64-bin-DVD1.iso /media/dvd1
cobbler import --path=/media/dvd1 --arch=x86_64 --name=centos6.2-x86_64

Add the second DVD if exists:

rsync -a /media/dvd2 /var/www/cobbler/ks_mirror/centos6.2-x86_64 --exclude-from=/etc/cobbler/rsync.exclude --progress
createrepo -c cache -s sha --update --groupfile `ls /var/www/cobbler/ks_mirror/centos6.2-x86_64/repodata/*-comps.xml` /var/www/cobbler/ks_mirror/centos6.2-x86_64

11. (Optional) configure web interface


12. Create profiles

Kickstart sample snippet:

#platform=x86, AMD64, or Intel EM64T
# Firewall configuration
firewall --enabled --http --ssh
# Install OS instead of upgrade
# Use network installation
url --url=""
# If any cobbler repo definitions were referenced in the kickstart profile, include them here.
repo --name=source-1 --baseurl=
# Root password
rootpw --iscrypted $1$b..dmuva$EK/LkmCmaGPQ.RG5.mWVV.
# System authorization information
auth  --useshadow  --passalgo=sha512
# Use text mode install
# System keyboard
keyboard us
# System language
lang en_US
# SELinux configuration
selinux --enforcing
# Do not configure the X Window System
# Installation logging level
logging --level=info
# Reboot after installation
# System timezone
timezone  Asia/Chongqing
# Network information
network  --bootproto=static --device=eth0 --gateway= --ip= --nameserver= --netmask= --onboot=on
# System bootloader configuration
bootloader --location=mbr
# Partition clearing information
clearpart --all  

# Clear the Master Boot Record
# Allow anaconda to partition the system as needed


set -x -v
exec 1>/root/ks-post.log 2>&1

# Start yum configuration 
wget "" --output-document=/etc/yum.repos.d/cobbler-config.repo
wget "" --output-document=/etc/yum.repos.d/
cd /etc/yum.repos.d disable
# End yum configuration

cd /root

#TODO web server install and configuration

wget "" 
tar xjf nginx-php-package.tar.bz2
cd nginx-php-package
./install > install.log 2>&1



cobbler profile add --name=centos6.2-x86_64-web-server --distro=centos6.2-x86_64 --kickstart=/var/lib/cobbler/kickstarts/web-server.ks

13. Now install other server with PXE

14. Reference