centos7 pxe kickstart
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了centos7 pxe kickstart相关的知识,希望对你有一定的参考价值。
#kickstart for centos 7.pxe #CentOS Linux release 7.2.1511 (Core) #IP 10.0.7.34 #service dhcp httpd tftp-server #关闭防火墙及selinux [[email protected] ~]#systemctl stop iptables [[email protected] ~]#systemctl stop firewalld [[email protected] ~]#setenforce 0 #安装dhcp [[email protected] ~]#yum install dhcp [[email protected] ~]# cat /etc/dhcp/dhcpd.conf default-lease-time 600; max-lease-time 7200; log-facility local7; subnet 10.0.7.0 netmask 255.255.255.0 { option routers 10.0.7.1; option subnet-mask 255.255.255.0; option time-offset -18000; # Eastern Standard Time range dynamic-bootp 10.0.7.11 10.0.7.29; default-lease-time 21600; max-lease-time 43200; next-server 10.0.7.34; filename "pxelinux.0"; } [[email protected] ~]#yum install tftp-server xinetd -y [[email protected] ~]# cat /etc/xinetd.d/tftp # default: off # description: The tftp server serves files using the trivial file transfer # protocol. The tftp protocol is often used to boot diskless # workstations, download configuration files to network-aware printers, # and to start the installation process for some operating systems. 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 } #下载内核,启动文件;此文件可从安装光盘中查看对应文件。 [[email protected] ~]#cd /var/lib/tftpboot/ [[email protected] ~]#wget http://mirrors.163.com/centos/7/os/x86_64/images/pxeboot/initrd.img [[email protected] ~]#wget http://mirrors.163.com/centos/7/os/x86_64/images/pxeboot/vmlinuz [[email protected] ~]#wget http://mirrors.163.com/centos/7/os/x86_64/isolinux/vesamenu.c32 [[email protected] ~]#wget http://mirrors.163.com/centos/7/os/x86_64/isolinux/boot.msg [[email protected] ~]#mkdir pxelinux.cfg [[email protected] ~]#cat /var/lib/tftpboot/pxelinux.cfg/default default linux prompt 1 timeout 60 display boot.msg label linux kernel vmlinuz append initrd=initrd.img text ks=http://10.0.7.34/ks.cfg [[email protected] ~]#yum install syslinux -y [[email protected] ~]#cp /usr/share/syslinux/pxelinux.0 /var/lib/tftpboot/ #ks.cfg安装文件;此文件可从~/anaconda-ks.cfg复制,并修改 [[email protected] ~]# cat /var/www/html/ks.cfg #version=DEVEL # System authorization information auth --enableshadow --passalgo=sha512 # Install OS instead of upgrade install # Use network installation 此处为ISO地址,一般为内网地址 url --url=http://10.0.1.231/CentOS/7/os/x86_64 # Use graphical install graphical # Run the Setup Agent on first boot firstboot --enable ignoredisk --only-use=sda # Keyboard layouts keyboard --vckeymap=us --xlayouts=‘us‘ # System language lang en_US.UTF-8 --addsupport=zh_CN.UTF-8 # Network information network --bootproto=dhcp --device=em1 --onboot=off --ipv6=auto network --bootproto=dhcp --device=em2 --onboot=off --ipv6=auto network --bootproto=dhcp --device=em3 --onboot=off --ipv6=auto network --bootproto=dhcp --device=em4 --onboot=off --ipv6=auto network --hostname=localhost.localdomain # Root password rootpw --iscrypted $6$XnDH3wP0.n1Tn9YJ$I/my1AH6B.9BxhB6O1cGUjmuTBD9BVKP19R.2nQrU0Q0NjcGB7HP3BTeOLBy3HkJtB8Qh4wEvrOGxShOUyoLc. # System services services --disabled="chronyd" # System timezone timezone Asia/Shanghai --isUtc --nontp # System bootloader configuration bootloader --append=" crashkernel=auto" --location=mbr --boot-drive=sda autopart --type=lvm # Partition clearing information clearpart --all --initlabel --drives=sda %packages @^minimal @core kexec-tools %end %addon com_redhat_kdump --disable --reserve-mb=‘auto‘ %end ##############################################################
本文出自 “运维基础” 博客,请务必保留此出处http://phospherus.blog.51cto.com/7824598/1909894
以上是关于centos7 pxe kickstart的主要内容,如果未能解决你的问题,请参考以下文章
VMware实现PXE+kickstart无人值守安装Centos7系统
VMware实现PXE+kickstart无人值守安装Centos7系统