1.packags needed
need packages:
system-config-kickstart##自动应答脚本制作工具
syslinux##获得pxelinux.0文件安装包
dhcp##分配ip给客户机的服务
tftp-server##提供tftp协议的服务
httpd##安装源共享服务
2.config file rules
No.1 FIST CONFIG DHCP##配置dhcp配置文件
cp /usr/share/doc/dhcp-4.2.5/dhcpd.conf.example /etc/dhcp/dhcpd.conf
vim /etc/dhcp/dhcpd.conf
config /etc/dhcpd/dhcpd.conf like this:
============================================
删掉:
27 subnet 10.152.187.0 netmask 255.255.255.0 {
28 }
36 行后面所有
修改:
7 option domain-name "westos.com";##域名
8 option domain-name-servers 172.25.254.250;##dns
30 subnet 172.25.254.0 netmask 255.255.255.0 {##网段,子网掩码
31 range 172.25.254.60 172.25.254.160;##地址范围
No.2 SED CONFIG TFTP
systemctl start httpd
systemctl enable httpd
vim /etc/xinetd.d/tftp
config /etc/xinetd.d/tftp like this:
============================================
service tftp
{
socket_type= dgram
protocol= udp
wait= yes
user= root
server= /usr/sbin/in.tftpd
server_args= -s /var/lib/tftpboot
disable= yes--->no
per_source= 11
cps= 100 2
flags= IPv4
No.3 TRD MAKE SOME FILES AND PXEWORKDIRECTORY
在真机中
df
cd /var/www/html/rhel7
ls
cd isolinux
ls
cd /var/lib/tftpboot/
ls
vim /etc/dhcp/dhcpd.conf
subnet 172.25.254.0 netmask 255.255.255.0 {
range 172.25.254.60 172.25.254.160;
option routers 172.25.254.254;
next-server 172.25.254.131;
filename "pxelinux.0";
basic configuration ##基本信息设定
installation method ##安装模式选择
boot loader options ##引导程序选项
partition information ##分区划分策略
authentication ##认证加密方式
firewall configuration ##火墙配置信息
display configuration ##图形界面选择
package selection ##软件包选择
pre-installation ##安装前执行脚本
%packages
@base
========================================================================================
default vesamenu.c32
timeout 600##等待时间
display boot.msg
# Clear the screen when exiting the menu, instead of leaving the menu displayed.
# For vesamenu, this means the graphical background is still displayed without
# the menu itself for as long as the screen remains in graphics mode.
menu clear
menu background splash.png
menu title Red Hat Enterprise Linux 7.0##大标题
menu vshift 8
menu rows 18
menu margin 8
#menu hidden
menu helpmsgrow 15
menu tabmsgrow 13
# Border Area
menu color border * #00000000 #00000000 none
# Selected item
menu color sel 0 #ffffffff #00000000 none
# Title bar
menu color title 0 #ff7ba3d0 #00000000 none
# Press [Tab] message
menu color tabmsg 0 #ff3a6496 #00000000 none
# Unselected menu item
menu color unsel 0 #84b8ffff #00000000 none
# Selected hotkey
menu color hotsel 0 #84b8ffff #00000000 none
# Unselected hotkey
menu color hotkey 0 #ffffffff #00000000 none
# Help text
menu color help 0 #ffffffff #00000000 none
# A scrollbar of some type? Not sure.
menu color scrollbar 0 #ffffffff #ff355594 none
# Timeout msg
menu color timeout 0 #ffffffff #00000000 none
menu color timeout_msg 0 #ffffffff #00000000 none
# Command prompt text
menu color cmdmark 0 #84b8ffff #00000000 none
menu color cmdline 0 #ffffffff #00000000 none
# Do not display the actual menu unless the user presses a key. All that is displayed is a timeout message.
menu tabmsg Press Tab for full configuration options on menu items.
menu separator # insert an empty line
menu separator # insert an empty line
label linux
menu label ^Install Red Hat Enterprise Linux 7.0##小标题
menu default##默认标题设定
kernel vmlinuz
append initrd=initrd.img repo=http://172.25.254.100/soucre ks=http://172.25.254.100/ks.cfg##安装源和ks
label check
menu label Test this ^media & install Red Hat Enterprise Linux 7.0
#menu default
kernel vmlinuz
append initrd=initrd.img inst.stage2=hd:LABEL=RHEL-7.0\x20Server.x86_64 rd.live.check quiet
menu separator # insert an empty line
# utilities submenu
menu begin ^Troubleshooting
menu title Troubleshooting
label vesa
menu indent count 5
menu label Install Red Hat Enterprise Linux 7.0 in ^basic graphics mode
text help
Try this option out if you're having trouble installing
Red Hat Enterprise Linux 7.0.
endtext
kernel vmlinuz
append initrd=initrd.img inst.stage2=hd:LABEL=RHEL-7.0\x20Server.x86_64 xdriver=vesa nomodeset quiet
label rescue
menu indent count 5
menu label ^Rescue a Red Hat Enterprise Linux system
text help
If the system will not boot, this lets you access files
and edit config files to try to get it booting again.
endtext
kernel vmlinuz
append initrd=initrd.img inst.stage2=hd:LABEL=RHEL-7.0\x20Server.x86_64 rescue quiet
label memtest
menu label Run a ^memory test
text help
If your system is having issues, a problem with your
system's memory may be the cause. Use this utility to
see if the memory is working correctly.
endtext
kernel memtest
menu separator # insert an empty line
label local
menu label Boot from ^local drive
localboot 0xffff
menu separator # insert an empty line
menu separator # insert an empty line
label returntomain
menu label Return to ^main menu
menu exit
menu end
need packages:
system-config-kickstart##自动应答脚本制作工具
syslinux##获得pxelinux.0文件安装包
dhcp##分配ip给客户机的服务
tftp-server##提供tftp协议的服务
httpd##安装源共享服务
yum install dhcp httpd tftp-server lftp -y
yum install system-config-kickstart -y
2.config file rules
No.1 FIST CONFIG DHCP##配置dhcp配置文件
cp /usr/share/doc/dhcp-4.2.5/dhcpd.conf.example /etc/dhcp/dhcpd.conf
vim /etc/dhcp/dhcpd.conf
config /etc/dhcpd/dhcpd.conf like this:
============================================
删掉:
27 subnet 10.152.187.0 netmask 255.255.255.0 {
28 }
36 行后面所有
修改:
7 option domain-name "westos.com";##域名
8 option domain-name-servers 172.25.254.250;##dns
30 subnet 172.25.254.0 netmask 255.255.255.0 {##网段,子网掩码
31 range 172.25.254.60 172.25.254.160;##地址范围
32 option routers 172.25.254.254;##网关
systemctl stop firewalld
No.2 SED CONFIG TFTP
systemctl start httpd
systemctl enable httpd
vim /etc/xinetd.d/tftp
config /etc/xinetd.d/tftp like this:
============================================
service tftp
{
socket_type= dgram
protocol= udp
wait= yes
user= root
server= /usr/sbin/in.tftpd
server_args= -s /var/lib/tftpboot
disable= yes--->no
per_source= 11
cps= 100 2
flags= IPv4
}
chkconfig --list
No.3 TRD MAKE SOME FILES AND PXEWORKDIRECTORY
在真机中
df
cd /var/www/html/rhel7
ls
cd isolinux
ls
scp -r * root@172.25.254.131:/var/lib/tftpboot
cd /var/lib/tftpboot/
ls
yum install syslinux-4.05-8.el7.x86_64 -y
vim /etc/dhcp/dhcpd.conf
subnet 172.25.254.0 netmask 255.255.255.0 {
range 172.25.254.60 172.25.254.160;
option routers 172.25.254.254;
next-server 172.25.254.131;
filename "pxelinux.0";
}
systemctl restart dhcpd
basic configuration ##基本信息设定
installation method ##安装模式选择
boot loader options ##引导程序选项
partition information ##分区划分策略
authentication ##认证加密方式
firewall configuration ##火墙配置信息
display configuration ##图形界面选择
package selection ##软件包选择
pre-installation ##安装前执行脚本
post-installation ##安装后执行脚本
%packages
@base
%end
ksvalidator /var/www/html/ks.cfg ##编辑完成后使用 ksvalidator 命令校验正确性
vim /var/lib/tftpboot/pxelinux.cfg/default
========================================================================================
default vesamenu.c32
timeout 600##等待时间
display boot.msg
# Clear the screen when exiting the menu, instead of leaving the menu displayed.
# For vesamenu, this means the graphical background is still displayed without
# the menu itself for as long as the screen remains in graphics mode.
menu clear
menu background splash.png
menu title Red Hat Enterprise Linux 7.0##大标题
menu vshift 8
menu rows 18
menu margin 8
#menu hidden
menu helpmsgrow 15
menu tabmsgrow 13
# Border Area
menu color border * #00000000 #00000000 none
# Selected item
menu color sel 0 #ffffffff #00000000 none
# Title bar
menu color title 0 #ff7ba3d0 #00000000 none
# Press [Tab] message
menu color tabmsg 0 #ff3a6496 #00000000 none
# Unselected menu item
menu color unsel 0 #84b8ffff #00000000 none
# Selected hotkey
menu color hotsel 0 #84b8ffff #00000000 none
# Unselected hotkey
menu color hotkey 0 #ffffffff #00000000 none
# Help text
menu color help 0 #ffffffff #00000000 none
# A scrollbar of some type? Not sure.
menu color scrollbar 0 #ffffffff #ff355594 none
# Timeout msg
menu color timeout 0 #ffffffff #00000000 none
menu color timeout_msg 0 #ffffffff #00000000 none
# Command prompt text
menu color cmdmark 0 #84b8ffff #00000000 none
menu color cmdline 0 #ffffffff #00000000 none
# Do not display the actual menu unless the user presses a key. All that is displayed is a timeout message.
menu tabmsg Press Tab for full configuration options on menu items.
menu separator # insert an empty line
menu separator # insert an empty line
label linux
menu label ^Install Red Hat Enterprise Linux 7.0##小标题
menu default##默认标题设定
kernel vmlinuz
append initrd=initrd.img repo=http://172.25.254.100/soucre ks=http://172.25.254.100/ks.cfg##安装源和ks
label check
menu label Test this ^media & install Red Hat Enterprise Linux 7.0
#menu default
kernel vmlinuz
append initrd=initrd.img inst.stage2=hd:LABEL=RHEL-7.0\x20Server.x86_64 rd.live.check quiet
menu separator # insert an empty line
# utilities submenu
menu begin ^Troubleshooting
menu title Troubleshooting
label vesa
menu indent count 5
menu label Install Red Hat Enterprise Linux 7.0 in ^basic graphics mode
text help
Try this option out if you're having trouble installing
Red Hat Enterprise Linux 7.0.
endtext
kernel vmlinuz
append initrd=initrd.img inst.stage2=hd:LABEL=RHEL-7.0\x20Server.x86_64 xdriver=vesa nomodeset quiet
label rescue
menu indent count 5
menu label ^Rescue a Red Hat Enterprise Linux system
text help
If the system will not boot, this lets you access files
and edit config files to try to get it booting again.
endtext
kernel vmlinuz
append initrd=initrd.img inst.stage2=hd:LABEL=RHEL-7.0\x20Server.x86_64 rescue quiet
label memtest
menu label Run a ^memory test
text help
If your system is having issues, a problem with your
system's memory may be the cause. Use this utility to
see if the memory is working correctly.
endtext
kernel memtest
menu separator # insert an empty line
label local
menu label Boot from ^local drive
localboot 0xffff
menu separator # insert an empty line
menu separator # insert an empty line
label returntomain
menu label Return to ^main menu
menu exit
menu end