服务器端使用了 centos 6.0 最小化安装,关闭selinux
- yum install -y nginx dhcp xinetd
将系统ISO镜像文件挂载到/data/iso,并将Nginx 页面目录设置为相应文件夹
配置 tftp
- cat /etc/xinetd.d/tftp
-
# default: off
-
# description: The tftp server serves files using the trivial file transfer \
-
# protocol. The tftp protocol is often used to boot diskless \
-
# workstations, download configuration files to network-aware printers, \
-
# and to start the installation process for some operating systems.
-
service tftp
-
{
-
socket_type = dgram
-
protocol = udp
-
wait = yes
-
user = root
-
server = /usr/sbin/in.tftpd
-
server_args = -u nobody -s /data/tftpboot ( tftp跟路径,-u 所有用户可用,-s 是和dhcp套起来使用的)
-
disable = no
-
per_source = 11
-
cps = 100 2
-
flags = IPv4
-
}
配置 dhcp
- cat /etc/dhcp/dhcpd.conf
-
ddns-update-style interim;
-
ignore client-updates;
-
allow booting;
-
allow bootp;
-
-
subnet 10.0.1.0 netmask 255.255.255.0 {
-
-
# --- default gateway
-
option routers 10.0.1.1;
-
option subnet-mask 255.255.255.0;
-
-
# option nis-domain "domain.org";
-
option domain-name "install.org";
-
option domain-name-servers 202.101.172.35;
-
option domain-name-servers 202.101.172.48;
-
-
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 10.0.1.100 10.0.1.250;
default-lease-time 21600;
max-lease-time 43200;
next-server 10.0.1.1; (tftp服务器IP)
filename "/pxelinux.0"; (在客户端获取IP后,执行的文件,在tftp跟路径处使用 -s ,这里就可用使用相对路径,不然只能写绝对路径)
# 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;
# }
}
建立 PXE 目录,拷贝系统启动时加载的文件
- mkdir -p /data/tftpboot/{images,pxelinux.cfg}
-
cp /data/iso/isolinux/{boot.msg,splash.jpg,vesamenu.c32} /data/tftpboot/images
-
cp /data/iso/isolinux/{vmlinuz,initrd.img} /data/tftpboot/images/centso-5.5_x86_64 (对应default 文件中的 kernel 和 append initrd目录)
下面是一个示例,默认安装 CentOS 5.5 x86_64,可按各自需求修改
- cat /data/tftpboot/pxelinux.cfg/default
-
default images/vesamenu.c32
-
#prompt 1
-
timeout 600
-
-
display images/boot.msg
-
#display pxelinux.cfg/list
-
-
menu background images/splash.jpg
-
menu title Welcome to Linux installation interface !
-
-
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 1
-
menu label ^Install CentOS 5.5 x86_64
-
menu default
-
kernel images/centos-5.5-x86_64/vmlinuz
-
append initrd=images/centos-5.5-x86_64/initrd.img
-
label 2
-
menu label ^Install CentOS 5.6 x86_64
-
kernel images/centos-5.6-x86_64/vmlinuz
-
append initrd=images/centos-5.6-x86_64/initrd.img
-
label 3
-
menu label ^Install CentOS 6.0 x86_64
-
kernel images/centos-6.0-x86_64/vmlinuz
-
append initrd=images/centos-6.0-x86_64/initrd.img
-
label rescue (修复模式启动)
-
menu label ^Rescue installed system
-
kernel images/centos-6.0-x86_64/vmlinuz
-
append initrd=images/centos-6.0-x86_64/initrd.img rescue
-
label memtest86 (内存测试)
-
menu label ^Memory test
-
kernel images/memtest
-
append -
阅读(861) | 评论(0) | 转发(0) |