Linux diskless Workstation Erection instance _unix Linux

Source: Internet
Author: User

Summary
Set up a Linux diskless workstation instance where both the server and the client use Linux. Mainly involved: DHCP TFTP syslinux NFS (2003-03-12-08:52:24)

--------------------------------------------------------------------------------------


The client is a PXE-enabled blade that uses Linux as the server and the server is configured as follows:


1 Install the DHCP server dhcpd


2 Configure/etc/dhcpd.conf file, the following is the file on my machine


max-lease-time-1;
default-lease-time-1; #注: IP Address never expires
Option Subnet-mask 255.0.0.0;
Option routers 10.0.0.1;
Option Domain-name-servers 10.10.10.10;
# option Netbios-name-servers 10.10.10.10;
Option Broadcast-address 10.255.255.255;
# option Dhcp-class-identifier "Pxeclient";
# option Vendor-encapsulated-options 01:04:00:00:00:00:ff;
# option option-135 "Start";

Subnet 10.0.0.0 netmask 255.0.0.0 {
Range 10.10.12.131 10.10.12.150;

Host BLADE01 {
Hardware Ethernet 00:e0:43:00:02:00;
Fixed-address 10.10.12.131;
FileName "/tftpboot/pxelinux.0"; #注: Start image file
}

Host BLADE02 {
Hardware Ethernet 00:e0:43:00:02:02;
Fixed-address 10.10.12.132;
FileName "/tftpboot/pxelinux.0";
}

Host BLADE03 {
Hardware Ethernet 00:e0:43:00:02:04;
Fixed-address 10.10.12.133;
FileName "/tftpboot/pxelinux.0";
}

Host BLADE04 {
Hardware Ethernet 00:e0:43:00:02:06;
Fixed-address 10.10.12.134;
FileName "/tftpboot/pxelinux.0";
}

Host Blade05 {
Hardware Ethernet 00:e0:43:00:02:08;
Fixed-address 10.10.12.135;
FileName "/tftpboot/pxelinux.0";
}
}


Description: The DHCP client obtains the IP address and downloads the start image file from the server with the TFTP protocol. I use Syslinux.

The Pxelinux inside the kit is used as a remote boot Loder.

3) Configure TFTP server

Using the Pxelinux as a boot tool requires a TFTP server that supports tsize parameters. Can be downloaded from http://www.kernel.org/pub/software/network/tftp/.

Using the TFTP service via xinetd, my/etc/xinetd.conf file is as follows


......
Service TFTP
{
Socket_type = Dgram
protocol = UDP
Wait = yes
user = root
Server =/USR/SBIN/IN.TFTPD
}


4) Configure Pxelinux

Install the Syslinux package first. Can be downloaded from http://www.kernel.org/pub/linux/utils/boot/syslinux/.

Copy the pxelinux.0 to the/tftpboot/directory, and then build the/tftpboot/syslinux.cfg/directory. A configuration file is stored in this directory.

Pxelinux uses the hexadecimal representation of an IP address as the filename of the configuration file for that IP address. such as Blade01 's

The IP address is 10.10.12.131, the configuration file name is 0a0a0c83, and the content is:


Default Linux

Label Linux
Kernel Vmlinuz
Append ip=dhcp root=/dev/nfsroot nfsroot=10.10.11.120:/remote/blade01 vga=normal


5) Configuring NFS

Create a root directory for each blade, which is specified in the blade's pxelinux configuration file to boot from this NFS export directory.

The root directory should be built with standard catalogs, as well as the USR, home, and public directories that need to be reinstalled.

My/etc/exports file:


#/etc/exports:the access Control list to filesystems which may exported
# to NFS clients. Exports (5).

/remote/blade01 blade01 (Rw,async,no_root_squash)
/remote/blade02 Blade02 (Rw,async,no_root_squash)
/remote/blade03 blade03 (Rw,async,no_root_squash)
/remote/blade04 blade04 (Rw,async,no_root_squash)
/remote/blade05 blade05 (Rw,async,no_root_squash)
/remote/root * (Rw,async,no_root_squash)
/remote/home * (Rw,async,no_root_squash)
/usr * (ro,async,no_root_squash)
/sbin * (Ro,async,no_root_squash)
/bin * (Ro,async,no_root_squash)
/lib * (Ro,async,no_root_squash)
/home * (Ro,async,no_root_squash)


6 modify its/etc/fstab file for each blade, take blade01 as an example, and its NFS root is/REMOTE/BLADE01
/remote/blade01/etc/fstab files are as follows:
#/etc/fstab:static File System information.
#
#
10.10.11.120:/remote/blade01/nfs DEFAULTS,INTR 0 1
10.10.11.120:/remote/root/root NFS Defaults,intr 0 1
10.10.11.120:/remote/home/home NFS Defaults,intr 0 1
10.10.11.120:/bin/bin NFS Defaults,intr 0 1
10.10.11.120:/USR/USR NFS Defaults,intr 0 1
10.10.11.120:/sbin/sbin NFS Defaults,intr 0 1
10.10.11.120:/lib/lib NFS Defaults,intr 0 1
NONE/PROC proc DEFAULTS,INTR 0 1


Also for each blade to modify its network profile, configure IP address, start two network cards and so on.

7) Compiling the kernel

The blade core should support kernel level Auto configuration DHCP protocol, support NFS, support NFS ROOT,

Let's say the compiled kernel is vmlinuz and copy it to the/tftpboot/directory.

Reference Documentation:

http://syslinux.zytor.com/pxe.php
http://syslinux.zytor.com/faq.php
http://www.cn-cio.org/xx/show.php?article_id=1680
Http://www-900.ibm.com/developerWorks/cn/linux/l-tip-prompt/l-pex/index.shtml

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.