centos6.5 配置PXE系统

wqx 2017-08-25

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

yuminstall-yvsftpdsyslinuxdnsmasq

============================dnsmasq======================================================

mv/etc/dnsmasq.conf/etc/dnsmasq.conf.backup

mkdir-p/var/tftpboot

#DHCPrange-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-oloop/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-R755/var/tftpboot/

mkdir/var/ftp/pub/centos6.5x64

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

关闭selinux

setenforce0

#netstat-tulpn

#firewall-cmd--add-service=ftp--permanent##Port21

#firewall-cmd--add-service=dns--permanent##Port53

#firewall-cmd--add-service=dhcp--permanent##Port67

#firewall-cmd--add-port=69/udp--permanent##PortforTFTP

#firewall-cmd--add-port=4011/udp--permanent##PortforProxyDHCP

#firewall-cmd--reload##Applyrules

#systemctlstartdnsmasq

#systemctlstatusdnsmasq

#systemctlstartvsftpd

#systemctlstatusvsftpd

#systemctlenablednsmasq

#systemctlenablevsftpd

kickstart文件使用下面的工具生成

yuminstall-ysystem-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

相关推荐