Intercommunication between Intranet and Internet in centos

Source: Internet
Author: User

Hello everyone:

The solution to NIC disorder occurs when centos7.0 is cloned in VMware. I have sorted it out for you here, and I have attached a few images for your reference. I will introduce the solution for centos7;


1. After centos 7 is installed, Nic disorder occurs in the virtual opportunities generated by cloning.

This problem was found because the network configuration of centos 7 was caused by the combination of NetworkManager and systemd.

① After installing centos7 and configuring the IP address properly, run nmtui and select Edit connection. Then, delete all connections in the second interface and exit.

After running nmtui, the following interface is displayed:

650) This. width = 650; "src ="/e/u261/themes/default/images/spacer.gif "style =" Background: URL ("/e/u261/lang/ZH-CN/images/localimage.png") No-repeat center; Border: 1px solid # DDD; "alt =" spacer.gif "/>

After "edit a connect" is selected, all existing connections are displayed. "delete" deletes all connections and then exits (quit );

650) This. width = 650; "src ="/e/u261/themes/default/images/spacer.gif "style =" Background: URL ("/e/u261/lang/ZH-CN/images/localimage.png") No-repeat center; Border: 1px solid # DDD; "alt =" spacer.gif "/>

The nmtui here is similar to the setup in the previous version. It provides an interactive interface for editing and setting, which is just the same as operating directly on the command line;

For example, if you edit ens160 and click OK, the system will automatically write your changed content to the ifcfg-ens160 configuration file.

650) This. width = 650; "src ="/e/u261/themes/default/images/spacer.gif "style =" Background: URL ("/e/u261/lang/ZH-CN/images/localimage.png") No-repeat center; Border: 1px solid # DDD; "alt =" spacer.gif "/>

② And then perform the following three steps.

1. systemctl stop NetworkManager # Stop the NetworkManager service process
2. systemctl disable NetworkManager # enable the NetworkManager Process
3. Yum-y erase netwokmanager * # directly Delete the software package related to NetworkManager. (You can execute Step 1 without testing)

The deletion is complete. Just shut down. We recommend that you use init 0 When shutting down, so that the cloned machine can directly press the upper and lower keys on the keyboard to find the previously entered command, saving time;

③ The cloned machine can normally edit the ifcfg-* file. We recommend that you delete the uuid in the file.

Delete unnecessary configurations and keep 6-7 lines.

650) This. width = 650; "src ="/e/u261/themes/default/images/spacer.gif "style =" Background: URL ("/e/u261/lang/ZH-CN/images/localimage.png") No-repeat center; Border: 1px solid # DDD; "alt =" spacer.gif "/>

After editing is complete, restart the NIC. centos7 can be used to restart the NIC:

Systemctl restart Network

Service Network restart

/Etc/init. d/network restart

IFUP/ifdown

Ii. ifconfig installation and nic Configuration

① By default, centos7.0 minimizes the installation of the ifconfig command on the machine, because the related software package is not installed and net-tools needs to be installed;

If you forget it, You can first run Yum to check which package the ifconfig command is in and then install the package;

Before installation, you need to connect to the Internet. If it is not too troublesome, You can manually configure the yum source and install it from the system disk;

650) This. width = 650; "src ="/e/u261/themes/default/images/spacer.gif "style =" Background: URL ("/e/u261/lang/ZH-CN/images/localimage.png") No-repeat center; Border: 1px solid # DDD; "alt =" spacer.gif "/>

② Internal and external network card name reconciliation

Here, the NetworkManager process is not disabled. Add a line of device = xxx to the NIC configuration file, and then adjust the VLAN in the settings according to the Mac;

For example, ens160 corresponds to the Internet, ens192 corresponds to the Intranet, and the Internet can be accessed:

650) This. width = 650; "src ="/e/u261/themes/default/images/spacer.gif "style =" Background: URL ("/e/u261/lang/ZH-CN/images/localimage.png") No-repeat center; Border: 1px solid # DDD; "alt =" spacer.gif "/>

The NIC configuration file is as follows:

650) This. width = 650; "src ="/e/u261/themes/default/images/spacer.gif "style =" Background: URL ("/e/u261/lang/ZH-CN/images/localimage.png") No-repeat center; Border: 1px solid # DDD; "alt =" spacer.gif "/>

Now the IP address in the ifcfg-ens160 file is changed to the Intranet, the IP address in the ifcfg-ens192 file is changed to the Internet, and then the VLAN in the settings;

After the modification, ens192 becomes an Internet and can access the Internet;

650) This. width = 650; "src ="/e/u261/themes/default/images/spacer.gif "style =" Background: URL ("/e/u261/lang/ZH-CN/images/localimage.png") No-repeat center; Border: 1px solid # DDD; "alt =" spacer.gif "/>

650) This. width = 650; "src ="/e/u261/themes/default/images/spacer.gif "style =" Background: URL ("/e/u261/lang/ZH-CN/images/localimage.png") No-repeat center; Border: 1px solid # DDD; "alt =" spacer.gif "/>

The key to the above operations is to add the device line and the VLAN in the VM instance settings. The principle of the redirection is that the Internet VLAN corresponds to the Internet MAC address, and the Intranet VLAN corresponds to the Intranet MAC address-external, internal;

3. In centos6.x, you do not need to restart the machine to call the Intranet and Internet;

In centos6.x, we used to delete 70 files under udev, and then restart the machine to call the Intranet and Internet Nic. In addition, there is another way to modify 70 files without restarting the machine, then, reload the NIC module;

  1. Modify the Network Card Name in file 70. The Modification Principle is external and internal.

650) This. width = 650; "src ="/e/u261/themes/default/images/spacer.gif "width =" 554 "Height =" 203 "style =" Background: URL ("/e/u261/lang/ZH-CN/images/localimage.png") No-repeat center; Border: 1px solid # DDD; "alt =" spacer.gif "/>

  1. Modprobe-RV e1000 # uninstall e1000 Nic Module

  2. Modprobe-V e1000 # reload the e1000 Nic Module

The above is for your reference only. If you find any problems, please submit them at any time. Thank you.

The above is for your reference only. If you find any problems, please submit them at any time. Thank you.


This article from the "JX _ trench Linux" blog, please be sure to keep this http://xujunxian.blog.51cto.com/8614409/1649898

Intercommunication between Intranet and Internet in centos

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.