您的位置:首页 > 理论基础 > 计算机网络

linux 使用PXE方式,kickstar网络安装系统

2012-11-13 10:41 726 查看
软件需求:(可使用yum方式安装)
0.DHCP服务
1.xinet
2.kickstar包
3.tftp
4.vsftpd
5.启动文件、系统内核文件、系统镜像
[root@test ~]# cd /var/lib/tftpboot/ #拷贝相关文件到tftp目录
[root@test tftpboot]# ll
总用量 34168
-r--r--r-- 1 root root 84 10月 25 14:40 boot.msg
-r--r--r-- 1 root root 29608959 10月 25 14:40 initrd.img
-rw-r--r-- 1 root root 26828 10月 25 11:17 pxelinux.0
drwxr-xr-x 2 root root 4096 10月 25 14:23 pxelinux.cfg
-r--r--r-- 1 root root 1236005 10月 25 14:40 splash.jpg
-r--r--r-- 1 root root 162860 10月 25 14:40 vesamenu.c32
-r-xr-xr-x 1 root root 3938800 10月 25 14:40 vmlinuz
chmod 755 /var/ftp/ks.cfg #此文件权限设置为755
在linux图形界面启动kickstar,定制应答文件.命令如下
#system-config-kickstart
kf.cfg由kickstar定制生成的,存放在ftp目录下
kf.cfg配置文件
[root@test pub]# cat ks.cfg
key --skip 在此处添加跳过输入序列号指令

[root@test tftpboot]# cd pxelinux.cfg/
[root@test pxelinux.cfg]# ll
总用量 4
-rwxr-xr-x 1 root root 999 10月 25 14:23 default
[root@test pxelinux.cfg]#
[root@test pxelinux.cfg]# ^C
[root@test pxelinux.cfg]# cat default #启动加载程序后安装菜单配置文件
default vesamenu.c32
#prompt 1
timeout 6 选择菜单时间

display boot.msg

menu background splash.jpg
menu title Welcome to Red Hat Enterprise Linux 6.2!
menu color border 0 #ffffffff #00000000
menu color sel 7 #ffffffff #ff000000
menu color title 0 #ffffffff #00000000
menu color tabmsg 0 #ffffffff #00000000
menu color unsel 0 #ffffffff #00000000
menu color hotsel 0 #ff000000 #ffffffff
menu color hotkey 7 #ffffffff #ff000000
menu color scrollbar 0 #ffffffff #00000000

label linux
menu label ^Install or upgrade an existing system
menu default
kernel vmlinuz
append ks=ftp://10.15.62.186/pub/ks.cfg ksdevice=eth0 initrd=initrd.img #ks.cfg 位置
label vesa
menu label Install system with ^basic video driver
kernel vmlinuz
append initrd=initrd.img xdriver=vesa nomodeset
label rescue
menu label ^Rescue installed system
kernel vmlinuz
append initrd=initrd.img rescue
label local
menu label Boot from ^local drive
localboot 0xffff
label memtest86
menu label ^Memory test
kernel memtest
append -

[root@test pxelinux.cfg]#
cd /var/ftp/pub/ #此FTP目录,存放linux系统镜像iso文件
[root@test pub]# cat /etc/dhcp/dhcpd.conf #dhcpd.conf具体设置
ddns-update-style interim;
ignore client-updates;
allow booting;
allow bootp;
subnet 10.15.62.0 netmask 255.255.255.0 {
range dynamic-bootp 10.15.62.100 10.15.62.250;
}
option subnet-mask 255.255.255.0;
option broadcast-address 10.15.62.255;
default-lease-time 21600;
max-lease-time 43200;
Next-server 10.15.62.186;
Filename "pxelinux.0"; #pxe客户端获取ip后,找的启动加载文件pxelinux.0
[root@test pub]#

重启相关服务
#service vsftpd restart
#service xinetd restart
#service dhcpd restart本文出自 “Charles的博客” 博客,请务必保留此出处http://makert.blog.51cto.com/209063/1058647
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: