环境
系统 centos6.6 无图形界面
ip 192.168.2.1
系统 centos7.2 有图形界面
以下命令在 centos6.6 上执行
1、 yum -y install dhcp* tftp* vsftpd* syslinux #安装一些软件
2、vim dhcpd.conf
- subnet 192.168.2.0 netmask 255.255.255.0 {
- range dynamic-bootp 192.168.2.50 192.168.2.200;
- next-server 192.168.2.1;
- filename "pxelinux.0";
- default-lease-time 600;
- max-lease-time 7200;
- }
3、service dhcpd start
4、find / -name pxelinux* 查找下 pxelinux.0 的所在位置
5、mkdir -v /var/lib/tftpboot/pxelinux.cfg/ #创建使用的目录树
6、cp /usr/share/syslinux/pxelinux.0 /var/lib/tftpboot/
7、mount /dev/cdrom /mnt/ #挂载系统镜像
8、cp -rf /mnt/isolinux/* /var/lib/tftpboot/
9、cp -rf /mnt/* /var/ftp/pub/
10、cp /var/lib/tftpboot/isolinux.cfg /var/lib/tftpboot/pxelinux.cfg/default
11、vim /etc/xinetd.d/tftp
- service tftp
- {
- socket_type = dgram
- protocol = udp
- wait = yes
- user = root
- server = /usr/sbin/in.tftpd
- server_args = -s /var/lib/tftpboot
- disable = no 默认是yes,改成no就好
- per_source = 11
- cps = 100 2
- flags = IPv4
- }
12、chkconfig xinetd on
13、service vsftpd start
14、yum -y install system-config-kickstart
在 centos 7.2 的图形化中的命令行执行
15、ssh -X
16、system-config-kickstart #使用 system-config-kickstart 配置 ks.cfg
- 以下选项必选:
- 基本配置密码 重新引导系统 文本安装
- 安装方法
- ftp
- 分区 清除主引导记录
- 网络配置添加
- 禁用防火墙
以下命令在 centos6.6 上执行
17、cp /root/ks.cfg /var/ftp/pub/
18、vim pxelinux.cfg/default
- label linux
- menu label ^Install or upgrade an existing system
- menu default
- kernel vmlinuz ks=ftp://192.168.2.1/pub/ks.cfg ksdevice=eth0 #如果多块网卡需设置ksdevice,否则可以去掉
- append initrd=initrd.img
19、检查 ftp 和 dhcp 的状态 启动机器测试
注:这个连接写的比我这个详细 http://5323197.blog.51cto.com/5313197/1786744
来源: