环境:rhel 6.4
使用的场景:批量安装系统
1、DCHP的搭建
1)安装dhcp服务软件 yum -y dhcp
2) 设置dchp配置文件
查找dchp的配置文件位置#rpm -ql dhcp |grep
# vim /etc/dhcp/dhcpd.conf
# cp /usr/share/doc/dhcp-4.1.1/dhcpd.conf.sample /etc/dhcp/dhcpd.conf
subnet 192.168.81.0 netmask 255.255.255.224 {
range 192.166.81.1 192.168.81.30;
option domain-name-servers ns1.internal.example.org;
option domain-name "internal.example.org";
option routers 192.168.81.1;
default-lease-time 600;
max-lease-time 7200;
next-server 192.168.81.128;
fileneame "pxelinux.0";
}
2、配置tftp:
1)安装软件:yum -y install tftp-server 安装完成后
vim /etc/xinetd.d/tftp
server_args = -s /var/lib/tftpboot 设置默认路径
disable = no 设置默认开启
2)#/etc/init.d/xinetd.d restart
3)查看端口状态:
#vi /etc/services 看端口号
#[[email protected] ~] netstat -antunlp |grep 69
tcp 0 0 :::54969 :::* LISTEN 1076/rpc.statd
udp 0 0 0.0.0.0:69 0.0.0.0:* 3129/xinetd
4)准备安装(复制4个文件到tftpboot目录下,即/var/lib/tftpboot):
cp /usr/share/syslinux/pxelinux.0 -----注意:如果没有pxelinux.0该文件则需要安装yum syslinux
进入光盘cd isolinux/目录下:
#cp isolinux.cfg /var/lib/tftpboot/pxelinux.cfg/default/
#cp vmlinuz /var/lib/tftpboot/
# cp initrd.img /var/lib/tftpboot/
5)编辑参数文件:
进入cd /var/lib/tftpboot/pxelinux.cfg/目录下