网络自动安装LINUX
时间:20104 4


步骤:

一、安装配置TFTP服务

# rpm -ivh /var/ftp/RHEL5U3/Server/tftp-server-0.42-3.1.i386.rpm
# cp /usr/lib/syslinux/pxelinux.0 /tftpboot/
# chkconfig tftp on
# service xinetd restart
停止 xinetd [确定]
启动 xinetd [确定]
[root@seker syslinux]# netstat -ulp | grep tftp
udp 0 0 *:tftp *:* 15615/xinetd


二、安装配置DHCP服务
ddns-update-style interim;
ignore client-updates;

subnet 192.168.0.0 netmask 255.255.255.0 {
next-server 192.168.0.123;
filename "/pxelinux.0";

# --- default gateway
option routers 192.168.0.123;
option subnet-mask 255.255.255.0;

option nis-domain "baigoohu.com";
option domain-name "baigoohu.com";
option domain-name-servers 192.168.0.123;
option time-offset -18000; # Eastern Standard Time
range dynamic-bootp 192.168.1.100 192.168.1.200;
default-lease-time 21600;
max-lease-time 43200;

}

service dhcpd start

三、配置启动所需要的文件
# cd /tftpboot/
# ls
pxelinux.0
# mkdir pxelinux.cfg
# cd pxelinux.cfg/
# cp /var/ftp/RHEL5U3/isolinux/isolinux.cfg /tftpboot/pxelinux.cfg/default
# ++++++++++++=
# cd /var/ftp/pub/isolinux/
# cp vmlinuz initrd.img /tftpboot/
# ls /tftpboot/
initrd.img pxelinux.0 pxelinux.cfg vmlinuz
# tree /tftpboot/
/tftpboot/
|-- initrd.img
|-- pxelinux.0
|-- pxelinux.cfg
| `-- default
`-- vmlinuz

1 directory, 4 files


 
四、配置default文件如下
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 ks=nfs:192.168.0.123:/tmp/ks.cfg


chkconfig tftp on
service xinetd restart