PXE + DHCP + NFS + KICKSTART unattended installation of RHEL6.4

Source: Internet
Author: User
Tags nslookup
Tutorial requirements: the server (192.168.100.250) installs the RHEL6.4 operating system on the client of 192.168.100.0 network segment, and assigns the host name clientx.linuxidc.com to each client 192.168.100.x to achieve unattended installation of the fuse splitter. Recommended reading: LinuxPXE unavailable

Lab requirements:

The server (192.168.100.250) installs the RHEL6.4 operating system on clients in the 192.168.100.0 network segment, and assigns the host name clientx.linuxidc.com to each client 192.168.100.x to implement unattended installation.

----------------------------- Split line -----------------------------

Recommended reading:

Linux PXE unattended installation of PXE-E32: TFTP OPen timeout solution http://www.linuxidc.com/Linux/2014-03/98986.htm

Use PXE with kickstart to automatically install Linux http://www.linuxidc.com/Linux/2014-03/98014.htm

RHCE-certified unattended Linux system (FTP + TFTP + DHCP + Kickstart + PXE) http://www.linuxidc.com/Linux/2013-10/91013.htm

PXE network installation (unattended and unattended installation) http://www.linuxidc.com/Linux/2013-07/87456.htm

----------------------------- Split line -----------------------------


1. Configure YUM

[Root @ PXE-server ~] # Cat/etc/yum. repos. d/rhel-server.repo

[Rhel-server]

Name = Red Hat Enterprise Linux

Baseurl = file: // media

Enabled = 1

Gpgcheck = 0

Gpgkey = file: // etc/pki/rpm-gpg/RPM-GPG-KEY-RedHat-release

[Root @ PXE-server ~] # Mount/dev/cdrom1/media // mount the file on the installation disc

 


Ii. Configure DHCP

[Root @ PXE-server ~] # Yum-y install dhcp

[Root @ PXE-server ~] # Vim/etc/dhcp/dhcpd. conf

Subnet 192.168.100.0 netmask 255.255.255.0 {

Range 192.168.100.100 192.168.100.200; // address segment allocated to the client

Option domain-name-servers 192.168.100.250; // The DNS is also running locally.

Option domain-name "linuxidc.com ";

Option routers 192.168.100.254;

Default-lease-time 600;

Max-lease-time 7200;

Next-server 192.168.100.250; // ip address of the TFTP server

Filename "pxelinux.0"; // Nic boot file name

}

[Root @ PXE-server ~] # Service dhcpd start

[Root @ PXE-server ~] # Chkconfig dhcpd on

 


3. Configure TFTP

1. install the software package

[Root @ PXE-server ~] # Yum-y install tftp-server

[Root @ PXE-server ~] # Vim/etc/xinetd. d/tftp

......

Server_args =-s/var/lib/tftpboot // tftp root directory

Disable = no // enable the tftp service

......

[Root @ PXE-server ~] # Service xinetd restart

[Root @ PXE-server ~] # Chkconfig xinetd on

 


[Root @ PXE-server ~] # Cd/media/images/pxeboot/

[Root @ PXE-server pxeboot] # cp initrd. img vmlinuz/var/lib/tftpboot // copy the Linux kernel and image files on the CD to the tftp root directory

[Root @ PXE-server pxeboot] # yum-y install syslinux

[Root @ PXE-server pxeboot] # cp/usr/share/syslinux/pxelinux.0/var/lib/tftpboot // copy the NIC boot file to the tftp root directory

 


2. Create pxe startup configuration

[Root @ PXE-server pxeboot] # mkdir/var/lib/tftpboot/pxelinux. cfg // create a folder

 


[Root @ PXE-server pxeboot] # cd.../isolinux/

[Root @ PXE-server isolinux] # cp isolinux.

[Root @ PXE-server isolinux] # cp isolinux. cfg/var/lib/tftpboot/pxelinux. cfg/default // copy the sample file in the CD to the tftp root directory and change it to default

 

 

 

4. Configure NFS sharing

[Root @ PXE-server isolinux] # yum-y install nfs-utils rpcbind

[Root @ PXE-server isolinux] # mkdir-p/data/nfs // create an nfs shared directory

[Root @ PXE-server isolinux] # vim/etc/exports

/Data/nfs * (ro)

[Root @ PXE-server isolinux] # cp-rf/media/data/nfs // copy the software package on the CD to the nfs shared directory

 


[Root @ PXE-server isolinux] # service rpcbind start

[Root @ PXE-server isolinux] # service nfs start

[Root @ PXE-server isolinux] # chkconfig rpcbind on

[Root @ PXE-server isolinux] # chkconfig nfs on

 


5. Configure DNS

[Root @ PXE-server isolinux] # yum-y install bind-chroot

[Root @ PXE-server isolinux] # vim/etc/named. conf

......

Listen-on port 53 {192.168.100.250 ;};

......

Allow-query {any ;};

......

Zone "linuxidc.com. zone" IN {// forward resolution

Type master;

File "linuxidc.com. zone ";

};

 


Zone "100.168.192.in-addr. arpa" IN {// reverse resolution

Type master;

File "192.168.100.arpa ";

};

......

[Root @ PXE-server isolinux] # cd/var/named/

[Root @ PXE-server named] # vim linuxidc.com. zone

$ TTL 3 H

@ IN SOAlinuxidc.com. root.linuxidc.com .(

2014041901; serial

1D; refresh

1 H; retry

1 W; expire

3 H); minimum

NSdns.linuxidc.com.

DnsIN A192.168.100.250

$ GENERATE 100-200 client $ in a 192.168.100. $ // use function Parsing

 


[Root @ PXE-server named] # vim 192.168.100.arpa

$ TTL 3 H

@ IN SOAlinuxidc.com. root.linuxidc.com .(

2014041901; serial

1D; refresh

1 H; retry

1 W; expire

3 H); minimum

NSdns.linuxidc.com.

250IN PTRdns.linuxidc.com.

$ GENERATE 100-200 $ in ptr client $ .linuxidc.com.

 


[Root @ PXE-server named] # service named start

[Root @ PXE-server named] # chkconfig named on

 


[Root @ PXE-server named] # nslookup 192.168.100.100 192.168.100.250 // test reverse resolution

[Root @ PXE-server named] # nslookup client181.linuxidc.com // test forward resolution

 


6. Create a kickstart response File

[Root @ PXE-server named] # yum-y install system-config-kickstart

[Root @ PXE-server named] # system-config-kickstart // use a graphical tool to configure the client startup option to generate a response File

[Root @ PXE-server ~] # Cp ks. cfg/data/nfs // deploy to the NFS shared directory

[Root @ PXE-server ~] # Cat ks. cfg // set the client configuration response file as needed

# Platform = x86, AMD64, or Intel EM64T

# Version = DEVEL

# Firewall configuration

Firewall -- disabled

# Install OS instead of upgrade

Install

# Use NFS installation media

Nfs -- server = 192.168.100.250 -- dir =/data/nfs/media // share with NFS

# Root password

Rootpw -- iscrypted $1 $ sW2gH1K6 $ B333cigoFqn3IaAUK2RIj1

# System authorization information

Auth -- useshadow -- passalgo = sha512

# Use text mode install

Text // we recommend that you use text for faster installation.

Firstboot -- disable

# System keyboard

Keyboard us

# System language

Lang en_AU

# SELinux configuration

Selinux -- disabled

# Installation logging level

Logging -- level = info

# Reboot after installation

Reboot

# System timezone

Timezone Asia/Shanghai

# 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 -- initlabel

# Disk partitioning information

Part/boot -- fstype = "ext4" -- size = 200

Part swap -- fstype = "swap" -- size = 2048

Part/-- fstype = "ext4" -- size = 10000

 


% Packages

@ Base

@ Basic-desktop

@ Chinese-support

@ Graphics

@ Technical-writing

@ Tex

@ X11

 


% End

 

 

 

 


[Root @ PXE-server ~] # Vim/var/lib/tftpboot/pxelinux. cfg/default

//

Default linux // start by default

# Prompt 1

Timeout 600

......

Label linux

Menu label ^ Install or upgrade an existing system

Menu default

Kernel vmlinuz

Append ks = nfs: 192.168.100.250:/data/nfs/ks. cfg initrd = initrd. img // Add the ks file location after append

......

7. Client Test

The client motherboard MUST support Nic startup, and the ROM Nic must support PXE Protocol

Set the client host as a NIC to start and start the instance.

For more information about RedHat, see RedHat topic page http://www.linuxidc.com/topicnews.aspx? Tid = 10

This article permanently updates the link address: Http://www.linuxidc.com/Linux/2014-05/101168.htm

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.