Linux Summary Note 4-NIC configuration and dual NIC bindings __linux

Source: Internet
Author: User
1. Network card basic configuration information
The 1th step: first we want to switch to the "/etc/sysconfig/network-scripts" directory (this directory is stored with the network card configuration file).
Step 2nd: Use the VIM editor to modify the NIC file "ifcfg-eno16777736", write the configuration parameters, and save the exit.
Device Type: type=ethernet
address assignment mode: bootproto=static
network card name: name=eno16777736
boot: onboot=yes
IP Address: I paddr=192.168.100.100
Subnet Mask: netmask=255.255.255.0
gateway address: gateway=192.168.100.1
DNS Address: dns1= 192.168.100.1
Step 3rd: Reboot the network card device and test whether the net is Unicom.
2. NIC Configuration Tool

Nmtui//graphic interface
NMCLI//Long command 3. Configure dual NIC Bindings

Note: Using the network card binding technology can not only improve the bandwidth of the network card transmission rate, but also in one of the network card failure, can still ensure the normal use of the network. In simple terms, suppose we implement binding technology to two network cards, so that in normal work they will be together to transfer data, so that the speed of network transmission faster, but as long as one of the network card suddenly failed, another network card will be in 0.1 seconds automatically replacement to ensure that data transmission will not be interrupted.

Step One: Add two network cards and make sure both cards are in the same network segment.
Step Two: Modify the configuration file of the two network adapters that need to be bound and add the configuration information of a bound NIC.

[Root@linux1 ~]# cat/etc/sysconfig/network-scripts/ifcfg-eno16777728
type=ethernet
BOOTPROTO=none
Onboot=yes
Userctl=no          //whether to allow ordinary users to control this NIC
device=eno16777728
master=bond0
slave=yes
[ Root@linux1 ~]# cat/etc/sysconfig/network-scripts/ifcfg-eno33554968 
type=ethernet
BOOTPROTO=none
Onboot=yes
userctl=no
device=eno33554968
master=bond0
slave=yes
[root@linux1 ~]# CAT/ Etc/sysconfig/network-scripts/ifcfg-bond0 
type=ethernet
bootproto=none
onboot=yes
USERCTL= No
device=bond0
ipaddr=192.168.100.100
prefix=24
nm_controlled=no

The third step: let the kernel support network card binding drive, the common network card binding drive mode has three kinds of--mode0, Mode1 and Mode6.
-Mode0 balance Load mode: Usually two network cards are working, and automatic backup, using switch equipment support.
-Mode1 Automatic backup mode: Usually only one network card work, after the failure automatically replaced with another network card.
-Mode6 balance Load mode: Usually two network cards are working, and automatic backup, no need for switch equipment support.

Create a NIC-bound kernel-driven file that enables the BOND0 network card device to support binding technology (bonding) while defining the NIC as Mode6 balanced load mode and automatically switch time to 100 milliseconds when a failure occurs

[Root@linux1 ~]# vim/etc/modprobe.d/bond.conf 
alias bond0 bonding
options bond0 miimon=100 mode=6

Fourth Step: Restart network services after the NIC binding operation can be successfully successful, under normal circumstances only BOND0 network card will have IP address and other information

[Root@linux1 ~]# systemctl Restart network [root@linux1 ~]#, Ifconfig bond0:flags=5187<up,broadcast,running,master, Multicast> MTU 1500 inet 192.168.100.100 netmask 255.255.255.0 broadcast 192.168.100.255 INET6 FE80:
        : 20c:29ff:fea9:2a59 prefixlen ScopeID 0x20<link> ether 00:0c:29:a9:2a:59 txqueuelen 0 (Ethernet)  Rx Packets 1140 Bytes 85251 (83.2 KiB) Rx Errors 0 dropped overruns 0 frame 0 TX packets 13020 Bytes 805403 (786.5 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 eno16777728:flags=6211<u P,broadcast,running,slave,multicast> MTU 1500 ether 00:0c:29:a9:2a:59 Txqueuelen 1000 (Ethernet) RX Packets 365 bytes 25573 (24.9 KiB) RX errors 0 dropped 4 overruns 0 frame 0 TX packets 6689 Bytes 424 989 (415.0 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 Eno33554968:flags=6211<up,broadcas T,running,slave,multicast>
        MTU 1500 ether 00:0c:29:a9:2a:63 Txqueuelen 1000 (Ethernet) RX packets 775 bytes 59678 (58.2 KiB) RX errors 0 dropped overruns 0 frame 0 TX packets 6331 bytes 380414 (371.4 KiB) TX errors 0 Dro pped 0 Overruns 0 carrier 0 collisions 0

At this point, the dual NIC binding configuration is complete, but when we drop one of the NIC, the network can communicate normally, and may lose a few packets.

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.