yum install -y tftp* xinetd "*dhcp*" nfs-utils-*node
配置DHCP服務器的配置文件linux
[root@localhost tftpboot]# vi /etc/dhcpd.conf ios
# DHCP Server Configuration file.服務器
# see /usr/share/doc/dhcp*/dhcpd.conf.sampleapp
# see 'man 5 dhcpd.conf'less
ddns-update-style interim;dom
ignore client-updates;socket
filename "/pxelinux.0";ide
next-server 10.240.240.210;this
allow booting;
allow bootp;
subnet 10.240.240.0 netmask 255.255.255.0 {
# --- default gateway
option routers 10.240.240.1;
option subnet-mask 255.255.255.0;
option nis-domain "jiayuan.com";
option domain-name "jiayuan.com";
option domain-name-servers 10.240.210.98;
option time-offset -18000; # Eastern Standard Time
# option ntp-servers 10.240.210.98;
# option netbios-name-servers 10.240.210.98;
# --- 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 10.240.240.220 10.240.240.240;
default-lease-time 21600;
max-lease-time 43200;
# we want the nameserver to appear at a fixed address
host ns {
next-server marvin.redhat.com;
hardware ethernet 12:34:56:78:AB:CD;
fixed-address 207.175.42.254;
}
}
配置tftp服務器的配置文件
[root@localhost tftpboot]# vi /etc/xinetd.d/tftp
# default: off
# description: The tftp server serves files using the trivial file transfer \
# protocol. The tftp protocol is often used to boot diskless \
# workstations, download configuration files to network-aware printers, \
# and to start the installation process for some operating systems.
service tftp
{
socket_type = dgram
protocol = udp
wait = yes
user = root
server = /usr/sbin/in.tftpd
server_args = -u nobody -s /tftpboot #指定目錄
disable = no #將yes改成no
per_source = 11
cps = 100 2
flags = IPv4
}
配置NFS服務器,添加共享目錄
[root@localhost ~]# vi /etc/exports
/mnt/cdrom *(ro,sync)
/tftpboot *(ro,sync)
安裝syslinux包
yum install -y syslinux
syslinux包安裝完後會在/usr/share/syslinux/
先 cp -r /usr/share/syslinux/ /usr/lib/
新建一個/mnt/cdrom目錄,把鏡像的iso文件掛載到/mnt/cdrom下
若是沒有/tftpboot/目錄先創建一個
mkdir /tftpboot/
cp /usr/lib/syslinux/pxelinux.0 /tftpboot/
cp /mnt/cdrom/p_w_picpaths/pxeboot/{initrd.img,vmlinuz} /tftpboot/
cp /mnt/cdrom/isolinux/*.msg /tftpboot
配置default文件
mkdir /tftpboot/pxelinux.cfg
touch /tftpboot/pxelinux.cfg/default
vi /tftpboot/pxelinux.cfg/default
default linux
prompt 1
timeout 600
display boot.msg
label linux
kernel vmlinuz
append initrd=initrd.img nofb text ks=nfs:10.240.240.210:/tftpboot/ks.cfg
label text
kernel vmlinuz
append initrdinitrd=initrd.img text
label ks
kernel vmlinuz
append ks initrdinitrd=initrd.img
label local
localboot 1
label memtest86
kernel memtest
append -
kicstart的配置文件能夠經過圖形界面獲取安裝信息
(1)、yum install system-config-kickstart* #安裝kickstart圖形管理界面
(2)、安裝x server功能的Xming組件結合CRT使用執行下面的命令就會出現圖形界面
system-config-kickstart
把/tftpboot/ 目錄的權限修改成最大
chmod 777 /tftpboot/ -R
關閉防火牆並啓動相關的服務
一、關閉防火牆
service iptables stop
二、關閉selinux (關閉後重啓機器)
vi /etc/selinux/config
SELINUX=disabled
三、啓動服務
service dhcpd start
service xinetd start
service rpcbind start
service nfslock start
service nfs start
四、把上面的服務寫到啓動項
vi /etc/rc.local
service iptables stop
service dhcpd start
service xinetd start
service rpcbind start
service nfslock start
service nfs start