system: Fedora11
参考了网上一些资料,具体网址忘了,请原谅
You need install tftp, xinetd, nfs, dhcp service
if your dhcp server isn't the same with PXE server, you may need to do some change. I don't do that test.
1. setup tftp
#vim /etc/xinetd.d/tftp
service tftp
{
disable = no #default is yes, change to no
socket_type = dgram
protocol = udp
wait = yes
user = root
server = /usr/sbin/in.tftpd
server_args = -u nobody -s /tftpboot #everyone can access
per_source = 11
cps = 100 2
flags = IPv4
}
#/etc/init.d/xinetd restart
Check tftp is work
#chkconfig --list |grep tftp
tftp: on
2. setup nfs
#mkdir /PXE
#vim /etc/exports
/tftpboot *(ro,sync)
/PXE *(ro,sync)
#/etc/init.d/nfs restart
check share directory
#Showmount –e localhost
Export list for localhost:
/PXE *
/tftpboot *
3. setup dhcp
#vim /etc/dhcpd.conf
ddns-update-style interim;
ignore client-updates;
allow booting;
allow bootp;
subnet 192.168.1.0 netmask 255.255.255.0 {
option routers 192.168.1.1; #this IP is your PXE server IP address
option subnet-mask 255.255.255.0;
option domain-name-servers 192.168.1.1;
option time-offset -18000;
range dynamic-bootp 192.168.1.2 192.168.1.254;
default-lease-time 21600;
max-lease-time 43200;
next-server 192.168.1.1;
filename "/pxelinux.0";
}
#/etc/init.d/dhcpd restart
4. setup PXE
#mkdir /tftpboot/pxelinux.cfg
create fold under /PXE for the system you want to install
#mkdir /PXE/fedora12
you can use iso or copy DVD or CD file to fedora12 fold
#mount yourpath/fedora12.iso /PXE/fedora12 -o loop
#cp /usr/lib/syslinux/pxelinux.0 /tftpboot/
#cp /PXE/fedora12/isolinux/vmlinuz /tftpboot/
#cp /PXE/fedora12/isolinux/initrd.img /tftpboot/
#cp /PXE/fedora12/isloinux/isolinux.cfg /tftpboot/pxelinux.cfg/default
vesamenu.c32 only fedora12 use, centOS doesn't need
cp /PXE/fedora12/vesamenu.c32 /tftpboot/
5. Install system
power on other PC, press F12 to boot from PXE server
select NFS, and input your IP and directory /PXE/fedora12
if you want to use cd, you need copy each cd to /PXE/yourfold/, if disk2 has the same file in disk1, cover it.
dhcpd.conf配置的有关说明:
parameters(参数):
ddns-update-style 配置DHCP-DNS互动更新模式
default-lease-time 指定缺省租赁时间的长度,单位是秒
max-lease-time 指定最大租赁时间长度,单位是秒
hardware 指定网卡接口类型和MAC地址
server-name 通知DHCP客户服务器名称
get-lease-hostnames flag 检查客户端使用的IP地址
fixed-address ip 分配给客户端一个固定的地址
authritative 拒绝不正确的IP地址的要求
declarations(声明):
shared-network 用来告知是否一些子网络分享相同网络
subnet 描述一个IP地址是否属于该子网
range 起始IP 终止IP 提供动态分配IP 的范围
host 主机名称 参考特别的主机
group 为一组参数提供声明
allow unknown-clients或deny unknown-client 是否动态分配IP给未知的使用者
allow bootp或deny bootp 是否响应激活查询
allow booting或deny booting 是否响应使用者查询
filename 开始启动文件的名称,应用于无盘工作站
next-server 设置服务器从引导文件中装如主机名,应用于无盘工作站
option(选项):
subnet-mask 为客户端设定子网掩码
domain-name 为客户端指明DNS名字
domain-name-servers 为客户端指明DNS服务器IP地址
host-name 为客户端指定主机名称
routers 为客户端设定默认网关
broadcast-address 为客户端设定广播地址
ntp-server 为客户端设定网络时间服务器IP地址