Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to configure network card service for server in RHEL7 system

2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly explains "how to configure the network card service in the server in the RHEL7 system". The content in the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn how to configure the network card service in the RHEL7 system.

1. Create a network session

RHEL and CentOS systems use NetworkManager to provide network services by default, which is a daemon that dynamically manages network configuration and keeps network devices connected. You can use the nmcli command to manage the Network Manager service. Nmcli is a command line-based network configuration tool with rich functions and many parameters.

2. Bind two network cards

Step 1: add another network card device to the virtual machine system, make sure that the two network cards are in the same network connection (that is, the network card mode is the same) before the network card devices in the same mode can be bound, otherwise the two network cards cannot transmit data to each other.

Step 2: use the Vim text editor to configure the binding parameters of the network card device. The theoretical knowledge of Nic binding is similar to the RAID hard disk group we learned earlier. We need to "initially set" the Nic devices that participate in the binding one by one. It should be noted that these originally independent network card devices need to be configured as a "slave" network card to serve the "master" network card, and should no longer have their own IP address and other information. After the initial setup, they can support Nic binding.

Ps: you also need to name the bound device bond0 and fill in the IP address and other information, so that when the user accesses the corresponding service, the two network card devices are actually providing the service together.

[root@linuxprobe ~] # vim / etc/sysconfig/network-scripts/ifcfg-eno16777736

TYPE=Ethernet

BOOTPROTO=none

>

USERCTL=no

DEVICE=eno16777736

MASTER=bond0

SLAVE=yes

[root@linuxprobe ~] # vim / etc/sysconfig/network-scripts/ifcfg-eno33554968

TYPE=Ethernet

BOOTPROTO=none

>

USERCTL=no

DEVICE=eno33554968

MASTER=bond0

SLAVE=yes

You also need to name the bound device bond0 and fill in the IP address and other information, so that when the user accesses the corresponding service, it is the two network card devices that provide the service together.

[root@linuxprobe ~] # vim / etc/sysconfig/network-scripts/ifcfg-bond0

TYPE=Ethernet

BOOTPROTO=none

>

USERCTL=no

DEVICE=bond0

IPADDR=192.168.10.10

PREFIX=24

DNS=192.168.10.1

NM_CONTROLLED=no

Step 3: let the Linux kernel support the network card binding driver. There are three common modes of Nic binding drivers-mode0, mode1 and mode6.

Mode0 (load balancing mode): usually both NICs work and are automatically backed up, but port aggregation is required on the switch devices connected to the server's local Nic to support binding technology.

Mode1 (automatic backup mode): usually only one network card works, and when it fails, it is automatically replaced with another network card.

Mode6 (load balancing mode): usually two network cards work, and automatic backup, no switch equipment to provide auxiliary support.

[root@linuxprobe ~] # vim / etc/modprobe.d/bond.conf

Alias bond0 bonding

Options bond0 miimon=100 mode=6

Step 4: after restarting the network service, the Nic binding operation will be successful. Normally, only bond0 network card devices have IP address and other information.

[root@linuxprobe ~] # systemctl restart network

[root@linuxprobe ~] # ifconfig

Thank you for reading, the above is the content of "how to configure the network card service in the server in the RHEL7 system". After the study of this article, I believe you have a deeper understanding of how to configure the network card service on the server in the RHEL7 system, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report