option routers 192.168.168.230; #定义默认网关 option subnet-mask 255.255.255.0;
option domain-name-servers 192.168.168.6; #定义nameServer
option time-offset -18000; # Eastern Standard Time
range dynamic-bootp 192.168.168.12 192.168.168.254;
default-lease-time 21600;
max-lease-time 43200;
[color=red]# Group the PXE bootable hosts together 定义可以PEX启动的主机的组
group {
# PXE-specific configuration directives...
next-server 192.168.168.6; #TFTPServer的IP filename "/pxelinux.0";#pxelinux loader文件位置
# You need an entry like this for every host
# unless you're using dynamic addresses #可PEX启动的主
#机的IP与MAC地址的邦定
host wy {
hardware ethernet 00:00:E2:89:9B:DB;
fixed-address 192.168.168.128;
}
}[/color]}
红色的部分为在DHCP中支持TFTP及PXElinux的所要添加的部分。service dhcpd restart 开启DHCP服务。
3) 配制PEXlinux。要远程启动机器,就必须要有PXElinux这个由syslinux、isolinux派生出来的,支持PXE的bootloader,它可以实现远程通过PEX启动一台机器。把/usr/lib/syslinux/pxelinux.0考到/tftpboot目录下,把RedHat9第一张安装光盘上/image/pxeboot/initr.img和vmlinux也考到/tftpboot目录下。在/tftpboot建一个pxelinux.cfg目录,用于放syslinux的配制文件。Sysconfig的配制文件有现成的可用,在rh9第一张安装光盘isolinux/下有一个isolinux.cfg文件,把它考成/tftpboot/default,把isolinux/*.msg考到/tftpboot下(RedHat的安装光盘的Loader就是个isolinux,呵呵)。对default(也就是isolinux.cfg)作一下修改,下面是我的default文件:
default [color=red]local [/color]
prompt 1
timeout 30
display boot.msg
F1 boot.msg
F2 options.msg
F3 general.msg
F4 param.msg
F5 rescue.msg
F7 snake.msg
[color=red]label local
localboot 0[/color]
label linux
kernel vmlinuz
append initrd=initrd.img devfs=nomount ramdisk_size=9216
label text
kernel vmlinuz
append initrd=initrd.img text devfs=nomount ramdisk_size=9216
label expert
kernel vmlinuz
append expert initrd=initrd.img devfs=nomount ramdisk_size=9216
label ks
kernel vmlinuz
append ks initrd=initrd.img devfs=nomount ramdisk_size=9216
label nofb
kernel vmlinuz
append initrd=initrd.img devfs=nomount nofb ramdisk_size=9216
label lowres
kernel vmlinuz
append initrd=initrd.img lowres devfs=nomount ramdisk_size=9216
[color=red]label autoinstall
kernel vmlinuz
append ks=http://192.168.168.6/rh9/ks.cfg initrd=initrd.img devfs=nomount ramdisk_size=9216 nofb[/color]
红色的部份是我加的,用于实现本地硬盘启动或支持kickstart的PXE网络自动安装。
cat一下/tftpboot/boot.msg文件:
splash.lss
[color=red] - To Local boot 02Red Hat07 Linux , type:
0f;07.[/color]
- To install or upgrade 02Red Hat07 Linux in graphical mode,
press the 0f linux;07 key.
- To install or upgrade 02Red Hat07 Linux in text mode, type:
0flinux text ;07.
[color=red]- To Auto Install 02Red Hat07 Linux , type:
0flinux autoinstall ;07.[/color]
- Use the function keys listed below for more information.
6 ks.cfg文件
install
url --url http://192.168.168.35/rh7
lang en_US
langsupport --default en_US.iso885915 zh_CN.GB18030 zh_TW.Big5 en_US.iso885915
keyboard us
mouse generic3ps/2 --device psaux
skipx
rootpw --iscrypted $1$驜N/衢KL$RKxVATP6iXeJ5T9mwFiUn/
firewall --disabled
authconfig --enableshadow --enablemd5
timezone Asia/Shanghai
bootloader --useLilo
# The following is the partition information you requested
# Note that any partitions you deleted are not expressed
# here so unless you clear all partitions first, this is
# not guaranteed to work
clearpart --all
part / --fstype ext3 --size=512
part /usr --fstype ext3 --size=4000
part swap --size=1024
part /var --fstype ext3 --size=512
part /home --fstype ext3 --size=1 --grow
%packages
@ Printing Support
@ Classic X Window System
@ X Window System
@ GNOME
@ Sound and Multimedia Support
@ Network Support
@ Dialup Support
@ Messaging and Web Tools
@ Everything
kernel-smp