使用Kickstart檔案安裝CentOS 7.2的一種方法

來源:互聯網
上載者:User

標籤: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的一種方法

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.