1.配置DHCP服务器
yum -y install dhcp
vi /etc/sysconfig/network-script/ifcfg-eth0
需要将BOOTPROTO由DHCP自动分配地址,改为none或者static。
IPADDR填写DHCP服务器的地址。
填写默认网关和子网掩码,如下图:
vi /etc/dhcp/dhcpd.conf
# # DHCP Server Configuration file. # see /usr/share/doc/dhcp*/dhcpd.conf.sample # see 'man 5 dhcpd.conf' # option domain-name-servers 192.168.100.101; filename "pxelinux.0"; next-server 10.20.100.32; default-lease-time 600; max-lease-time 7200; authoritative; subnet 10.20.8.0 netmask 255.255.255.0{ range dynamic-bootp 10.20.8.10 10.20.8.200; option broadcast-address 10.20.8.255; option routers 10.20.8.1; } subnet 10.20.11.0 netmask 255.255.255.0{ range dynamic-bootp 10.20.11.10 10.20.11.200; option broadcast-address 10.20.11.255; option routers 10.20.11.1; }
关闭防火墙,设置/etc/selinux/config下SELINUX=disabled
/etc/init.d/network restart
setvice dhcpd restart
2.再生龙配置
步骤一:安装服务
yum �Cy install syslinux xinetd
yum �Cy tftp*
mkdir /var/lib/tftpboot/pxelinux.cfg
cp /usr/share/syslinux/pxelinux.0 /var/lib/tftpboot/
步骤二:启动TFTP
vi /etc/xinetd.d/tftp
修改disable =no
server_args是tftp路径
vi /etc/dhcp/dhcpd.conf
添加:
filename "pxelinux.0";
next-server 10.20.100.32
/etc/rc.d/init.d/dhcpd restart
service xinetd start
chkconfig xinetd on
步骤三:
修改pxe的启动文件
vi /var/lib/tftpboot/pxelinux.cfg/default
default menu.c32
prompt 1
timeout 100
label 1
menu label ^1) Clonezilla Live (Ramdisk)
KERNEL clonezilla/vmlinuz
APPEND initrd=clonezilla/initrd.img boot=live config noswap nolocales edd=on nomodeset ocs_live_run="ocs-live-general" ocs_live_extra_param="" ocs_live_keymap="" ocs_live_batch="no" ocs_lang="" vga=788 nosplash noprompt fetch=http://10.20.100.32/clonezilla/filesystem.squashfs
label 2
menu label ^3) Centos 6.6 Install
KERNEL centos_x86_64/vmlinuz
APPEND initrd=centos_x86_64/initrd.img method=http://10.20.100.33/centos_x86_64 devfs=nomount
步骤四:
将再生龙需要的三个文件menu.c32,initrd.img和vmlinuz传到tftpboot路径下(这个可以从再生龙官网上下载)
步骤五:
传输http://10.20.100.32/下的文件
下载httpd服务 yum �Cy install httpd
修改/etc/httpd/conf/httpd.conf
添加如下:
<VirtualHost *:80> ServerAdmin [email protected] DocumentRoot /var/www/html/ # ServerName dummy-host.example.com ErrorLog logs/dummy-host.example.com-error_log CustomLog logs/dummy-host.example.com-access_log common </VirtualHost>
注释掉/etc/httpd/conf.d/welcome.conf中的所有内容
将文件filesystem.squashfs 放在Documentroot下
步骤五:samba服务(个人需要,不是装clonezilla必要)
安装samba服务,yum �Cy install samba
配置samba服务,vi /etc/samba/smb.conf
在末尾加入
[images] comment = Public Stuff path = /work/images valid users = administrator guest ok = no create mode = 0770 directory mode = 0770 share modes = yes writable = yes printable = no [images0] comment = Public Stuff path = /work/images0 valid users = administrator guest ok = no create mode = 0770 directory mode = 0770 share modes = yes writable = yes printable = no
给valid用户创建密码
Useradd administrator
Passwd administrator
smbpasswd -a administrator
本文出自 “7582964” 博客,转载请与作者联系!