Virtual Machine A
1. Set the firewall state to trusted
2.SELinux currently modified to permissive
3.SELinux permanent status modified to permissive
4. Clear the Yum cache to check if Yum is available
Virtual Machine B
1. Set the firewall state to trusted
2.SELinux currently modified to permissive
3.SELinux permanent status modified to permissive
4. Clear the Yum cache to check if Yum is available
/etc/selinux/config (Permanent status profile)
########################################################
Complete Virtual Machine Access extranet
1. In the real machine implementation, bridge equipment creation (BR0)
[[email protected]/]# systemctl status NetworkManager (graphic)
[[email protected]/]# systemctl Status Network (command line)
[[email protected]/]# systemctl stop NetworkManager (graphic)
[[email protected]/]# systemctl Status Network (command line)
Vim/etc/sysconfig/network-scripts/ifcfg-br0
Device=br0 #设备名
Type=bridge #设备类型
Bootproto=none #手工配置IP地址
Onboot=yes #开机自起动
ipaddr=172.40.50.114
netmask=255.255.255.0
gateway=172.40.50.1
2. Let the real machine ENP2S0 Real network card, connect br0, append write
Vim/etc/sysconfig/network-scripts/ifcfg-enp2s0
Bridge=br0
3. Re-start the network
4. Virtual machine has a network card, select Br0 Bridge equipment
######################################################
Deploying a DHCP server
? Dynamic Host Configuration Protocol
– Dynamic Host Configuration Protocol, by the IETF (Internet network engineer
Organization, to simplify the management of host address allocation
? The main distribution of the following network parameters
– IP address/subnet mask/broadcast address
– Default gateway address, DNS server address
? Four sessions assigned by DHCP address
–discovery-and offer-REQUEST-->ack
If the virtual machine does not bridge the real network
Virtual Machine A:
1. Install the package DHCP
2. configuration file/etc/dhcp/dhcpd.conf
[Email protected]/]# vim/etc/dhcp/dhcpd.conf
: R/usr/share/doc/dhcp*/dhcpd.conf.example #读入其他文件
Subnet 192.168.4.0 netmask 255.255.255.0 {#分配的网段
Range 192.168.4.100 192.168.4.200; #分配的IP地址范围
Option Domain-name-servers 8.8.8.8; #分配DNS
Option routers 192.168.4.254; #分配网关
Default-lease-time 600; #IP地址默认租用时间
Max-lease-time 7200; #IP地址租用最大时间
}
3. Service DHCPD
[Email protected]/]# systemctl restart DHCPD
[Email protected]/]# Systemctl enable DHCPD
#####################################################
On virtual machine A:
Kill DNSMASQ,DNSMASQ in KVM virtualization will provide DHCP service, there will be conflicts
[[email protected]/]# netstat-anptu | grep:67
udp 0 0 0.0.0.0:67 0.0.0.0:* 8051/dhcpd
udp 0 0 0.0.0.0:67 0.0.0.0:* 2392/DNSMASQ
[[ Email protected]/]# killall dnsmasq
[[email protected]/]# netstat-anptu | grep:67
########################################################
? Pxe,pre-boot Execution Environment
– Pre-boot execution environment, run before operating system
– can be used for remote installation
? Working mode
–PXE client integrated in the boot chip of the NIC
– When the computer boots, the PXE client is transferred from the NIC chip into the memory
To get the PXE server configuration, display the menu, according to the user selected
Download the remote boot program to your computer to run
#######################################################
PXE Network installed server
I. Building a DHCP service
1. Specify the address of the next server IP
[Email protected]/]# vim/etc/dhcp/dhcpd.conf
Subnet 192.168.4.0 netmask 255.255.255.0 {
Range 192.168.4.100 192.168.4.200;
Option Domain-name-servers 8.8.8.8;
Option routers 192.168.4.254;
Default-lease-time 600;
Max-lease-time 7200;
Next-server 192.168.4.7; #指定下一个服务器IP地址
FileName "pxelinux.0"; #指定网卡引导文件, file name
}
2. Restart DHCPD Service
pxelinux.0 (network card boot file): Installation manual, binary file
By installing a software, you can generate pxelinux.0
#####################################################
Second, build TFTP service
TFTP: Simple File Transfer Protocol port: 69
Service-side program: Tftp-server
Service Name: TFTP
Default share path:/var/lib/tftpboot
1. Installing Tftp-server
2. Start the TFTP service and set it to boot from
3. Deploying the pxelinux.0 File
# YUM provides */pxelinux.0 #查询仓库中哪一个包产生该文件
# yum-y Install Syslinux
# RPM-QL Syslinux #查询软件包, Installation checklist
# RPM-QL Syslinux | grep pxelinux.0
# cp/usr/share/syslinux/pxelinux.0/var/lib/tftpboot/
# ls/var/lib/tftpboot/
########################################################
pxelinux.0-------"/var/lib/tftpboot/pxelinux.cfg/default
4. Deploy default Menu file
# mkdir/var/lib/tftpboot/pxelinux.cfg
# mount/dev/cdrom/mnt/
# Cp/mnt/isolinux/isolinux.cfg/var/lib/tftpboot/pxelinux.cfg/default
# ls-l/var/lib/tftpboot/pxelinux.cfg/default
# chmod 644/var/lib/tftpboot/pxelinux.cfg/default
# ls-l/var/lib/tftpboot/pxelinux.cfg/default
5. Module VESAMENU.C32 for deploying graphics
# ls/mnt/isolinux/
# cp/mnt/isolinux/vesamenu.c32/var/lib/tftpboot/
# ls/var/lib/tftpboot/
6. Modify the menu file/var/lib/tftpboot/pxelinux.cfg/default
# Vim/var/lib/tftpboot/pxelinux.cfg/default
......
One menu title NSD1709 PXE Server!
......
The label Linux
RHEL7 Menu Label Install
Kernel Vmlinuz
Append initrd=initrd.img
7. Deploy the boot kernel and drivers
#cp/mnt/isolinux/initrd.img/mnt/isolinux/vmlinuz/var/lib/tftpboot/
# ls/var/lib/tftpboot/
Initrd.img pxelinux.cfg Vmlinuz
pxelinux.0 VESAMENU.C32
########################################################
pxelinux.0-------"/var/lib/tftpboot/pxelinux.cfg/default
Default------"VESAMENU.C32-----" vmlinuz, initrd.img
########################################################
Three, FTP service, transmission RPM package
1. Build vsftpd service, share all contents of CD
2. Installing the VSFTPD Software
3. Set the VSFTPD service to start, set to boot from
4. Share all the contents of the disc
[Email protected]/]# MKDIR/VAR/FTP/RHEL7
[Email protected]/]# MOUNT/DEV/CDROM/VAR/FTP/RHEL7
[Email protected]/]# LS/VAR/FTP/RHEL7
[email protected]/]# Firefox FTP://192.168.4.7/RHEL7
##################################################
Iv. unattended installation, generating an answer file
1. Graphics generate answer File program: System-config-kickstart
2. Run the graphics program: System-config-kickstart
Read the local Yum warehouse information, require the Yum warehouse client configuration file, the warehouse is identified as
[Development]
3. Run the graphics program: System-config-kickstart
[Email protected]/]# ls/root/ks.cfg
[Email protected]/]# vim/root/ks.cfg
4. Build vsftpd service, share answer file
[Email protected]/]# cp/root/ks.cfg/var/ftp/
[Email protected]/]# ls/var/ftp/
####################################################
V. Specify the ks.cfg answer file via the menu
[Email protected]/]# Vim/var/lib/tftpboot/pxelinux.cfg/default
The label Linux
RHEL7 Menu Label Install
Kernel Vmlinuz
Append initrd=initrd.img ks=ftp://192.168.4.7/ks.cfg
#######################################################
Summarize:
DHCP------>IP Address, next-server, filename
TFTP------>pxelinux.0, default
Default---->VESAMENU.C32, Vmlinuz, initrd.img, ks.cfg
KS.CFG----> url= "FTP://192.168.4.7/RHEL7"
####################################################
Linux System Learning 16th Day-<< Engineer Technology >>