Get the App
SLTechnology News&Howtos  ›  Servers  › 

Configuration of dual Network Card in Linux

Shulou Source: shulou.com Published: 2022-06-02 19:30:25 10月03日 Update

Lab introduction: configure the network cards of two different network segments on the virtual machine linux.

1. Add a new network card

2. After installing the two network cards, connect to the host and use ifconfig to view the information of the two network cards. The dhcp service can automatically configure the IP address for the new network card ens36 under vmnet8, but it cannot automatically obtain the IP address under the host alone.

3. Change the two network cards to host-only mode, and match the two network cards with the addresses of different network segments, which can serve as a proxy server and a firewall.

Configure the Nic information of ens33, and then restart the Nic to take effect.

[root@localhost ~] # vim / etc/sysconfig/network-scripts/ifcfg-ens33 configure the network card information of ens33

[root@localhost ~] # service network restart restart the network card service

3. Because there is no configuration file for another network card ens36 under / etc/sysconfig/network-scripts/, copy a configuration file first, and then modify the configuration information.

[root@localhost network-scripts] # cp-p ifcfg-ens33 ifcfg-ens36 copy configuration file to ens36

[root@localhost ~] # vim / etc/sysconfig/network-scripts/ifcfg-ens33 configure the network card information of ens33

[root@localhost ~] # systemctl restart network restart the network card service

The experiment of double network card configuration with different network segments has been completed.

Tags: Network card configuration information service different two host address file network segment function experiment backward server mode firewall installed proxy fire prevention Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MySQL Shulou Technology vpn OPPO Reno Docker