Linux system service and Management (services)---------Day Fifth

Source: Internet
Author: User
Tags file transfer protocol

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---->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.????????. #IP地址默认租用时间

? ? Max-lease-time 7200;????????? #IP地址租用最大时间

? ?}


? 3. Service DHCPD

[Email protected]/]# systemctl? Restart? dhcpd

[Email protected]/]# systemctl? 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

?????? 0???????????????????????? 0.0.0.0:*??????????????????? 8051/DHCPD?????

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: A simple File Transfer protocol?? Port: 69?


?????? server-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

? ?......

? Menu title NSD1709 PXE Server!

? ?......

? A. Label Linux

? Menu Label Install RHEL7

? Kernel Vmlinuz

? Append initrd=initrd.img


?? 7. Deploy boot kernels 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

########################################################


? iii. 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

? 62? Menu Label Install RHEL7

? 63? Kernel Vmlinuz

? 64? Append initrd=initrd.img? ks=ftp://192.168.4.7/ks.cfg



#######################################################

Summary

? ? ? ? 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 service and Management (services)---------Day Fifth

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.