centos6.5 配置PXE系统

阅读更多
参考 https://linux.cn/article-4902-1.html

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

你可能感兴趣的:(centos6.5 配置PXE系统)