歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> 關於Linux >> PXE+TFTP+VSFTP+DHCP+Kickstart無人職守自動安裝RHEL 5

PXE+TFTP+VSFTP+DHCP+Kickstart無人職守自動安裝RHEL 5

日期:2017/3/3 16:16:46   编辑:關於Linux

1、安裝並配置:DHCP服務:

1)yum list |grep dhcp

2)yum install dhcp* -y

3)編輯/etc/dhcpd.conf

√rpm -ql dhcp

√找到dhcpd.conf.example這個文件,復制到/etc下,替換dhcpd.conf

Cp /usr/share/doc/dhcpd.conf.example /etc/dhcpd.conf

√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

filename "pxelinux.0";

next-server 192.168.1.88;

# 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.100 192.168.1.120;

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 00:16:D3:07:68:27;

fixed-address 192.168.1.88;

}

}

***************************************************************************

√chkconfig dhcpd on

√service dhcpd restart

√如果報錯,則查看log日志,cat /var/log/message

2、安裝tftp:

1)安裝完成後會在根目錄產生一個tftpboot文件夾

Chkconfig tftp on

Service xinetd restart

2)復制必要的文件:

Cd /tftpboot

Cp /usr/lib/syslinux/pxelinux.0 /tftpboot

Cp /光盤/image/pxeboot/initrd.img

Cp /光盤/image/pxeboot/vmlinuz

Mkdir /tftpboot/pxelinux.cfg

Cp /光盤/isolinux/isolinux.cfg /tftpboot/pxelinux.cfg/default

3)編輯default文件:

*************************************************************************

default linux

prompt 1

timeout 600

display boot.msg

F1 boot.msg

F2 options.msg

F3 general.msg

F4 param.msg

F5 rescue.msg

label linux

kernel vmlinuz

append initrd=initrd.img linux ks=ftp://192.168.1.88/ks.cfg

label text

kernel vmlinuz

append initrd=initrd.img text

label ks

kernel vmlinuz

append ks initrd=initrd.img

label local

localboot 1

label memtest86

kernel memtest

append -

ftp://192.168.1.88/tftpboot/

*************************************************************

3配置ks.cfg文件:

完成後拷貝到/var/ftp/目錄中,和上面紅字對應。(不要忘記安裝VSFTP服務並配置)

備注:

啟動時如果在第一個界面DCHP 後面的那個-都跳不過去,也就是檢測不到 DHCP服務器就說明DHCP的設置有問題!!

本文出自 “努力學習,天天向上” 博客,請務必保留此出處http://iminmin.blog.51cto.com/689308/163382

 

Copyright © Linux教程網 All Rights Reserved