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]lhost ~]#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

##############################################################
时间: 2024-08-29 03:50:34

centos7 pxe kickstart的相关文章

RHEL7/CentOS7 pxe+kickstart自动化系统安装

PXE(preboot execute environment,预启动执行环境)是由Intel公司开发的最新技术,工作于Client/Server的网络模式,支持工作站通过网络从远端服务器下载映像,并由此支持通过网络启动操作系统,在启动过程中,终端要求服务器分配IP地址,再用TFTP(trivial file transfer protocol)或MTFTP(multicast trivial file transfer protocol)协议下载一个启动软件包到本机内存中执行,由这个启动软件包

CentOS 6.5下PXE+Kickstart无人值守安装操作系统centos7.3

一.简介 1.1 什么是PXE PXE(Pre-boot Execution Environment,预启动执行环境)是由Intel公司开发的最新技术,工作于Client/Server的网络模式,支持工作站通过网络从远端服务器下载映像,并由此支持通过网络启动操作系统,在启动过程中,终端要求服务器分配IP地址,再用TFTP(trivial file transfer protocol)或MTFTP(multicast trivial file transfer protocol)协议下载一个启动软

pxe+kickstart 无人值守安装CentOS7.1

 CentOS6.6下PXE+Kickstart无人值守安装CentOS7.1操作系统 一.简介 1.1 什么是PXE Pxe(Pre-boot Execution Environment,预启动执行环境)是由Inter公司开发的最新技术,工作与Client/Server的网络模式,支持工作站通过网络从远端服务器下载映像,并由此支持通过 网络启动操作系统,在启动过程中,终端要求服务器分配IP地址,再用TFTP(trivial file transfer protocol)或MTFTP(multi

Centos-7.3配置PXE+kickstart无人值守安装

Centos-7.3配置PXE+KICKSTART自动安装系统 首先查看当前系统版本,如图,当前版本是Centos 7.3.1611 PXE+kickstart服务安装必须要安装的有:Dhcp 提供自动IP分配和指定文件位置的服务Tftp-server xinetd 提供tftpd服务Syslinux 提供pxelinux.0文件Httpd 提供安装包及ks.cfg文件共享的功能,也可以使用vsftpd服务. 环境初始设置:关闭SELINUX#vi /etc/sysconfig/selinuxS

记一次用PXE+kickstart批量为20台新服务器安装centos7

基于PXE+kickstart批量安装centos7: 本文是纯文字,后续会补充图片 1.环境: CentOS Linux release 7.4.1708 (Core)kernel:3.10.0-693.el7.x86_64 2.PXE.kickstart简介 PXE(preboot execute environment,预启动执行环境)是由Intel公司开发的最新技术,工作于Client/Server的网络模式,支持工作站通过网络从远端服务器下载映像,并由此支持通过网络启动操作系统,在启动

PXE+kickstart无人值守安装centos7

PXE+kickstart无人值守安装centos7 1.1 PXE说明 所谓的PXE是Preboot Execution Environment的缩写,字面上的意思是开机前的执行环境. 要达成PXE必须要有两个环节: (1)一个是客户端的网卡必须要支持PXE用户端功能,并且开机时选择从网卡启动,这样系统才会以网卡进入PXE客户端的程序: (2)一个是PXE服务器必须要提供至少含有DHCP以及TFTP的服务! 且其中: ? · DHCP服务必须要能够提供客户端的网络参数,还要告知客户端TFTP所

pxe+kickstart cobbler无人值守装机

环境准备: 一台服务器 [[email protected] tftpboot]# cat /etc/redhat-release CentOS Linux release 7.2.1511 (Core) [[email protected] tftpboot]# uname -a Linux admin 3.10.0-327.el7.x86_64 #1 SMP Thu Nov 19 22:10:57 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux [[email

CentOS 6.6下PXE+Kickstart无人值守安装操作系统

一.简介 1.1 什么是PXE PXE(Pre-boot Execution Environment,预启动执行环境)是由Intel公司开发的最新技术,工作于Client/Server的网络模式,支持工作站通过网络从远端服 务器下载映像,并由此支持通过网络启动操作系统,在启动过程中,终端要求服务器分配IP地址,再用TFTP(trivial file transfer protocol)或MTFTP(multicast trivial file transfer protocol)协议下载一个启动

CentOS 7 PXE+Kickstart+TFTP+VSFTP+BIOS+UEFI

前言 一般情况下,新服务器上架.都需要系统管理员手工安装系统,配置IP地址,然后远程登陆服务器进行软件安装.配置之类的管理.这种方式,在服务器数量还不多的情况下,是正常的.试想,如果一次上架上百台服务器,再依次安装操作系统,将是一种灾难.很难在规定的时间内将服务器顺利上架并配置完毕. 这就需要在大型机房中,以DHCP+DNS模式管理服务器IP地址和主机名.服务器上架前,以其MAC地址为依据,在DHCP中配置主机保留并分配主机名.DHCP结合TFTP提供的PXE服务,提供PXE引导Linux内核和