yum install dhcp* -y 安装dhcp服务
yum install httpd* -y 安装apache服务
2.修改dhcp配置文件
vim /etc/dhcpd.conf
ddns-update-style interim
ignore client-updates
subnet 192.168.1.0 netmask 255.255.255.0 {
# --- default gateway
option routers 192.168.1.1
option subnet-mask 255.255.255.0
option nis-domain "domain.org"
option domain-name "domain.org"
option domain-name-servers 192.168.1.1
option time-offset -18000# Eastern Standard Time
# option ntp-servers 192.168.1.1
# option netbios-name-servers 192.168.1.1
# --- Selects point-to-point node (default is hybrid). Don't change this unless
# -- you understand Netbios very well
# option netbios-node-type 2
range dynamic-bootp 192.168.1.99 192.168.1.123
default-lease-time 21600
max-lease-time 43200
next-server 192.168.1.1
filename "pxelinux.0"
}
3.配置tftp(作用:提供启动代码文件pxelinux.0,提供stage1阶段文件vmlinuz、initrd.img)
vim /etc/xinetd.d/tftp如下:
service tftp
{
socket_type = dgram
protocol= udp
wait= yes
user= root
server = /usr/sbin/in.tftpd
server_args = -s /tftpboot/linux-install/
disable = no
per_source = 11
cps = 100 2
flags = IPv4
}
4.生成引导文件、内核、镜像文件
mkdir /var/www/html/rhel
mount /dev/cdrom /var/www/html/rhel
cp /var/www/html/rhel/isolinux/isolinux.cfg /tftpboot/linux-install/pxelinux.cfg/default
cp /var/www/html/rhel/isolinux/vmlinuz /tftpboot/linux-install/
cp /var/www/html/rhel/isolinux/initrd.img /tftpboot/linux-install/
5.生成ks文件
yum install system-config-kickstart* -y
system-config-kickstart(重要:生成ks文件)
#platform=x86, AMD64, 或 Intel EM64T
# System authorization information
auth --useshadow --enablemd5
key --skip
# System bootloader configuration
bootloader --location=mbr
# Clear the Master Boot Record
zerombr
# Partition clearing information
clearpart --all --initlabel
# Use graphical install
graphical
# Firewall configuration
firewall --disabled
# Run the Setup Agent on first boot
firstboot --disable
# System keyboard
keyboard us
# System language
lang zh_CN
# Installation logging level
logging --level=info
# Use network installation
url --url=http://192.168.1.1/rhel
# Network information
network --bootproto=dhcp --device=eth0 --onboot=on
# Reboot after installation
reboot
#Root password
rootpw --iscrypted $1$3Ku9Ga/s$9HIQwZOp9noXnjXjyRoOR.
# SELinux configuration
selinux --disabled
# System timezone
timezone Asia/Shanghai
# Install OS instead of upgrade
install
# X Window System configuration information
xconfig --defaultdesktop=GNOME --depth=8 --resolution=640x480
# Disk partitioning information
part swap --bytes-per-inode=4096 --fstype="swap" --size=2048
part /boot --bytes-per-inode=4096 --fstype="ext3" --size=200
part / --bytes-per-inode=4096 --fstype="ext3" --grow --size=1
%packages
@gnome-desktop
cp ks.cfg /var/www/html/
6.配置default
vim /tftpboot/linux-install/pxelinux.cfg/default如下:
default ks
prompt 1
timeout 3
label ks
kernel vmlinuz
append ks=http://192.168.1.1/ks.cfg initrd=initrd.img
7.设置装系统的主机为网络启动
service dhcpd restart
service httpd restart
service xinetd restart
下载Ubutu的linux系统,这里小编就不给网址了,大家自己搜索吧注意自己的 *** 作系统是32位还是64位,你要下载对应的版本哦
小编的是32位的,所以自己下载的32位的系统
下载完后,解压到一个空盘里,这里小编是放到了F盘(忍痛把岛国片子删掉了,嘻嘻)
找到,exe文件,打开
6
d出对话框
7
注意选择安装路径,这里小编果断的选择了F盘(为小编辛苦攒下的N个G的岛国片默哀)
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)