A total of 2 servers, respectively, a, B. A dual network card, that is, there is an intranet network. B only intranet environment. A, B's intranet is built through a switch. As for the external network how to build I will not say. The key is to say how the intranet is formed.
If you are unfamiliar with Linux, you may step on a lot of holes if you are unfamiliar with the NIC configuration file. But you might as well be able to set up this intranet. Here are the steps to be said:
1. A, B is connected with the switch with a network cable respectively.
2, A, b network IP is set to the same number segment (for example: a:192.168.1.2 b:192.168.1.3)
Complete the above steps and then ping each other, if it means that your intranet build success (the following content does not have to browse), if not, please continue to look down. First talk about the idea of troubleshooting, with a network cable to a B line, troubleshooting problems, ping each other and then plug into the switch to repeat the above steps must be successful. (hereby declare two points: 1, the computer Internet line no longer distinguishes between straight line and crossover lines (old device computer interconnection can only use crossover line), as long as the network can be normal internet cable can be connected to the computer. 2, multi-card server can be configured multiple gateway, I test success, no problem!!! )。 The following points are included in the search and discharge:
1, network cable. See if the network cable is normal internet access, no disconnection, the crystal head connected to the wrong line of the situation.
2. Locate the NIC configuration file corresponding to the network port, and modify the configuration. What do you mean? Each NIC corresponds to a unique configuration file, which is a unique network cable port. The network cable is plugged into the network cable, then you modify the corresponding configuration file? If the modification is wrong then the net will not be. The following for multi-NIC, in particular, more than 2 network card users, teach you how to identify network cable port on the network card configuration file (have to spit noise, image insertion function is too chicken). Use the Ficonfig command to view network card information, taking CentOS7 as an example:
enp123s0f1:flags=4163 (up,broadcat,running,multicast) MTU 1500
.........
ens9f0:flags=4099 (up,broadcast,multicast) MTU 1500
.......
The above lists only the information for the first line of the NIC. A total of two network cards, the names are: enp123s0f1,ens9f0. The difference between the two is that ENP123S0F1 has a running mark. Has it to show that it corresponds to the network cable port, using this method can be unplugged network cable to find the corresponding network card configuration file. It's OK to find the modification configuration file.
3. Network card configuration file have you changed it correctly? Some people will think, network card configuration is what is difficult, directly modify the IP (the same number segment), Gateway, subnet mask not on the line, directly from the existing configuration file can be changed. I tell you that you may succeed or you may not succeed. Because the information in the NIC configuration file is added, it may cause you to fail. Here is a profile of a success story:
Type=ethernet
Bootprote=static
NAME=ENP7S0F1 (and your network card name to be on)
uuid=46af5d82-9020-4c9f-bc57-eeaf0d39419e
DEVICE=ENP7S0F1 (same as name value)
Onboot=yes
ipaddr=192.168.1.100
gateway=192.168.1.1
netmast=255.255.255.0
The above is my pro-Test successful configuration file. About the configuration item I will not one and everyone introduced, self-search! If your network card does not have a corresponding configuration file under/etc/sysconfig/network-script/, create a new name for the ifcfg-network card name. Just use my configuration above. Another point of emphasis: The configuration file is not more than the better, you do not know the configuration items do not go to Riga, or it is likely to cause the network will not pass. In particular, the Ipv4,ipv6 the beginning of the argument, you do not know the meaning of do not add.
Well, the above are the pits I tread, summary of not comprehensive, but also have a certain reference value, I wish you success!
Linux Server external Network (dual network) construction