系统:CentOS6.4(iptables stop,selinux disable)
硬件:普通PC机
clonezilla(再生龙) stable releases - 2.2.1-25 \i486\zip (详细介绍和下载:www.clonezilla.org)
dhcp
tftp
syslinux
samba
软件安装:yum install dhcp
yum install tftp-server
yum install syslinux (详细介绍:http://www.syslinux.org 最新版本可以在这里下载:https://www.kernel.org/pub/linux/utils/boot/syslinux/)
yum install samba
软件配置:dhcp服务器配置(vi /etc/dhcp/dhcpd.conf)
default-lease-time 259200; max-lease-time 518400; subnet 10.45.16.0 netmask 255.255.255.0 { # range dynamic-bootp 10.45.16.50 10.45.16.99; range 10.45.16.50 10.45.16.99; option broadcast-address 10.45.16.255; option routers 10.45.16.254; next-server 10.45.16.247; filename "gpxelinux.0"; }
tftp服务器配置(vi /etc/xinetd.d/tftp)
service tftp { socket_type = dgram protocol = udp wait = yes user = root server = /usr/sbin/in.tftpd server_args = -s /tftpboot #设定共享目录 disable = no #默认为yes,修改为no per_source = 11 cps = 100 2 flags = IPv4 }
samba服务器配置(vi /etc/samba/smb.conf)(将镜像文件拷贝到/home/samba)
[global]
#设定工作组 workgroup = WORKGROUP server string = Samba Server Version %v
# ----------------------- Standalone Server Options ------------------------
#
# Scurity can be set to user, share(deprecated) or server(deprecated)
#
# Backend to store user information in. New installations should
# use either tdbsam or ldapsam. smbpasswd is available for backwards
# compatibility. tdbsam requires no further configuration.
#设置为不用密码访问
security = share
; passdb backend = tdbsam
#============================ Share Definitions ==============================
# A publicly accessible directory, but read only, except for people in
# the "staff" group
#设定path共享目录
[public]
comment = Public Stuff
path = /home/samba
public = yes
writable = yes
; printable = no
; write list = +staff
设置tftp共享目录
cd / mkdir tftpboot
cd tftpboot
cp /usr/share/syslinux/gpxelinux.0 /tftpboot
cp /usr/share/syslinux/vesamenu.c32 /tftpboot
mkdir clonezilla #在clonezilla官网下载PXE版,解压将里面live文件夹拷贝到这个文件夹下
mkdir pxelinux.cfg
cd pxelinux.cfg # 客户端通过PXE启动,会自动在该文件夹搜寻启动菜单
vi default # 添加启动菜单
UI vesamenu.c32
TIMEOUT 300
MENU TITLE Welcome to MY PXE Server System
LABEL Clonezilla-live
MENU LABEL Clonezilla Live (Ramdisk)
KERNEL ./clonezilla/live/vmlinuz
APPEND initrd=./clonezilla/live/initrd.img boot=live config noswap nolocales edd=on nomodeset ocs_live_run="ocs-live-general" ocs_live_extra_param="" keyboard-layouts="" ocs_live_batch="no" locales="" vga=788 nosplash noprompt fetch=tftp://10.45.16.247/clonezilla/live/filesystem.squashfs
重启服务
service dhcpd restart
service xinetd restart
service smb restart
客户端测试
通过clonezilla+dhcp+tftp+samba组合,实现网络安装系统
原文:http://www.cnblogs.com/nearsun/p/3552989.html