u盘安装linux kickstart,使用Kickstart文件安装CentOS 7.2的一种方法

使用一台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

总结

如果觉得编程之家网站内容还不错,欢迎将编程之家网站推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值