Linux System dual-card setup

1. First we look at the current parameters of the system card. Can be seen in addition to a loopback adapter "lo" and virtual NIC "virbr0", the only piece of card "ens33".

Linux System dual-card setup

2. Now let's add to it a network card, network card and then look at the parameters, you can see that more than a piece of card "ens36"

Linux System dual-card setup

3. But we go to the profile directory "/ etc / sysconfig / network-scripts /" directory, but did not "ens36" configuration file.

Linux System dual-card setup

4. At this time, we are networking status, "ens36" card has to automatically obtain an IP address, but if we need to give it to manually configure the IP address can not because it does not have the profile, then we need to solve this problem, we first the network model two network cards virtual machine, instead only connected to the host mode to create the need to manually configure the IP address of the experimental environment.

Linux System dual-card setup

5. First, we use vim editor of "ens33" NIC configuration file "/ etc / sysconfig / network-scripts / ifcfg-ens33" to be modified. We will automatically obtain IP address "dhcp" changed to manual "static", and then add the IP address, subnet mask, gateway can be. After the modification is complete restart the network services.

Linux System dual-card setup
Linux System dual-card setup
6. Now we need to edit the "ens36" configuration file, but it did not use the configuration file, so we directly use "cp" command, "- p" option means preserving permits replication. A copy of "ens33" configuration file, named it "ens36" can then be configured.

Linux System dual-card setup

7. We only need to enter in the "ens36" profiles all "ens33" changed to "ens36", then the IP address, subnet mask, gateway, you can modify the settings you need. Notice the two NIC UUID not be the same, we can simply delete it.

Linux System dual-card setup

Linux System dual-card setup

8. We look card parameters, you can see the IP addresses of the two network cards are set success.

Linux System dual-card setup

Guess you like

Origin blog.51cto.com/14449541/2434519