|
RedHat操作系统网络pxe安装,服务器配置说明 (注1)
chinajz
前言:为了rhce论证考试,试图取得和考试相似的环境,制作了rhel3操作系统网络安装服务器。由于本人没有参加过rhce论证考试,不知环境是否如本文所述,请行家批评指证。另由于时间仓促,没过细整理,如有错误,请谅解。
#####################################
目的:
安装dhcp,ftp和tftp服务器和redhat-config-netboo软件包,并进行适当的设置,使具有PXE Bootrom引导功能网卡的电脑(台式机网卡如没有PXE Bootrom功能,可买PXE Bootrom芯片插入网卡内),在局域网内的所有机器通过网络引导实现三种功能:安装,rescue和正常运行。用本文介绍的方法,你当然可以实现更多的功能。
(这里仅介绍ftp匿名网络安装,其它方法类似)
--------------------------------------------
要求:
客户端电脑通过网络引导后进入boot:
选择界面:install,rescue,local
在客户端输入:install或直接回车进入安装模式
在客户端输入:linux rescue进入rescue模式
在客户端输入:local进入正常运行模式
--------------------------------------------
os:redhat Enterprise Linux 3 或 4
试验环境:
一台内存512M,硬盘80G,ESC主板,双网卡,连局域网的ip:192.168.0.1
另一台为Dell D800笔记本电脑,bios设置从网络引导
服务器防火墙打开ftp等相应端口
###########################################
0.安装dhcp,ftp和tftp服务;
1.设置vsftpd
/etc/rc.d/init.d/vsftpd文件用默认值,不用设置。
终端执行以下命令:
#mount /mnt/cdrom
对第一张盘:
#cp /mnt/cdrom/RELEASE-NOTES*.html /var/ftp/pub
#cp -var /mnt/cdrom/RedHat /var/ftp/pub
把另外三张光盘RedHat/RPMS目录下的文件都拷至/var/ftp/pub/RedHat/RPMS
service vsftpd start
2.设置dhcpd
#cp /usr/share/doc/dhcp-3.0.1/dhcpd.conf.sample /etc/dhcpd.conf
在dhcpd.conf中加入以下内容:
allow booting;
allow bootp;
class "pxeclients" {
match if substring(option vendor-class-identifier, 0, 9) = " XEClient";
next-server 192.168.0.1;
filename "linux-install/pxelinux.0";
}
就象这样:
ddns-update-style interim;
ignore client-updates;
####################加在这下面
allow booting;
allow bootp;
class "pxeclients" {
match if substring(option vendor-class-identifier, 0, 9) = " XEClient";
next-server 192.168.0.1;
filename "linux-install/pxelinux.0";
}
###################
subnet 192.168.0.0 netmask 255.255.255.0 {
# --- default gateway
option routers 192.168.0.1;
option subnet-mask 255.255.255.0;
option nis-domain "domain.org";
option domain-name "domain.org";
option domain-name-servers 192.168.1.1;
option time-offset -18000; # Eastern Standard Time
# option ntp-servers 192.168.1.1;
# option netbios-name-servers 192.168.1.1;
# --- Selects point-to-point node (default is hybrid). Don't change this unless
# -- you understand Netbios very well
# option netbios-node-type 2;
range dynamic-bootp 192.168.0.128 192.168.0.254;
default-lease-time 21600;
max-lease-time 43200;
# we want the nameserver to appear at a fixed address
host ns {
next-server marvin.redhat.com;
hardware ethernet 12:34:56:78:AB:CD;
fixed-address 207.175.42.254;
}
}
启动dhcpd服务:
service dhcpd start
3.设置tftp
/etc/xinetd.d/tftp文件用默认值,不用设置。
在终端下输入:
chkconfig --level 345 xinetd on
chkconfig --level 345 tftp on
service xinetd restart
安装redhat-config-netboot软件包,这样会在根目录产生/tftpboot相关目录和文件:
# rpm -ihv redhat-config-netboot-0.1.1-19.i386.rpm
检查根目录是否生成/tftpboot子目录下相关目录和文件。
插入第一张光盘
mount /mnt/cdrom
cp /mnt/cdrom/images/pxeboot/*.* /tftpboot/linux-install
4.修改/tftpboot/linux-install/pxelinux.cfg/default为如下内容:
default install
timeout 100
prompt 1
display msgs/myboot.msg
F1 msgs/myboot.msg
F2 msgs/myboot.msg
F3 msgs/myboot.msg
F4 msgs/myboot.msg
F5 msgs/myboot.msg
F7 msgs/myboot.msg
label install
KERNEL vmlinuz
APPEND initrd=initrd.img
label linux rescue
KERNEL vmlinuz linux rescue
APPEND initrd=initrd.img
label local
localboot 1
5.建立/tftpboot/linux-install/msgs/myboot.msg文件,内容如下:
09General Boot Help07
You can load the 0cRed Hat07 Enterprise Linux installation program, and
begin the installation process from this prompt. In most cases, the best
way to get started is to simply press the 0f<ENTER>07 key.
#########################################
# Type:
# install
# into install mode.
# Type:
# linux rescue
# into linux rescue mode.
# Type:
# local
# into local linux run mode.
#########################################
05[F1-Main] [F2-General] [F3-Expert] [F4-Kernel] [F5-Rescue]07
至此,服务器设置完成
==============================================
客户端开引导,直接进入boot文本界面
在客户端输入:install或直接回车进入安装模式
在客户端输入:linux rescue进入rescue模式
在客户端输入:local进入正常运行模式
到Installation Method 菜单,选择ftp安装
Configure TCP/IP选择Use dynamic IP configuration(BOOTP/DHCP)
FTP Setup中FTP site name 填入192.168.0.1
RedHat dir 填入pub/
就OK了
需要说明的是,这里的服务都是新装的,如果设置以前已经调整,要做相应的修改。
──────────────────────────────────────
以下为KevinZou建议:
1. 文华的pxe环境是基于grub的,而非isolinux, 银河的系统使用什么我不知道!
2. 服务器端最好同时打开ftp , nfs和 http服务, 这三个服务都可以做为文件共享用于安装,http还可以由于ks 方式无人职守安装。
3. 注意网络的rescue模式没有tab键的补齐功能,如果要挂接文件树,请选择nfs将服务器上的共享挂接到/mnt/source 下。
注1: 以前的标签我改了,以免误导大家。( Kevin Zou) |
|