Network configuration based on Linux system and installation of YUM commands and software

Source: Internet
Author: User

1. Related concepts 1.1 connection-oriented TCP protocol (transmission Control Protocol, transmission protocol)

?? TCP (transmission Control Protocol, transmission Protocol) is a connection-based protocol, which means that a reliable connection must be established with each other before the data is formally sent and received. A TCP connection must go through three "dialogs" to be established, the process of which is very complex, the simple process of three conversations: Host A sends a connection request packet to Host B: "I want to send you data, OK?" "This is the first conversation; Host B sends a consent connection to host A and requires synchronization (synchronization is the two host one in the send, one in the receiving, coordination work) packet:" Can, when do you send? " "This is the second conversation; Host a then sends a packet to confirm that Host B's requirements are synchronized:" I'll send it now, you go on! " ", this is the third dialogue. Three times the purpose of the "conversation" is to synchronize the sending and receiving of packets, and after three "conversations", host a formally sends the data to Host B. The TCP protocol can provide a reliable communication connection for the application, so that the byte stream emitted by one computer is sent to other computers on the network without error, and the data communication system with high reliability requirements often uses the TCP protocol.

1.2 For non-connected UDP protocol UDP (user data Protocol, Subscriber Datagram Protocol)

?? UDP (User data Protocol, Subscriber Datagram Protocol) is the protocol that corresponds to TCP. It is a non-connected protocol that does not establish a connection with the other, but sends the packet over directly! UDP is suitable for applications where only a small amount of data is transmitted at a time, and the reliability requirements are low. For example, we often use the "ping" command to test the TCP/IP communication between the two hosts is normal, in fact, the principle of "ping" command is to send ICMP packets to the other host, and then the other host to confirm the receipt of the packet, if the packet arrives timely feedback back, then the network is through. For example, in the default state, a "ping" operation sends 4 packets (). As you can see, the number of packets sent is 4 packets, and the received is also 4 packets (because the other host receives a confirmation of the received packet back). This fully illustrates that the UDP protocol is for a non-connected protocol, and there is no process for establishing a connection. Because the UDP protocol is not connected, its communication efficiency is high, but because of this, its reliability is not as high as the TCP protocol. QQ uses UDP to send messages, so there are times when messages are not received.

1.3NAT (Network Address translation)

?? The English full name of NAT is "network address translation", which is an IETF standard that allows a whole organization to appear on the internet with a public IP address. As the name implies, it is a technology that translates an internal private network address into a legitimate network IP address.
?? Source Address Translation:: SAT
?? Destination Address translation: DAT

1.4 Routers

?? Role: Mainly used to do network address translation.

1.5 Gateways

?? IP on the same network segment as the host on the router.

2. Set the gateway and Query Gateway 2.1 to open the firewall


?? Masquerade:yes flag address masquerading function on, real host becomes router

2.2 Disguise the real machine as a router

2.3 Managing profiles (operating in virtual machines)

2.3.1 Configuration file Parameters
?? Naming rules for network configuration files:? ifcfg-xxxx
?? Device name:? Device=ens3
?? How the device works:? Bootproto=none (the device works with Dhcp,static,none)
?? When the network service is turned on, the NIC is activated automatically:? Onboot=yes
?? Virtual machine IP address:? ipaddr=172.25.254.120
?? Subnet mask:? Prefix=24 or netmask=255.255.255.0 (one can be present)

2.3.2 Editing a configuration file
?? Network configuration directory:?/etc/sysconfig/network-scripts/
?? Delete the original profile ifcfg-ens3 before configuring it:

?? Re-create the configuration file and open:?

?? Edit:

?? To view the contents of a configuration file:

2.4 Query Gateway

2.5 Resetting the network


The network that is added, the gateway is consistent with the IP of the real machine.
After the completion of the above operation, the virtual machine can be online, you can ping other sites on the virtual machine IP, if you can ping, then the success of the network.

The above operation is address access, if you need name access to edit the Hosts file or set up DNS
Open the Hosts file:

Bind domain name and IP address:

Check if the bound domain name can be ping, and if you can ping it, the binding is successful.

or add DNS:

After adding DNS, you can access the domain name directly without binding the domain name and IP:

Network configuration based on Linux system and installation of YUM commands and software

Related Article

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.