Centos 7.x 双网卡绑定
<h2>1. 前言</h2><p>关于双网卡绑定,前前后后踩过不少的坑,虽然这是 RHCE 中的一道题,但是在实践中碰到问题也够喝一壶的。</p>
<p>在实践中,虚拟机、物理机都做过,但是不尽相同,大部分的坑也集中在这里,本文长期更新关于网卡绑定中遇到的问题及处理方法。</p>
<p>现在的服务器默认都配备 4 张 千兆网卡,在生产环境中,无论遇到多大的困难,都必须做到双网卡绑定(至少要实现主备模式),最基本的主备这是基本原则。因此在前期的规划,网络设备(交换机)是必须要考虑到的。</p>
<p> </p>
<h2>2. 概念</h2>
<p>概念性的东西的最容易遗忘的,这里得反复强调:</p>
<p>链路聚合最常见的三种模式:</p>
<ul>
<li>mode0(平衡负载模式):两张网卡同时均衡工作,且自动备援,但是需要在与服务器本地网卡相连的交换机设备上进行端口聚合来支持绑定技术。</li>
<li>mode1(自动备援模式):1张网卡工作,在工作网卡故障时,第二张网卡替换故障网卡,单纯的主备模式。</li>
<li>mode6(平衡负载模式):两张网卡均衡工作,且自动备援,无需交换机设备提供辅助支持。</li>
</ul>
<p>以上三种模式,最推荐的当然是 mode6 技能负载均衡又能主备切换,最最重要的是不用浪费时间去联系网络工程师。记住上面三种常见模式就够用了。</p>
<p> </p>
<h2>3. 实践</h2>
<p> </p>
<h3>3.1 虚拟机网卡绑定</h3>
<p>环境介绍:</p>
<p>虚拟化软件:VMware® Workstation 15 Pro</p>
<p>虚拟机操作系统:CentOS Linux release 7.7.1908 (Core)</p>
<p><img src="https://img2020.cnblogs.com/blog/828019/202005/828019-20200521144601638-1679190978.png" alt=""></p>
<p> </p>
<p> </p>
<p> </p>
<p>在 Centos 7 中有两种技术来实现网卡绑定:teaming 和 bonding ,下面通过三种方式来实现网卡绑定:</p>
<h4>3.1.1 手动配置,使用 bond 技术</h4>
<p>查看物理网卡及连接状态</p>
<div class="cnblogs_Highlighter">
<pre class="brush:bash;gutter:true;"><span style="background-color: rgba(0, 255, 0, 1)">#nmcli dev</span>
DEVICETYPE STATE CONNECTION
eth0 ethernetconnectedSystem eth0
eth1 ethernetconnectedWired connection 1
eth2 ethernetconnectedWired connection 2
lo loopbackunmanaged--
<span style="background-color: rgba(0, 255, 0, 1)">#nmcli con</span>
NAME UUID TYPE DEVICE
System eth0 078df8ff-b848-4c23-b212-3213a74bc5d5etherneteth0
Wired connection 124d053c5-d908-3e0d-9e61-4d92efcd6f3betherneteth1
Wired connection 2b4cea59c-59ea-3b6c-a343-e2578ede5034etherneteth2
</pre>
</div>
<p>通过上面的命令得知:该主机有3张网卡,1张本地回环lo 且 三张物理网卡都处于连接中,查看网卡配置文件:</p>
<div class="cnblogs_Highlighter">
<pre class="brush:bash;gutter:true;"><span style="background-color: rgba(0, 255, 0, 1)">#ll/etc/sysconfig/network-scripts/ifcfg-*</span>
-rw-r--r--1 root root 259 Mar 30 19:21 /etc/sysconfig/network-scripts/ifcfg-eth0
-rw-r--r--. 1 root root 254 Mar 292019 /etc/sysconfig/network-scripts/ifcfg-lo
</pre>
</div>
<p>查看配置网卡配置文件却只有 eth0 的, eth1 和 eth2 没有。这里可以通过新建连接来生成配置文件,比自己手动编写方便太多了,建议使用。</p>
<p>首先通过连接名 ‘Wired connection 1’ ‘Wired connection 2’ 删除连接</p>
<div class="cnblogs_Highlighter">
<pre class="brush:bash;gutter:true;"><span style="background-color: rgba(0, 255, 0, 1)">#nmcli con</span>
NAME UUID TYPE DEVICE
System eth0 078df8ff-b848-4c23-b212-3213a74bc5d5etherneteth0
Wired connection 124d053c5-d908-3e0d-9e61-4d92efcd6f3betherneteth1
Wired connection 2b4cea59c-59ea-3b6c-a343-e2578ede5034etherneteth2
<span style="background-color: rgba(0, 255, 0, 1)">#nmcli con del 'Wired connection 1' 'Wired connection 2'</span>
Connection 'Wired connection 1' (24d053c5-d908-3e0d-9e61-4d92efcd6f3b) successfully deleted.
Connection 'Wired connection 2' (b4cea59c-59ea-3b6c-a343-e2578ede5034) successfully deleted.
<span style="background-color: rgba(0, 255, 0, 1)">#nmcli con</span>
NAME UUID TYPE DEVICE
System eth0078df8ff-b848-4c23-b212-3213a74bc5d5etherneteth0
</pre>
</div>
<p>然后在通过物理网卡 eth1 和 eth2 重建连接</p>
<div class="cnblogs_Highlighter">
<pre class="brush:bash;gutter:true;"><span style="background-color: rgba(0, 255, 0, 1)">#nmcli con</span>
NAME UUID TYPE DEVICE
System eth0078df8ff-b848-4c23-b212-3213a74bc5d5etherneteth0
<span style="background-color: rgba(0, 255, 0, 1)">#nmcli con add type ethernet ifname eth1 con-name eth1</span>
Connection 'eth1' (8c47d2f2-1373-425e-b6e2-fa5e6b9eb8f6) successfully added.
<span style="background-color: rgba(0, 255, 0, 1)">#nmcli con add type ethernet ifname eth2 con-name eth2</span>
Connection 'eth2' (5d8dc9b0-3b4f-4c6d-919b-a7754d86b1f8) successfully added.
<span style="background-color: rgba(0, 255, 0, 1)">#nmcli con</span>
NAME UUID TYPE DEVICE
System eth0078df8ff-b848-4c23-b212-3213a74bc5d5etherneteth0
eth1 8c47d2f2-1373-425e-b6e2-fa5e6b9eb8f6etherneteth1
eth2 5d8dc9b0-3b4f-4c6d-919b-a7754d86b1f8etherneteth2
<span style="background-color: rgba(0, 255, 0, 1)">#ll /etc/sysconfig/network-scripts/ifcfg-*</span>
-rw-r--r--1 root root 259 Mar 30 19:21 /etc/sysconfig/network-scripts/ifcfg-eth0
-rw-r--r--1 root root 278 May 21 22:58 /etc/sysconfig/network-scripts/ifcfg-eth1
-rw-r--r--1 root root 278 May 21 22:58 /etc/sysconfig/network-scripts/ifcfg-eth2
-rw-r--r--. 1 root root 254 Mar 292019 /etc/sysconfig/network-scripts/ifcfg-lo
</pre>
</div>
<p> </p>
<p>新建网卡连接命令:</p>
<div class="cnblogs_Highlighter">
<pre class="brush:bash;gutter:true;">nmcli con add type ethernet ifname eth2 con-name eth2
</pre>
</div>
<p>ifname : 物理网卡名,通过 nmcli dev 查看</p>
<p>con-name:网卡配置文件名,逻辑网卡名</p>
<p> </p>
<p>通过上面的配置已得到三张网卡的配置文件,接下来进行配置文件的修改实现网卡绑定</p>
<div class="cnblogs_Highlighter">
<pre class="brush:bash;gutter:true;">----------------------eth1----------------------
<span style="background-color: rgba(0, 255, 0, 1)">#vim ifcfg-eth1</span>
TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
<span style="background-color: rgba(255, 255, 153, 1)">BOOTPROTO=none</span>
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
NAME=eth1
UUID=8c47d2f2-1373-425e-b6e2-fa5e6b9eb8f6
DEVICE=eth1
ONBOOT=yes
<span style="background-color: rgba(255, 255, 153, 1)">MASTER=bond6
SLAVE=yes</span>
----------------------eth2----------------------
<span style="background-color: rgba(0, 255, 0, 1)">#vim ifcfg-eth2</span>
TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
<span style="background-color: rgba(255, 255, 153, 1)">BOOTPROTO=none</span>
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
NAME=eth2
UUID=5d8dc9b0-3b4f-4c6d-919b-a7754d86b1f8
DEVICE=eth2
ONBOOT=yes
<span style="background-color: rgba(255, 255, 153, 1)">MASTER=bond6
SLAVE=yes
</span></pre>
</div>
<p>修改及添加的部分用黄(和谐)色标注,新增 ifcfg-bond6 配置文件如下:</p>
<div class="cnblogs_Highlighter">
<pre class="brush:bash;gutter:true;"><span style="background-color: rgba(0, 255, 0, 1)">#vim ifcfg-bond6</span>
TYPE=Bond
BOOTPROTO=none
DEVICE=bond6
ONBOOT=yes
IPADDR=192.168.1.100
NETMASK=255.255.255.0
GATEWAY=192.168.1.1
DNS1=114.114.114.114
BONDING_OPTS='miimon=100 mode=6 fail_over_mac=1'
</pre>
</div>
<p> </p>
<p>这里需要特别注意的地方:BONDING_OPTS='miimon=100 mode=6 fail_over_mac=1' ,<span style="color: rgba(255, 0, 0, 1)">如果是虚拟机,<span style="background-color: rgba(204, 255, 255, 1)">fail_over_mac=1</span> 是必须要带上的,否则vmware会出现告警信息,配置起来能正常用,但是在进行准备切换时,是无法进行的。切记!</span></p>
<p> <img src="https://img2020.cnblogs.com/blog/828019/202005/828019-20200521151017695-1134497623.png" alt=""></p>
<p>vmware 出现这样的提示基本可以确定 fail_over_mac 没有生效,所配置的网卡也无法做到故障切换。</p>
<p><strong><span style="font-size: 16px">注意:在vmware 虚拟机环境中,常用的三种方式(mode-0 mode-1 mode-6) 只有 mode 1 实现了故障切换。</span></strong></p>
<p>mode 1 - ifcfg-bond6 配置如下:</p>
<div class="cnblogs_Highlighter">
<pre class="brush:bash;gutter:true;"><span style="background-color: rgba(0, 255, 0, 1)">#vim ifcfg-bond6</span>
TYPE=Bond
BOOTPROTO=none
DEVICE=bond6
ONBOOT=yes
IPADDR=192.168.1.100
NETMASK=255.255.255.0
GATEWAY=192.168.1.1
DNS1=114.114.114.114
BONDING_OPTS="miimon=100 <span style="background-color: rgba(255, 255, 0, 1)">mode=1</span> fail_over_mac=1"
</pre>
</div>
<p>bond 配置文件中可以通过 mode = 模式号 来进行切换,这里修改为 mode-1 模式,查看配置信息:</p>
<div class="cnblogs_Highlighter">
<pre class="brush:bash;gutter:true;"><span style="background-color: rgba(0, 255, 0, 1)">#cat /proc/net/bonding/bond6</span>
Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011)
<span style="color: rgba(255, 102, 0, 1)">Bonding Mode: fault-tolerance (active-backup) (fail_over_mac active)</span>
Primary Slave: None
<span style="color: rgba(255, 102, 0, 1)">Currently Active Slave: eth1</span>
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 0
Down Delay (ms): 0
Slave Interface: eth1
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 00:0c:29:f4:f4:0f
Slave queue ID: 0
Slave Interface: eth2
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 00:0c:29:f4:f4:19
Slave queue ID: 0
</pre>
</div>
<div class="cnblogs_Highlighter">
<pre class="brush:bash;gutter:true;"><span style="background-color: rgba(0, 255, 0, 1)">#ethtool bond6</span>
Settings for bond6:
Supported ports: [ ]
Supported link modes: Not reported
Supported pause frame use: No
Supports auto-negotiation: No
Supported FEC modes: Not reported
Advertised link modes:Not reported
Advertised pause frame use: No
Advertised auto-negotiation: No
Advertised FEC modes: Not reported
Speed: 1000Mb/s
Duplex: Full
Port: Other
PHYAD: 0
Transceiver: internal
Auto-negotiation: off
Link detected: yes
</pre>
</div>
<p> </p>
<p>可以看到橙色部分:</p>
<pre class="brush:bash;gutter:true;"><span style="color: rgba(255, 102, 0, 1)">Bonding Mode: fault-tolerance (active-backup) (fail_over_mac active)</span> 说明这里 fail_over_mac 生效了。</pre>
<pre class="brush:bash;gutter:true;"><span style="color: rgba(255, 102, 0, 1)">Currently Active Slave: eth1 <span style="color: rgba(0, 0, 0, 1)">当前活动的网卡是第一张网卡,也就是当第一张网卡 down,就会切换到 eth2</span></span></pre>
<p>进行网卡故障切换,虚拟机可以通过 ifdown / ifup 来实现</p>
<p><img src="https://img2020.cnblogs.com/blog/828019/202005/828019-20200521153209843-112710073.png" alt=""></p>
<p> </p>
<p> </p>
<p> </p>
<h4>3.1.2 通过 nmcli 命令实现网卡绑定,使用技术:bonding</h4>
<p>网卡信息及连接状态如下:</p>
<div class="cnblogs_Highlighter">
<pre class="brush:bash;gutter:true;"><span style="background-color: rgba(0, 255, 0, 1)">#nmcli dev</span>
DEVICETYPE STATE CONNECTION
eth0 ethernetconnected System eth0
eth1 ethernetdisconnected--
eth2 ethernetdisconnected--
lo loopbackunmanaged --
<span style="background-color: rgba(0, 255, 0, 1)">#nmcli con</span>
NAME UUID TYPE DEVICE
System eth0078df8ff-b848-4c23-b212-3213a74bc5d5etherneteth0
</pre>
</div>
<p>目前只有 eth0 网卡连接网络</p>
<p>通过nmcli 创建 bond1</p>
<div class="cnblogs_Highlighter">
<pre class="brush:bash;gutter:true;"><span style="background-color: rgba(0, 255, 0, 1)">#nmcli con add type bond ifname bond1 con-name bond1 mode 1 ipv4.method manual ipv4.address 192.168.1.100/24 ipv4.gateway 192.168.1.1 ipv4.dns 114.114.114.114</span>
Connection 'bond1' (f922008c-75b1-4f5e-a27d-d3e054acde0d) successfully added.
<span style="background-color: rgba(0, 255, 0, 1)">#nmcli con add type bond-slave ifname eth1 con-name bond1-port1 master bond1</span>
Connection 'bond1-port1' (06489850-82d7-4827-bb16-13d5abb84c58) successfully added.
<span style="background-color: rgba(0, 255, 0, 1)">#nmcli con add type bond-slave ifname eth2 con-name bond1-port2 master bond1</span>
Connection 'bond1-port2' (80f43a85-32cc-4302-b0f1-8cb87e9e3e17) successfully added.
<span style="background-color: rgba(0, 255, 0, 1)">#ll /etc/sysconfig/network-scripts/ifcfg-*</span>
-rw-r--r--1 root root 399 May 21 23:50 /etc/sysconfig/network-scripts/ifcfg-bond1
-rw-r--r--1 root root 119 May 21 23:50 /etc/sysconfig/network-scripts/ifcfg-bond1-port1
-rw-r--r--1 root root 119 May 21 23:50 /etc/sysconfig/network-scripts/ifcfg-bond1-port2
-rw-r--r--1 root root 259 Mar 30 19:21 /etc/sysconfig/network-scripts/ifcfg-eth0
-rw-r--r--. 1 root root 254 Mar 292019 /etc/sysconfig/network-scripts/ifcfg-lo
<span style="background-color: rgba(0, 255, 0, 1)">#nmcli con</span>
NAME UUID TYPE DEVICE
System eth0078df8ff-b848-4c23-b212-3213a74bc5d5etherneteth0
bond1 f922008c-75b1-4f5e-a27d-d3e054acde0dbond bond1
bond1-port280f43a85-32cc-4302-b0f1-8cb87e9e3e17etherneteth2
bond1-port106489850-82d7-4827-bb16-13d5abb84c58ethernet--
</pre>
</div>
<p>创建 bond1 并将 两张物理网卡添加到 bond1 , 查看配置文件已经生成。</p>
<p><strong><span style="font-size: 16px">注意:在虚拟机环境中一定要加上 fail_over_mac = 1</span> </strong></p>
<div class="cnblogs_Highlighter">
<pre class="brush:bash;gutter:true;">sed -i '/BONDING_OPTS/d' ifcfg-bond1
echo 'BONDING_OPTS="miimon=100 mode=1 fail_over_mac=1"' >> ifcfg-bond1
</pre>
</div>
<p>重启网络</p>
<div class="cnblogs_Highlighter">
<pre class="brush:bash;gutter:true;"><span style="background-color: rgba(0, 255, 0, 1)">#systemctl restart network</span>
<span style="background-color: rgba(0, 255, 0, 1)">#cat /proc/net/bonding/bond1</span>
Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011)
Bonding Mode: fault-tolerance (active-backup) (fail_over_mac active)
Primary Slave: None
Currently Active Slave: eth1
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 0
Down Delay (ms): 0
Slave Interface: eth1
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 00:0c:29:f4:f4:0f
Slave queue ID: 0
Slave Interface: eth2
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 00:0c:29:f4:f4:19
Slave queue ID: 0
</pre>
</div>
<p>成功实现了虚拟机装网卡绑定,测试和前一种方式一样。</p>
<p> </p>
<p> </p>
<h4>3.1.3 通过 nmcli 命令实现网卡绑定,使用技术:team <span style="color: rgba(153, 51, 102, 1)"><strong>[ 在Centos 7 之后的版本推荐使用这种方式 ]</strong></span></h4>
<p>网卡信息及连接状态如下:</p>
<div class="cnblogs_Highlighter">
<pre class="brush:bash;gutter:true;"><span style="background-color: rgba(0, 255, 0, 1)">#nmcli dev</span>
DEVICETYPE STATE CONNECTION
eth0 ethernetconnected System eth0
eth1 ethernetdisconnected--
eth2 ethernetdisconnected--
lo loopbackunmanaged --
<span style="background-color: rgba(0, 255, 0, 1)">#nmcli con</span>
NAME UUID TYPE DEVICE
System eth0078df8ff-b848-4c23-b212-3213a74bc5d5etherneteth0
</pre>
</div>
<p>目前只有eth0 建立连接,通过nmcli 添加 team1</p>
<div class="cnblogs_Highlighter">
<pre class="brush:bash;gutter:true;"><span style="background-color: rgba(0, 255, 0, 1)">#nmcli con add type team ifname team1 con-name team1 config '{"runner":{"name":"activebackup", "hwaddr_policy":"by_active"}}' \</span><br><span style="background-color: rgba(0, 255, 0, 1)">ipv4.method manual ipv4.address 192.168.1.100/24 ipv4.gateway 192.168.1.1 ipv4.dns 114.114.114.114</span>
Connection 'team1' (25434d73-0224-47e1-80f4-bbb3faae53fe) successfully added.
<span style="background-color: rgba(0, 255, 0, 1)">#nmcli con add type team-slave ifname eth1 con-name team1-port1 master team1</span>
Connection 'team1-port1' (c9e216c2-7668-487b-b6cd-e67631b8a3f9) successfully added.
<span style="background-color: rgba(0, 255, 0, 1)">#nmcli con add type team-slave ifname eth2 con-name team1-port2 master team1</span>
Connection 'team1-port2' (cf8d3150-b3e0-433c-8c4e-ba4feaa4bd6d) successfully added.
</pre>
</div>
<p>配置完毕,在虚拟机环境中一定要注意:<strong>"hwaddr_policy":"by_active"</strong> 这个参数意义和 fail_over_mac =1 是一致的,在虚拟机环境中必须添加上,否则网卡高可用失败。</p>
<p>查看网卡连接状态和绑定状态:</p>
<div class="cnblogs_Highlighter">
<pre class="brush:bash;gutter:true;"><span style="background-color: rgba(0, 255, 0, 1)">#nmcli con</span>
NAME UUID TYPE DEVICE
System eth0078df8ff-b848-4c23-b212-3213a74bc5d5etherneteth0
team1 25434d73-0224-47e1-80f4-bbb3faae53feteam team1
team1-port1c9e216c2-7668-487b-b6cd-e67631b8a3f9etherneteth1
team1-port2cf8d3150-b3e0-433c-8c4e-ba4feaa4bd6detherneteth2
<span style="background-color: rgba(0, 255, 0, 1)">#teamdctl team1 st</span>
setup:
runner: activebackup
ports:
eth1
link watches:
link summary: up
instance:
name: ethtool
link: up
down count: 0
eth2
link watches:
link summary: up
instance:
name: ethtool
link: up
down count: 0
runner:
active port: eth1
</pre>
</div>
<p> </p>
<p>本次创建, 网卡直接建立了连接如果没有建立连接,也就是 nmcli con 查看 DEVICE 项没有物理网卡连接,则执行如下:</p>
<div class="cnblogs_Highlighter">
<pre class="brush:bash;gutter:true;"><span style="background-color: rgba(0, 255, 0, 1)">#nmcli con up team1-port1</span>
Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/74)
<span style="background-color: rgba(0, 255, 0, 1)">#nmcli con up team1-port2</span>
Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/75)
<span style="background-color: rgba(0, 255, 0, 1)">#nmcli con up team1</span>
Connection successfully activated (master waiting for slaves) (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/76)
</pre>
</div>
<p> </p>
<p>做完了如上配置,建议直接重启网卡查看是否有报错,或者无法连接的情况:</p>
<p><img src="https://img2020.cnblogs.com/blog/828019/202005/828019-20200521161313669-443086176.png" alt=""></p>
<p> </p>
<p> </p>
<p> </p>
<p>测试</p>
<p><img src="https://img2020.cnblogs.com/blog/828019/202005/828019-20200521161435221-1408984700.png" alt=""></p>
<p> </p>
<p> </p>
<p> </p>
<p>直接通过 ifdown 掉正在使用的 eth1 网络仅仅延迟了不到1ms的时间就恢复了正常,现在查看网络绑定状态:</p>
<div class="cnblogs_Highlighter">
<pre class="brush:bash;gutter:true;"><span style="background-color: rgba(0, 255, 0, 1)">#teamdctl team1 st</span>
setup:
runner: activebackup
ports:
eth2
link watches:
link summary: up
instance:
name: ethtool
link: up
down count: 0
runner:
active port: eth2
</pre>
</div>
<p>活动网卡已经切换到 eth2 ,重启 eth1</p>
<div class="cnblogs_Highlighter">
<pre class="brush:bash;gutter:true;"><span style="background-color: rgba(0, 255, 0, 1)">#ifup eth1</span>
Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/87)
<span style="background-color: rgba(0, 255, 0, 1)">#teamdctl team1 st</span>
setup:
runner: activebackup
ports:
eth1
link watches:
link summary: up
instance:
name: ethtool
link: up
down count: 0
eth2
link watches:
link summary: up
instance:
name: ethtool
link: up
down count: 0
runner:
active port: eth2
</pre>
</div>
<p> </p>
<p>启动 eth1 以后,活动网卡依然是 eth2 ,而 eth1 则成为备用网卡。</p>
<p> </p>
<h4>3.1.4 总结</h4>
<p>三种方式:</p>
<ul>
<li>手动配置 - bonding</li>
<li>nmcli 配置 - bonding</li>
<li>nmcli 配置 - team</li>
</ul>
<p>在 Centos 7 以后的版本建议使用 nmcli - team 的方式,简便,更易管理和查看。</p>
<p>在虚拟机的环境中,使用 bond 和 team 都只能实现 mode-1模式的故障切换。</p>
<ul>
<li>bond 虚拟机中必要参数: fail_over_mac=1</li>
<li>team 虚拟机中必要参数:"hwaddr_policy":"by_active"</li>
</ul>
<p> </p>
<p> </p>
<h2>3.2 物理机网卡绑定</h2>
<p> [此部分在真机测试后补充...]</p>
<p> </p><br><br>
来源:https://www.cnblogs.com/hukey/p/12931673.html
頁:
[1]