Linux network service comprehensive experiment
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)
(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
Configure srever1 ①Modify the network card ②Restart the
network
card to obtain the IP address
Build a local yum source:
Download the software package:
modify the dhcp configuration file
Configure PC1
PXE automatic installation
download software package
Modify the configuration file and restart the service
vim tftp:
vim /etc/dhcp/dhcpd.conf
prepare PXE boot program
Download package
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
open an empty virtual machine
The following interface appears, wait for the installation to complete, you can
set up the wed server, configure DNS forward analysis,
download the software package,
modify the configuration file,
modify the main configuration file
vim /etc/named.conf
Modify the zone configuration file
vim /etc/named.rfc1912.znoes
Configure the forward zone data file
vim kgc.com.zone
and add the DNS server address in the domain name resolution configuration file of the client
vim /etc/resolv.conf
start service, test
PC1 test
NFS shared directory service
configuration server2
creates a new file, writes content,
empowers, modify the configuration file
vim /etc/exports
configure server1
PC1 view