ITPub博客

首页 > Linux操作系统 > Linux操作系统 > PXE+DHCP+TFTP+NFS+Kickstart网络自动安装配置简化版

PXE+DHCP+TFTP+NFS+Kickstart网络自动安装配置简化版

原创 Linux操作系统 作者:tonykorn97 时间:2008-04-08 00:00:00 0 删除 编辑

DHCP,NFS,TFTP使用同一台服务器,IP为172.25.1.114


一、配置DHCP服务
安装dhpc
vi /etc/dhcpd.conf

ddns-update-style interim;
ignore client-updates;
allow booting;
allow bootp;

class "pxeclients"{
match if substring(option vendor-class-identifier,0,9) = "PXEClient";
filename "redhat5x86/pxelinux.0";
next-server 172.25.1.114;
}
subnet 172.25.0.0 netmask 255.255.0.0 {
option routers 172.25.0.254;
option subnet-mask 255.255.0.0;
# option nis-domain "www.tonykorn.com";
# option domain-name "www.tonykorn.com";
# option domain-name-servers 202.96.134.133;
option time-offset -18000; # Eastern Standard Time
range dynamic-bootp 172.25.1.130 172.25.1.140;
default-lease-time 21600;
max-lease-time 43200;

host linux {
hardware ethernet 00:1E:C9:3A:37:48;
fixed-address 172.25.1.130;
}
host linux2 {
hardware ethernet 00:1E:C9:3A:34:E8;
fixed-address 172.25.1.131;
}
}


======================================================================

二、配置TFTP
安装
chkconfig tftp on
service xinetd restart
====================================================================
三、启动文件配置
[root@localhost tftpboot]# mkdir redhat5x86
[root@localhost tftpboot]# mount -o loop /root/redhat5.x64.iso /mnt
[root@localhost tftpboot]# cp /usr/lib/syslinux/pxelinux.0 /tftpboot/redhat5x86/
[root@localhost tftpboot]# mkdir /tftpboot/redhat5x86/pxelinux.cfg
[root@localhost tftpboot]# cp /mnt/isolinux/isolinux.cfg /tftpboot/redhat5x86/pxelinux.cfg/default
[root@localhost tftpboot]# cp /mnt/images/pxeboot/initrd.img /tftpboot/redhat5x86/
[root@localhost tftpboot]# cp /mnt/images/pxeboot/vmlinuz /tftpboot/redhat5x86/
[root@localhost tftpboot]#

default的默认信息为:
[root@localhost tftpboot]# cat /tftpboot/redhat5x86/pxelinux.cfg/default
default linux
prompt 1
timeout 600
display boot.msg
F1 boot.msg
F2 options.msg
F3 general.msg
F4 param.msg
F5 rescue.msg
label linux
kernel vmlinuz
append initrd=initrd.img
label text
kernel vmlinuz
append initrd=initrd.img text
label ks
kernel vmlinuz
append ks initrd=initrd.img
label local
localboot 1
label memtest86
kernel memtest
append -

[root@localhost tftpboot]#

修改为:
default local
prompt 1
timeout 600
display boot.msg
F1 boot.msg
F2 options.msg
F3 general.msg
F4 param.msg
F5 rescue.msg
label local
localboot 0
label linux install
kernel vmlinuz
append initrd=initrd.img
label linux text
kernel vmlinuz
append initrd=initrd.img text
label linux ks
kernel vmlinuz
append ks initrd=initrd.img
label linux memtest86
kernel memtest
append -
label linux autoinstall
kernel vmlinuz
append ks=http://172.25.1.114/export/ks/hdr.cfg initrd=initrd.img devfs=nomount ramdisk_size=16384 nofb


[root@localhost redhat5x86]# cp /mnt/isolinux/*.msg /tftpboot/redhat5x86/
[root@localhost redhat5x86]# cat /tftpboot/redhat5x86/boot.msg
splash.lss

- To install or upgrade in graphical mode, press the 0107 key.

- To install or upgrade in text mode, type: 01linux text 07.

- Use the function keys listed below for more information.

0f[F1-Main] [F2-Options] [F3-General] [F4-Kernel] [F5-Rescue]07
[root@localhost redhat5x86]#

修改boot.msg文件为:

^L
^Xsplash.lss
- To boot Operation System locally, press the ^O01^O07 key.
- To install or upgrade in graphical mode, type: ^O01linux ^O07 key.
- To install or upgrade in text mode, type: ^O01linux text ^O07.
- To auto install or upgrade, type: ^O01linux autoinstall ^O07.
- Use the function keys listed below for more information.
^O0f[F1-Main] [F2-Options] [F3-General] [F4-Kernel] [F5-Rescue]^O07

===============================================================
四、配置NFS服务

[root@localhost redhat5x86]# cat /etc/exports
/export *(ro,sync)
/export/ks *(rw,sync)
[root@localhost redhat5x86]#


[root@localhost /]# mkdir /export
[root@localhost /]# mkdir /export/ks
[root@localhost /]# mv /root/*.iso /export/
[root@localhost /]# cp /root/anaconda-ks.cfg /export/ks/ks.cfg
[root@localhost /]# chmod 644 /export/ks/ks.cfg
[root@localhost /]#

===============================================================
五、重启服务

service dhcpd restart
service xinetd restart
service nfs restart
===============================================================
六、设备客户端

客户端设置PXE启动启动后输入linux autoinstall

问题:
输入linux autoinstall一直不能运行,

输入:
linux ks=http://172.25.1.114/export/ks/hdr.cfg 可以执行.

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/312079/viewspace-245856/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2007-12-05

  • 博文量
    1854
  • 访问量
    2088375