Bridge, bonding, and team of networks in Linux

Source: Internet
Author: User

Bridge: enables the real machine and the virtual Machine network card to exchange data directly , the speed is fast

NAT: The virtual machine forwards the data to the real machine, the real machine transmits through the network card, the speed is slow


In the real machine in the/etc/sysconfig/network-scripts/directory to view the file (Note: Ifcfg-br0 is the bridge settings file, IFCFG-ENP0S25 is the network card file settings, in order to prevent future networks can not boot, the first to remove the two files)

Vim/etc/sysconfig/network-scripts/ifcfg-br0 (bridge file Type=bridge)

Vim/etc/sysconfig/network-scripts/ifcfg-enp0s25

Bridge=br0--------Connect the bridge br0 file

At this time to ping 172.25.254.220 (virtual machine) is a pass, indicating that the bridge construction is not a problem.


View the bridge at this time through Brctl show

Setting in a virtual machine

Clear all network settings via Nm-connection-editor


Ifconfig----View network settings

Brctl addr Br0---------Add a bridge br0

Ifconfig br0 172.25.254.220 netmask 255.255.255.0-------------Add IP address to the bridge,

By viewing Brctl show
When the network Bridge is built and not add a network card, so at this time the network ping does not pass

Brctl addif br0 eth0------Add the Eth0 network card to the Br0 bridge, you can ping the network at this time.

Brctl Show viewing the bridge information at this time can find interfaces corresponding network card eth0

Remove Eht0 network interface and bridge BR0

BOND--- link aggregation, maximum value support 2 block NIC that binds two NICs to a channel, increasing bandwidth or redundancy depending on the mode

First, two NICs are ready.

NMCLI connection Add con-name BOND0 ifname bond0 type bond mode active-backup IP4 172.25.254.220/24 add bo ND type BOND0 and set the IP address. At this time all network card information is stored under/PROC/NET/BONDING/BOND0

Watch-n 1 cat/proc/net/bonding/bond0------Monitor the network card operation under BOND0

NMCLI connection Add con-name eth0 ifname eth0 type-slave master bond0--------add eth0 nic to Bond0

At the same time, add eth1 nic to Bond0

By looking at the fifth line of the monitoring page, you can find that the Eth0 network card is working, and successfully pingt

In order to simulate the network card bad situation, the execution of the ifconfig eth0 down command so that eth0 stop working, now view currently Active slave is eth1 at work, in this project ping command do not stop, you will find that the ping command will not be affected by Effect.

TEAM--- bind multiple NICs together to become a team, support up to 8 Block Nic

NMCLI connection Add con-name team0 type TEAM ifname team0 connfig ' {"Runner": {"name": "Activebackup"}} '----- -Add a Team0

NMCLI connection Add con-name eth0 ifname eth0 type Team-slave master team0------add eth0 nic to Team0

Add the eth1 nic to the TEAM0 by the way. Ping successful

Ifconfig eth0 down-------------destroy the Eth0 network card, the eth1 will continue to work, Ping will still not error.


Destroy two network card, the nature will not use,





Bridge, bonding, and team of networks in Linux

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.