Linux host and Virtual machine Bridge making and network card link aggregation

Source: Internet
Author: User

First, Network Bridge production

1, the host Network Bridge production

Remove a host's/ETC/SYSCONFIG/NETWORK-SCRIPTS/IFCFG-ENP0S25

Add files under the/etc/sysconfig/network-scripts/ifcfg-br0 directory

#编辑主机的物理网卡文件vim/etc/sysconfig/network-scripts/ifcfg-enp0s25device=enp0s25bootproto=nonename=westosbridger=br0# Edit a virtual bridge file Vim/etc/sysconfig/network-scripts/ifcfg-br0device=br0onboot=yesbootproto=nonenetmask=255.255.255.0type =bridge# this way your host's bridge is made to communicate with your virtual machine successfully.

Note: After the modification is successful, you need to execute the following command:

Systemctl Stop networkmanager.service #让系统不记住你的网络状态systemctl Restart network #重启网络systemctl start Networkmanager.ser Vice

2, Virtual machine Network bridge production and deletion

Brctl show #查看系统的所有网桥 brctl addr br0 #系统添加一个虚拟网桥 ifconfig br0 172.25.254.231 netmask 255.255.   255.0 #为br0临时添加IP和netmask brtcl addif br0 eth0 #将虚拟网桥与虚拟网卡连接 ifconfig br0 down #将虚拟网桥停止 brctl delbr br0 eth0 #从虚拟网卡上移除虚拟网桥 brctl DELBR br0 #删除虚拟网桥

Second, link aggregation of network card

Link aggregation: Refers to a number of physical ports bundled together to become a logical port to achieve the load sharing of the output/incoming traffic throughput in each member port, the switch determines from which member port the packet is sent to the peer-to-peer switch based on the user-configured port load sharing strategy.

1. Bond interface (supports up to two NICs)

nmcli connection add type bond con-name  bond0 ifname bond0 mode active-backup ip4 172.25.254.231/24# adds an interface to the system, And give him 172.25.254.231 this ip   #在系统的/proc/net/bonding/bond0  can see the information nmcli connection add  type bond-slave con-name eth0 ifname eth1 master bond0# Add a NIC for the link aggregation interface eth0nmcli connection add type bond-slave con-name eth1 ifname  eth1 master bond0# add a NIC to the link aggregation interface eth1, if the eth0 nic is broken, automatically switch to eth1nmcli connection show     #查看系统的网卡ifconfig  eth0 down   #使eth0这块网卡宕掉nmcli   connection  delete eth0   #删除网卡eth0nmcli   connection delete eth1  # Remove the NIC eth0nmcli  connection delete bind0   #删除网卡eth0 

2. Team interface

The team interface and Bond interface is similar, but he has a stronger extensibility, up to 8 network cards, and it has more features, he has 4 functions, respectively, broadcast (broadcast fault tolerance) Roundrobin (balance Wheel) activebackup (main standby) LoadBalance (load Balancing).

NMCLI connection Add type team con-name TEAM0 ifname team0 mode config ' {"runner": {"name": Activebackup}} ' Ip4 172.25.254.2 31/24# add a team interface and give him 172.25.254.231 this interface nmcli connection add type Team-slave con-name eth0 ifname eth1 Master team0# Add a NIC for the link aggregation interface eth0nmcli connection add type Team-slave con-name eth1 ifname eth1 Master team1# add a NIC for the link aggregation interface eth1# Remove the same as the Bond interface.



This article is from the "13122323" blog, please be sure to keep this source http://13132323.blog.51cto.com/13122323/1955799

Linux host and Virtual machine Bridge making and network card link aggregation

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.