Chinaunix首页 | 论坛 | 博客
  • 博客访问: 657591
  • 博文数量: 87
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 2022
  • 用 户 组: 普通用户
  • 注册时间: 2014-04-23 11:16
个人简介

西邮大三狗!!!

文章分类

全部博文(87)

文章存档

2015年(47)

2014年(40)

分类: 服务器与存储

2014-10-12 18:03:09

物理机: 192.168.0.100           rhel6.4 
PXE服务器:192.168.0.204    rhel6.4
iptables selinux 均关闭

服务器安装需要的软件:
yum install tftp-server dhcp -y (还有给你装上xinetd这个超级守护进程)
第一步:配置dhcpd
在/etc/dhcp文件夹下面的配置文件dhcpd.conf是没用的,怎么办?在它里面会有答案!
cd /usr/share/doc/dhcp-4.1.1/   
cp dhcpd.conf.sample /etc/dhcp/dhcpd.conf
vim /etc/dhcp/dhcpd.conf
    折腾后的简单配置:
option domain-name "example.com";
option domain-name-servers 192.168.0.100;
default-lease-time 600;
max-lease-time 7200;
log-facility local7;
subnet 192.168.0.0 netmask 255.255.255.0 {
  range 192.168.0.201 192.168.0.220;
  option routers 192.168.0.100;
  filename "pxelinux.0";
  next-server  192.168.0.204;
}
第二步:配置tftp
由于tftp是由xinetd这个进程管理的,所以我们要开启tftp服务就要去修改/etc/xinetd.d/tftp
将里面的disable=yes  改成no就行了。
cd /var/lib/tftpboot
cp /usr/share/syslinux/pxelinux.0 .(复制pxelinux.0到当前目录)
由于我的物理机架设好了ftp,我现在直接去物理机上下载所需要的文件.

其实就是将镜像文件isolinux这个文件夹里面的东区全部拷到/var/lib/tftpboot目录下面
继续对我们的/var/lib/tftpboot文件里面的东西进行加工
mkdir pxelinux.cfg
cp isolinux.cfg pxelinux.cfg/default
cd pxelinux.cfg
vim default
在最后加上:
label linux
  menu label ^Install RHEL6.4
  menu default
  kernel vmlinuz
  append initrd=initrd.img ks= noipv6  (这台PXE服务器还是Web服务器 哈哈~~)
  关于ks.cfg怎么写的,各有各的设置,有kickstart就可以配置出来,然后保存好.
  没有kickstart的,安装呗! sudo yum install system-config-kickstart -y
  我的ks.cfg
#platform=x86, AMD64, or Intel EM64T
#version=DEVEL
# Firewall configuration
firewall --disabled
# Install OS instead of upgrade
install
# Use network installation
url --url="ftp://192.168.0.100/pub/rhel6.4"
# Root password
rootpw --iscrypted $1$qgJ/gQ0d$KdD3zC4mCfQW9vMfTeM85/
# System authorization information
auth  --useshadow  --passalgo=md5 --enablefingerprint
# Use graphical install
graphical
firstboot --disable
# Use interactive kickstart installation method
interactive
# System keyboard
keyboard us
# System language
lang en_US
# SELinux configuration
selinux --disabled
# Installation logging level
logging --level=info
# Reboot after installation
reboot
# System timezone
timezone --isUtc Africa/Abidjan
# Network information
network  --bootproto=dhcp --device=eth0 --onboot=on
# System bootloader configuration
bootloader --location=mbr
# Clear the Master Boot Record
zerombr
# Partition clearing information
clearpart --all  
# Disk partitioning information
part / --fstype="ext4" --size=3000
part swap --fstype="swap" --size=500
part /boot --fstype="ext4" --size=100

%packages
@base
@chinese-support

%end

最后开启我们的服务  /etc/init.d/dhcpd start 
                              /etc/init.d/xinetd start
chkconfig dhcpd on
chkconfig xinetd on
新建一台测试去咯~~



阅读(3031) | 评论(0) | 转发(2) |
给主人留下些什么吧!~~