标签:kickstart
使用一台CentOS 6/7做DHCP和HTTP服务器
安装dnsmasq, httpd,启用DHCP和HTTP服务
yum -y install httpd dnsmasq
vi /etc/dnsmasq.conf
145行处:dhcp-range=x.x.x.x x.x.x.x, 12h
启动httpd和dnsmasq服务 (暂时禁用iptables)
ss -lntu 查看端口
httpd: tcp 80
dnsmasq: tcp/udp 53, udp 67
mkdir /var/www/http/ks
把ks.cfg文件放到此目录下,内容如下:
#version=DEVEL
# System authorization information
# Install OS instead of upgrade
install
# Use CDROM installation media
cdrom
# Use text mode install
text
# Run the Setup Agent on first boot
firstboot --enable
#ignoredisk --only-use=sda
# Reboot after installation
reboot
# Keyboard layouts
keyboard --vckeymap=us --xlayouts=‘us‘
# System language
lang en_US.UTF-8
# SELinux configuration
selinux --disabled
# Firewall configuration
firewall --enabled --ssh
# Network information
network --bootproto=static --device=eth0 --gateway=192.168.x.x --ip=192.168.x.x --nameserver=192.168.x.x --netmask=255.255.255.0 --noipv6 --activate
network --hostname=test
# System authorization information
auth --enableshadow --passalgo=sha512
# Root password
# on CentOS 6, using grub-crypt --sha-512 to generate rootpw hash value
rootpw --iscrypted $6$ljdvgN7F4JF5CwHd$YUbZ557MRruCaqPSSpunrTG1tEkkPLwRC6N6c8V/VlO/ycw.6g0vq6C/x1mfNlA73Bmlaxwg9BcTl3U5fJwRD/
# System services
services --disabled="chronyd"
# System timezone
timezone Asia/Shanghai --isUtc --nontp
# System bootloader configuration
#bootloader --location=mbr --boot-drive=sda
bootloader --location=mbr
autopart --type=lvm
# Clear the Master Boot Record
zerombr
# Partition clearing information
clearpart --all --initlabel
%packages
@^minimal
@core
wget
telnet
net-tools
%end
%post
sed -i ‘s,quiet,quiet net.ifnames=0,g‘ /etc/default/grub
grub2-mkconfig -o /boot/grub2/grub.cfg > /dev/null 2>&1
sed -i ‘s,UTC,LOCAL,g‘ /etc/adjtime
systemctl disable postfix
%end
%addon com_redhat_kdump --disable --reserve-mb=‘auto‘
%end
安装光盘启动,在Install CentOS 7处按Tab键,插入如下参数:
net.ifnames=0 linux ks=http://webserver-ip/ks/ks.cfg
本文出自 “Ilovecat(个人笔记)” 博客,请务必保留此出处http://hj192837.blog.51cto.com/655995/1790047
使用Kickstart文件安装CentOS 7.2的一种方法
标签:kickstart
原文地址:http://hj192837.blog.51cto.com/655995/1790047