Troubleshoot CentOS7 IP configuration and network problems, and centos7 ip configuration

Source: Internet
Author: User
Tags dedicated server network troubleshooting

Troubleshoot CentOS7 IP configuration and network problems, and centos7 ip configuration
Note content: CentOS7 configuration IP address and network troubleshooting Note Date: 2017.8.1 CentOS7 configuration IP Address: Because the CentOS operating system we installed is installed with minimal, therefore, there is no graphical interface or some software or plug-ins. If the IP address is not configured, We need to manually configure the IP address, and then use the remote terminal to connect to the operating system through this IP address. It is easier to operate on the terminal than on a virtual machine. Because in a virtual machine, you cannot copy and paste it with the mouse or use the scroll bar to slide the interface up and down. For example, if you want to use a web site to download something, it is impossible to start or end the web site a little bit from the beginning to the end, even if someone is willing to do so, the efficiency is too low. If you are using a remote terminal, you can install the remote terminal software on our Windows operating system, and copy and paste the Windows text, URL, and command to the remote terminal, in addition, some remote terminal software can be used to facilitate system operations. The same is true for work. Generally, servers with Linux operating systems are stored in dedicated server rooms. We cannot move our desks to server rooms to use these systems. At this time, we also need to use a remote terminal to connect to the server's operating system, so we need to configure the operating system IP address, remotely connect to our operating system through the IP address for related operations. The CentOS network adapter we have installed is in NAT mode. No matter where your physical machine is, as long as your physical machine can access the Internet, the operating system in the virtual machine can access the Internet. Unless you are using something like a campus network that limits the NAT network, you can't do it. Dhclient automatically obtains the IP address. After obtaining an IP address, dhclient uses the ip addr command to check whether the obtained IP address is successful. For details about the IP address of the virtual machine system, see: the IP address we just obtained is automatically obtained and may change after the operating system is restarted. We need to connect through a remote terminal, so the IP address cannot always change. We need to set it to a static IP address to avoid system restart changes. Therefore, we need to modify the configuration file. 1. run the following command to enter the NIC configuration file directory. You can use the tap key to complete the command: cd/etc/sysconfig/network-scripts/2. use the ls command to list the files under the Directory and find the NIC configuration file, the file name starts with ifcfg followed by your Nic name, and then use vi to edit the file: vi ifcfg-eno16777736 to change to the following example: 3. after modifying the configuration file, use systemctl restart network. service Command to restart the network service: at this time, you can use ifconfig to view the configured IP address, but the minimum installation of CentOS7 is likely to have no ifconfig command, in this case, we need to download the net-tools Package to configure this configuration ifconfig command: 1. run the yum provides ifconfig command to check which package provides the ifconfig command, and then you can see that the net-tools Package provides the ifconfig package: 2. then run the command to install ne. T-tools Package, run the command: yum install net-tools. After the installation is complete: if you cannot access the Internet after the configuration, you can change some network adapters. Try changing the NAT mode to the bridging mode. If the bridging mode does not work, switch back to the NAT mode and enter the virtual network editor, remove the original network and add a new network. Then, use dhclient-r to end the previous process, and then use dhclient to obtain an IP address. Then, modify the configuration file as before: another way to configure IP addresses (without the ifconfig command): 1. enter the NIC configuration file directory: cd/etc/sysconfig/network-scripts/2. run the ls command to list the directories and edit the file: vi ifcfg-eno ***** find ONBOOT = no, change it to ONBOOT = yes, and save and exit: 3. then run the Command service network restart to restart the NIC service: 4. run the ip addr command to check whether the ip address is assigned: 5. run the yum provides ifconfig command to check which package provides the ifconfig command. Then, we can see that the net-tools Package provides the ifconfig package: 6. run the following command to install the net-tools Package: yum install Net-tools. Installation completed: Successful:

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.