Linux network service comprehensive experiment (DHCP, PXE automatic deployment operating system, DNS forward analysis, NFS shared directory service)

1. Experiment preparation

  • Prepare 3 virtual machines

①PC1: Windows virtual machine, win7 or win10 (windows 10 × 64)

②server1: As a Linux server, the IP address is 172.16.100.100/24 ​​(centos 7-2)

③server2: an empty virtual machine (centos 7-9)
Insert picture description here

(Virtual machine network usageHost mode only

2. Experimental requirements

  • Server1 provides DHCP service to assign IP addresses of corresponding network segments to PC1 and server2.
  • server1 provides PXE service, which enables server2 to automatically install Centos7 Linux operating system.
  • Install and start the httpd service on server1 to provide external web services, and build a DNS service to resolve the address www.kgc.com, so that PC1 can use the domain name www.kgc.com to access the web server.
  • Install NFS service on server2, provide shared directory /share, create file index.html in /share directory, and customize file content. Mount the /share directory of server2 to the /var/www/html directory of server1 through NFS, so that PC1 can display customized content when accessing the Web service.

Three, the experimental process

Configure DHCP to
modify the virtual network editor
Insert picture description here

Insert picture description here
Insert picture description here
Configure srever1 ①Modify the network card ②Restart the
network
Insert picture description here
Insert picture description here
card to obtain the IP address
Insert picture description here

Insert picture description here
Build a local yum source:
Insert picture description here

Download the software package:
Insert picture description here
Insert picture description here
modify the dhcp configuration file
Insert picture description here

Configure PC1
Insert picture description here
Insert picture description here
Insert picture description here
Insert picture description here
Insert picture description here
PXE automatic installation
download software package

Insert picture description here
Modify the configuration file and restart the service
Insert picture description here
vim tftp:
Insert picture description here

Insert picture description here

vim /etc/dhcp/dhcpd.conf
Insert picture description here
prepare PXE boot program

Insert picture description here
Insert picture description here
Download package

Insert picture description here
Insert picture description here
Insert picture description here
vim /var/lib/tftpboot/pxelinux.cfg/default

default auto
prompt 0

label auto
kernel vmlinuz
append initrd=initrd.img method=ftp://172.16.100.100/centos7

label linux text
kernel vmlinuz
append text initrd=initrd.img method=ftp://172.16.100.100/centos7

label linux rescue
kernel vmlinuz
append rescue initrd=initrd.img method=ftp://172.16.100.100/centos7

Restart various services and
Insert picture description here
open an empty virtual machine
Insert picture description here

The following interface appears, wait for the installation to complete, you can
Insert picture description here
set up the wed server, configure DNS forward analysis,
download the software package,
Insert picture description here
Insert picture description here
modify the configuration file,
Insert picture description here
modify the main configuration file
vim /etc/named.conf
Insert picture description here

Modify the zone configuration file
vim /etc/named.rfc1912.znoes
Insert picture description here

Configure the forward zone data file
Insert picture description here
vim kgc.com.zone
Insert picture description here
and add the DNS server address in the domain name resolution configuration file of the client

vim /etc/resolv.conf
Insert picture description here
start service, test
Insert picture description here
PC1 test

Insert picture description here
NFS shared directory service
configuration server2
Insert picture description here
creates a new file, writes content,
Insert picture description here
empowers, modify the configuration file
Insert picture description here
vim /etc/exports
Insert picture description here
configure server1
Insert picture description here

PC1 view
Insert picture description here

Guess you like

Origin blog.csdn.net/weixin_51613313/article/details/111177380