centos6.5 配置PXE系统

参考[url]https://linux.cn/article-4902-1.html[/url]

yum install -y vsftpd syslinux dnsmasq


============================dnsmasq======================================================
mv /etc/dnsmasq.conf /etc/dnsmasq.conf.backup
mkdir -p /var/tftpboot


# DHCP range-leases
dhcp-range=192.168.112.3,192.168.112.253,255.255.255.0,12h

# PXE
dhcp-boot=pxelinux.0

# Gateway
dhcp-option=3,192.168.112.2
enable-tftp
tftp-root=/var/tftpboot

cp -r /usr/share/syslinux/* /var/tftpboot
mkdir /var/tftpboot/pxelinux.cfg
touch /var/tftpboot/pxelinux.cfg/default

mkdir /var/tftpboot/centos6
mkdir /mnt/images
mount -o loop /home/CentOS-6.5-x86_64-bin-DVD1.iso /mnt/centos
cp /mnt/centos/images/pxeboot/vmlinuz /var/tftpboot/centos6
cp /mnt/centos/images/pxeboot/initrd.img /var/tftpboot/centos7

chmod -R 755 /var/tftpboot/

mkdir /var/ftp/pub/centos6.5x64
cp -rv /mnt/centos/* /var/ftp/pub/centos6.5x64/



关闭selinux
setenforce 0

# netstat -tulpn
# firewall-cmd --add-service=ftp --permanent ## Port 21
# firewall-cmd --add-service=dns --permanent ## Port 53
# firewall-cmd --add-service=dhcp --permanent ## Port 67
# firewall-cmd --add-port=69/udp --permanent ## Port for TFTP
# firewall-cmd --add-port=4011/udp --permanent ## Port for ProxyDHCP
# firewall-cmd --reload ## Apply rules



# systemctl start dnsmasq
# systemctl status dnsmasq
# systemctl start vsftpd
# systemctl status vsftpd
# systemctl enable dnsmasq
# systemctl enable vsftpd


kickstart文件 使用下面的工具生成
yum install -y system-config-kickstart

改IP
/etc/dnsmasq.conf
/var/tftpboot/pxelinux.cfg/default
/var/ftp/pub/centos6.5x64/centos6-ks.cfg

#/var/tftpboot/pxelinux.cfg/default
default menu.c32
prompt 0
timeout 300
ONTIMEOUT local

menu title ########## PXE Boot Menu ##########

label 1
menu label ^1) Install CentOS 6 x64 with Local Repo
kernel centos6/vmlinuz
#append initrd=centos6/initrd.img method=ftp://192.168.112.11/pub/centos6.5x64 devfs=nomount
append ks=ftp://192.168.112.11/pub/centos6.5x64/centos6-ks.cfg initrd=centos6/initrd.img devfs=nomount

label 2
menu label ^2) Install CentOS 6 x64 with Local Repo using VNC password vnc123
kernel centos6/vmlinuz
append initrd=centos6/initrd.img method=ftp://192.168.112.11/pub/centos6.5x64 devfs=nomount inst.vnc inst.vncpassword=vnc123

label 3
menu label ^3) Install CentOS 7 x64 with Local Repo
menu default
kernel centos7/vmlinuz
#append initrd=centos7/initrd.img method=ftp://192.168.112.11/pub/centos7x64 devfs=nomount
append ks=ftp://192.168.112.11/pub/centos7x64/centos7-ks.cfg initrd=centos7/initrd.img devfs=nomount

label 4
menu label ^4) Install CentOS 7 x64 with Local Repo using VNC password vnc123
kernel centos7/vmlinuz
append initrd=centos7/initrd.img method=ftp://192.168.112.11/pub/centos7x64 devfs=nomount inst.vnc inst.vncpassword=vnc123

label 5
menu label ^5) Boot from local drive

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值