NFS service multi-protocol Platform Construction

Source: Internet
Author: User

With the continuous development of embedded card Publishing, it is common to add NFS services and ftp protocols to the platform. How can we build such a platform? The following describes the implementation steps in detail.

I. Introduction

Brief Introduction: the non-optical drive server starts with the PXE Nic, obtains the IP address from the dhcp server, downloads the pxelinux.0 file through tftp, and finds the pxelinux. in the configuration file of cfg, find vmlinuz from the configuration file to guide centos to the installation interface, and then select NFS service mode to install the system.

In addition, if you need to install the Kickstart Software Package automatically, this article does not discuss how to install and configure it.

II. Environment Description

Test environment and software used in this article

Server: centos 5.2 dhcp nfs tftp ip: 192.168.1.133 (this IP address only needs to be connected to the Server Nic, No matter what)

Iii. installation and configuration process and basic explanation:

Install the appropriate software: yum-y install dhcp * nfs * tftp *

1. Configure tftp more/etc/xinetd. d/tftp

 
 
  1. # Default: off
  2. # Description: The tftp server serves files using the trivial file transfer \
  3. # Protocol. The tftp protocol is often used to boot diskless \
  4. # Workstations, download configuration files to network-aware printers ,\
  5. # And to start the installation process for some operating systems.
  6. # Trad: liuyu
  7. # Blog: liuyu.blog.51cto.com
  8. # Bbs: www.linuxtone.org
  9. Service tftp
  10. {
  11. Disable = no # The default value is yes to no.
  12. Socket_type = dgram
  13. Protocol = udp
  14. Wait = yes
  15. User = root
  16. Server =/usr/sbin/in. tftpd
  17. Server_args =-u nobody-s/tftpboot # Add nobody for access
  18. Per_source = 11
  19. CPIs = 100 2
  20. Flags = IPv4
  21. }

Restart the xinetd service:/etc/init. d/xinetd restart

Check whether tftp is Enabled: # chkconfig -- list | grep tftp

Tftp: on

2. Configure the nfs service

 
 
  1. Mount/iso/CentOS-5.2-i386-bin-1of6.iso/mnt-o loop # I am mounting the image file, you can mount the optical drive
  2. Echo "/tftpboot * (ro, sync)">/etc/exports
  3. Echo "/mnt * (ro, sync)">/etc/exports # Set the shared directory in this step.
  4. Exportfs-a # Make the configuration take effect
  5. /Etc/init. d/portmap start &/etc/init. d/nfs start # restart the service
  6. Showmount-e localhost # view shared directories
  7. Export list for localhost:
  8. /Mnt *
  9. /Tftpboot *

3. Configure dhcp

Copy my configurations directly

 
 
  1. # More/etc/dhcpd. conf
  2. # DHCP Server Configuration file.
  3. # See/usr/share/doc/dhcp */dhcpd. conf. sample
  4. #
  5. # Trad: liuyu
  6. # Blog: liuyu.blog.51cto.com
  7. # Bbs: www.linuxtone.org
  8. Ddns-update-style interim;
  9. Ignore client-updates;
  10. Allow booting;
  11. Allow bootp;
  12. Subnet 192.168.1.0 netmask 255.255.255.0 {
  13. Option routers 192.168.1.htm;
  14. Option subnet-mask limit 255.0;
  15. Option domain-name-servers 192.168.1.20.; # local IP Address
  16. Option time-offset-18000; # Eastern Standard Time
  17. Range dynamic-bootp 192.168.1.12 192.168.1.254; # IP address to be partitioned
  18. Default-lease-time 21600;
  19. Max-lease-time 43200;
  20. # Group the PXE bootable hosts together
  21. # PXE-specific configuration directives...
  22. Next-server 192.168.1.htm;
  23. Filename "/pxelinux.0"; # Easy to find configuration files
  24. }
  25. /Etc/init. d/dhcpd start service

4. Configure the file Mkdir/tftpboot/pxelinux. cfg required by pxe.

 
 
  1. cp /usr/lib/syslinux/pxelinux.0 /tftpboot/  
  2. cp /mnt/isolinux/vmlinuz /tftpboot/  
  3. cp /mnt/isolinux/initrd.img /tftpboot/  
  4. cp /mnt/isolinux/isolinux.cfg /tftpboot/pxelinux.cfg/default  

Iv. Test

Start the server. Generally, press F12 to start the PXE network. Then, the IP address is automatically obtained and the Boot interface is displayed. Press linux text to enter. Then select NFS to install the system.

5. Detailed description of the configuration file

Descriptions of dhcpd. conf configuration:

Parameters ):

Ddns-update-style configure DHCP-DNS interactive update mode

Default-lease-time specifies the length of the default lease time, in seconds

Max-lease-time specifies the maximum lease time length, in seconds

Hardware specifies the NIC interface type and MAC address

Server-name notifies DHCP Client server name

Get-lease-hostnames flag check the IP address used by the client

The fixed-address ip address is assigned to the client as a fixed address.

Authritative rejects incorrect IP address requirements

Declarations statement ):

Shared-network is used to tell if some sub-networks share the same network.

Subnet describes whether an IP address belongs to this subnet.

Range starting IP address termination IP address range that provides dynamic IP Address Allocation

For host names, refer to special hosts.

Group provides a declaration for a group of parameters.

Whether the allow unknown-clients or deny unknown-client dynamically allocates IP addresses to unknown users

Whether or not allow bootp or deny bootp responds to the activation Query

Whether allow booting or deny booting responds to user queries

The name of the file whose filename starts to start. It is applied to the diskless workstation.

Next-server: sets the host name to be installed on the server from the boot file and applies to diskless workstation.

Option ):

Subnet-mask Sets the subnet mask for the client

Domain-name specifies the DNS name for the client

Domain-name-servers specifies the DNS server IP address for the client

Host-name: Specifies the host name of the client.

Routers sets the default gateway for the client

Broadcast-address: Set the broadcast address for the client.

Ntp-server sets the server IP address for the client's Network Time

Time-offset is the offset time set by the client and Greenwich Mean time, in seconds.

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.