国产片侵犯亲女视频播放_亚洲精品二区_在线免费国产视频_欧美精品一区二区三区在线_少妇久久久_在线观看av不卡

服務(wù)器之家:專注于服務(wù)器技術(shù)及軟件下載分享
分類導(dǎo)航

Linux|Centos|Ubuntu|系統(tǒng)進程|Fedora|注冊表|Bios|Solaris|Windows7|Windows10|Windows11|windows server|

服務(wù)器之家 - 服務(wù)器系統(tǒng) - Centos - Centos7/RHEL7雙網(wǎng)卡綁定的方法

Centos7/RHEL7雙網(wǎng)卡綁定的方法

2022-01-18 20:18hukey Centos

本篇文章主要介紹了Centos7/RHEL7雙網(wǎng)卡綁定的方法,小編覺得挺不錯的,現(xiàn)在分享給大家,也給大家做個參考。一起跟隨小編過來看看吧

1. 簡要

雙網(wǎng)卡綁定技術(shù)在centos7中使用了teaming技術(shù),而在rhel6/centos7中使用的是bonding技術(shù),在centos7中雙網(wǎng)卡綁定既能使用teaming也可以使用bonding,這里推薦使用teaming技術(shù),方便與查看和監(jiān)控。

2. 原理

這里介紹兩種最常見的雙網(wǎng)卡綁定模式:

        (1) roundrobin - 輪詢模式

            所有鏈路處于負載均衡狀態(tài),這種模式的特點增加了帶寬,同時支持容錯能力。

        (2) activebackup - 主備模式

            一個網(wǎng)卡處于活動狀態(tài),另一個處于備份狀態(tài),所有流量都在主鏈路上處理,當(dāng)活動網(wǎng)卡down掉時,啟用備份網(wǎng)卡。

3. 基礎(chǔ)環(huán)境

系統(tǒng):centos7

在centos7中,關(guān)閉虛擬機添加網(wǎng)卡,再開啟虛擬機,系統(tǒng)是不會自動生成網(wǎng)卡的配置文件:

Centos7/RHEL7雙網(wǎng)卡綁定的方法

在centos7中要生成網(wǎng)卡配置文件的方法很簡單,使用如下命令:

?
1
2
3
4
5
6
7
  # 查看物理網(wǎng)卡信息
[root@localhost ~]# nmcli dev
device    type   state   connection    
eno16777736 ethernet connected eno16777736   
eno33554984 ethernet connected wired connection 1
eno50332208 ethernet connected wired connection 2
lo      loopback unmanaged --

上面的信息可以看到,一共有四張網(wǎng)卡,其中l(wèi)o是本地回環(huán)網(wǎng)卡,另外三張為物理網(wǎng)卡。

?
1
2
3
4
5
6
  # 查看網(wǎng)卡連接信息
[root@localhost ~]# nmcli con sh
name        uuid                 type      device  
wired connection 2 9a1314bf-d273-406a-930a-dc4160dee4ec 802-3-ethernet eno50332208
wired connection 1 47eef4a3-7fa4-4a73-83ef-1485bda9b950 802-3-ethernet eno33554984
eno16777736     51d00668-2cf5-41da-ad8d-5019d62e98ad 802-3-ethernet eno16777736

上面的信息可以查看到一共有3個連接,其中兩個有線連接,表示沒有設(shè)置過的網(wǎng)卡連接,還有一個enoxx連接。接下來要修改兩個有線連接的命名方法,并生成網(wǎng)卡配置文件:

?
1
2
3
4
5
  # 首先,刪除兩個無用的有線連接
[root@localhost ~]# nmcli con del 9a1314bf-d273-406a-930a-dc4160dee4ec
connection 'wired connection 2' (9a1314bf-d273-406a-930a-dc4160dee4ec) successfully deleted.
[root@localhost ~]# nmcli con del 47eef4a3-7fa4-4a73-83ef-1485bda9b950
connection 'wired connection 1' (47eef4a3-7fa4-4a73-83ef-1485bda9b950) successfully deleted.
?
1
2
3
4
5
6
# 再次創(chuàng)建新的連接并生成配置文件
 
[root@localhost ~]# nmcli conn add type ethernet con-name eno50332208 ifname eno50332208
connection 'eno50332208' (eea2a115-63f8-4f33-be84-12559f02542c) successfully added.
[root@localhost ~]# nmcli conn add type ethernet con-name eno33554984 ifname eno33554984
connection 'eno33554984' (32d2389e-4e82-4419-9d18-5aff8f0be003) successfully added.
?
1
2
3
4
5
6
7
8
9
10
11
12
# 最后,查看下
 
[root@localhost ~]# nmcli con sh
name     uuid                 type      device  
eno16777736 51d00668-2cf5-41da-ad8d-5019d62e98ad 802-3-ethernet eno16777736
eno33554984 32d2389e-4e82-4419-9d18-5aff8f0be003 802-3-ethernet eno33554984
eno50332208 eea2a115-63f8-4f33-be84-12559f02542c 802-3-ethernet eno50332208
 
[root@localhost ~]# ll /etc/sysconfig/network-scripts/ifcfg-eno*
-rw-r--r--. 1 root root 394 nov 26 05:59 /etc/sysconfig/network-scripts/ifcfg-eno16777736
-rw-r--r--. 1 root root 288 dec 26 08:44 /etc/sysconfig/network-scripts/ifcfg-eno33554984
-rw-r--r--. 1 root root 288 dec 26 08:44 /etc/sysconfig/network-scripts/ifcfg-eno50332208

網(wǎng)絡(luò)連接和配置文件都成功生成了。 接下來通過eno33554984 和 eno50332208 使用teaming模式進行雙網(wǎng)卡綁定

4. roundrobin模式:

roundrobin模式也稱為輪詢模式,它 基于每一個包 ,當(dāng)某一臺服務(wù)器的兩張網(wǎng)卡設(shè)置為roundrobin模式teaming,此時服務(wù)器發(fā)出的數(shù)據(jù)包,就會在兩個物理網(wǎng)卡上進行輪詢,即第一個數(shù)據(jù)包走一張網(wǎng)卡,第二個數(shù)據(jù)包走第二張網(wǎng)卡,依次輪詢。

注意:

        (1)roundrobin具有容錯性,當(dāng)一張網(wǎng)卡down掉,數(shù)據(jù)包依然發(fā)送成功。

        (2)在使用roundrobin模式必須要在交換機上做以太通道,不然會出現(xiàn)網(wǎng)絡(luò)無法連通。

實際操作:

?
1
2
3
  # 使用nmcli命令操作,創(chuàng)建team接口team0,同時設(shè)置teaming模式為roundrobin
[root@localhost ~]# nmcli con add type team con-name team0 ifname team0 config '{"runner":{"name": "roundrobin"}}'
connection 'team0' (9dc48bd6-54b9-48db-b7dd-ecf34ae9196f) successfully added.
?
1
2
3
4
  # 給接口team0設(shè)置ip地址
[root@localhost ~]# nmcli con modify team0 ipv4.address '10.0.0.2/24' ipv4.gateway '10.0.0.1'
  # 設(shè)置為手動模式,取消dhcp
[root@localhost ~]# nmcli con modify team0 ipv4.method manual
?
1
2
3
4
5
6
7
8
9
10
11
12
13
  # 將兩張物理網(wǎng)卡加入到team中
[root@localhost ~]# nmcli con add type team-slave con-name team0-port1 ifname eno33554984 master team0
connection 'team0-port1' (22d3640e-f5c8-499c-b0dd-913c8970d800) successfully added.
[root@localhost ~]# nmcli con add type team-slave con-name team0-port2 ifname eno50332208 master team0
connection 'team0-port2' (12660d2a-0e1f-41e6-96b2-53de4fc6b78c) successfully added.
[root@localhost ~]# nmcli con sh
name     uuid                 type      device  
team0-port2 12660d2a-0e1f-41e6-96b2-53de4fc6b78c 802-3-ethernet --    
eno16777736 51d00668-2cf5-41da-ad8d-5019d62e98ad 802-3-ethernet eno16777736
team0-port1 22d3640e-f5c8-499c-b0dd-913c8970d800 802-3-ethernet --    
team0    9dc48bd6-54b9-48db-b7dd-ecf34ae9196f team      team0   
eno33554984 32d2389e-4e82-4419-9d18-5aff8f0be003 802-3-ethernet eno33554984
eno50332208 eea2a115-63f8-4f33-be84-12559f02542c 802-3-ethernet eno50332208
?
1
2
3
4
5
  # 查看team0的狀態(tài)
 
[root@localhost ~]# teamdctl team0 st
setup:
 runner: roundrobin

4.1 roundrobin問題排查

第一次查看出現(xiàn)的是這樣的結(jié)果,檢查下配置:

?
1
2
3
4
5
6
7
8
  # 通過直接查看網(wǎng)卡發(fā)現(xiàn)team0并沒有啟動
[root@localhost ~]# ip a | grep team0
5: team0: <no-carrier,broadcast,multicast,up> mtu 1500 qdisc noqueue state down
 
  # 使用ifup 啟動team0并沒有成功,繼續(xù)排查
[root@localhost ~]# ifup team0
[root@localhost ~]# ip a | grep team0
5: team0: <no-carrier,broadcast,multicast,up> mtu 1500 qdisc noqueue state down

直接sysetmctl restart network 也沒有成功。

?
1
2
3
4
5
6
7
8
9
  # 發(fā)現(xiàn)team0-port1 team0-port2沒有添加成功物理網(wǎng)卡,怎么回事呢?
[root@localhost ~]# nmcli con sh
name     uuid                 type      device  
team0-port2 ec96c1e1-d268-4ba1-a2f9-0133a9f02655 802-3-ethernet --    
eno16777736 51d00668-2cf5-41da-ad8d-5019d62e98ad 802-3-ethernet eno16777736
team0-port1 22d3640e-f5c8-499c-b0dd-913c8970d800 802-3-ethernet --    
team0    9dc48bd6-54b9-48db-b7dd-ecf34ae9196f team      team0   
eno33554984 32d2389e-4e82-4419-9d18-5aff8f0be003 802-3-ethernet eno33554984
eno50332208 eea2a115-63f8-4f33-be84-12559f02542c 802-3-ethernet eno50332208
?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
  # 刪除掉
[root@localhost ~]# nmcli con del team0-port1
connection 'team0-port1' (22d3640e-f5c8-499c-b0dd-913c8970d800) successfully deleted.
[root@localhost ~]# nmcli con del team0-port2
connection 'team0-port2' (ec96c1e1-d268-4ba1-a2f9-0133a9f02655) successfully deleted.
 
 
  # 刪除兩張物理網(wǎng)卡的連接
[root@localhost ~]# nmcli con sh
name     uuid                 type      device  
eno16777736 51d00668-2cf5-41da-ad8d-5019d62e98ad 802-3-ethernet eno16777736
team0    9dc48bd6-54b9-48db-b7dd-ecf34ae9196f team      team0   
eno33554984 32d2389e-4e82-4419-9d18-5aff8f0be003 802-3-ethernet eno33554984
eno50332208 eea2a115-63f8-4f33-be84-12559f02542c 802-3-ethernet eno50332208
[root@localhost ~]# nmcli con del eno33554984 eno50332208
connection 'eno33554984' (32d2389e-4e82-4419-9d18-5aff8f0be003) successfully deleted.
connection 'eno50332208' (eea2a115-63f8-4f33-be84-12559f02542c) successfully deleted.
  # 刪除成功
[root@localhost ~]# nmcli con sh
name     uuid                 type      device  
eno16777736 51d00668-2cf5-41da-ad8d-5019d62e98ad 802-3-ethernet eno16777736
team0    9dc48bd6-54b9-48db-b7dd-ecf34ae9196f team      team0
?
1
2
3
4
5
6
7
8
9
10
11
  # 再次將兩張物理網(wǎng)卡添加到team
[root@localhost ~]# nmcli con add type team-slave con-name team0-port1 ifname eno33554984 master team0
connection 'team0-port1' (0331ea43-95c0-4106-b388-8484d4c3940d) successfully added.
[root@localhost ~]# nmcli con add type team-slave con-name team0-port2 ifname eno50332208 master team0
connection 'team0-port2' (880f2146-fe93-42dd-8d28-7d0dd50b4011) successfully added.
[root@localhost ~]# nmcli con sh
name     uuid                 type      device  
team0-port1 0331ea43-95c0-4106-b388-8484d4c3940d 802-3-ethernet eno33554984
eno16777736 51d00668-2cf5-41da-ad8d-5019d62e98ad 802-3-ethernet eno16777736
team0    9dc48bd6-54b9-48db-b7dd-ecf34ae9196f team      team0   
team0-port2 880f2146-fe93-42dd-8d28-7d0dd50b4011 802-3-ethernet eno50332208

現(xiàn)在成功將兩張物理網(wǎng)卡綁定到了team組中

?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
  # 現(xiàn)在查看team0的狀態(tài)就出現(xiàn)了,模式是:roundrobin
[root@localhost ~]# teamdctl team0 st
setup:
 runner: roundrobin
ports:
 eno33554984
  link watches:
   link summary: up
   instance[link_watch_0]:
    name: ethtool
    link: up
    down count: 0
 eno50332208
  link watches:
   link summary: up
   instance[link_watch_0]:
    name: ethtool
    link: up
    down count: 0

這樣,team模式的roundrobin搭建成功。

總結(jié):

在做鏈路聚合的時候,所要使用到的物理網(wǎng)卡不能獨立存在連接,也就是在nmcli con sh查看時,不能獨立存在,否則就無法綁定到team模式中。

4.2 測試

因為這里是虛擬機環(huán)境,只能通過down掉網(wǎng)卡進行查看。

?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
[root@localhost ~]# teamdctl team0 st
setup:
 runner: roundrobin
ports:
 eno33554984
  link watches:
   link summary: up
   instance[link_watch_0]:
    name: ethtool
    link: up
    down count: 0
 eno50332208
  link watches:
   link summary: up
   instance[link_watch_0]:
    name: ethtool
    link: up
    down count: 0

兩張網(wǎng)卡同時在線,現(xiàn)在down掉其中一張網(wǎng)卡,

?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
[root@localhost ~]# nmcli con del team0-port1
connection 'team0-port1' (0331ea43-95c0-4106-b388-8484d4c3940d) successfully deleted.
[root@localhost ~]# nmcli con sh
name     uuid                 type      device  
eno16777736 51d00668-2cf5-41da-ad8d-5019d62e98ad 802-3-ethernet eno16777736
team0    9dc48bd6-54b9-48db-b7dd-ecf34ae9196f team      team0   
team0-port2 880f2146-fe93-42dd-8d28-7d0dd50b4011 802-3-ethernet eno50332208
 
[root@localhost ~]# teamdctl team0 st
setup:
 runner: roundrobin
ports:
 eno50332208
  link watches:
   link summary: up
   instance[link_watch_0]:
    name: ethtool
    link: up
    down count: 0

這樣就發(fā)現(xiàn)eno33554984網(wǎng)卡已經(jīng)down掉了。

?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
[root@localhost ~]# nmcli con add type team-slave con-name team0-port1 ifname eno33554984 master team0
connection 'team0-port1' (59acd6bf-affc-4994-a050-83c45816859a) successfully added.
[root@localhost ~]#
[root@localhost ~]# teamdctl team0 st
setup:
 runner: roundrobin
ports:
 eno33554984
  link watches:
   link summary: up
   instance[link_watch_0]:
    name: ethtool
    link: up
    down count: 0
 eno50332208
  link watches:
   link summary: up
   instance[link_watch_0]:
    name: ethtool
    link: up
    down count: 0

 虛擬機環(huán)境就這樣測試了吧,至于生產(chǎn)環(huán)境就直接拔網(wǎng)線,ping測試。

資料有說linux下roundrobin具有容錯的效果,為了測試是否有容錯的效果,虛擬機做了下更改來驗證:

Centos7/RHEL7雙網(wǎng)卡綁定的方法

這一次網(wǎng)卡全部改成橋接模式,為了更好的測試是否具有容錯性。

Centos7/RHEL7雙網(wǎng)卡綁定的方法

roundrobin已經(jīng)配置完畢。接下來我們down掉一張網(wǎng)卡檢查是否具有容錯性。

Centos7/RHEL7雙網(wǎng)卡綁定的方法

通過虛擬機測試,容錯性是存在的。

 5. 雙網(wǎng)卡綁定activebackup的實現(xiàn)

?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
[root@localhost ~]# nmcli con sh
name     uuid                 type      device  
team0-port2 2a1aa534-e021-4452-bb0a-2002dabcbc08 802-3-ethernet eno50332208
team0-port1 9a10c9ef-ee9c-4151-9a47-59b4668e8934 802-3-ethernet --    
eno16777736 51d00668-2cf5-41da-ad8d-5019d62e98ad 802-3-ethernet eno16777736
team0    c2278f3f-5c6b-4e1d-b925-514d3c3832b6 team      team0   
[root@localhost ~]# nmcli con del team0 team0-port1 team0-port2
connection 'team0' (c2278f3f-5c6b-4e1d-b925-514d3c3832b6) successfully deleted.
connection 'team0-port1' (9a10c9ef-ee9c-4151-9a47-59b4668e8934) successfully deleted.
connection 'team0-port2' (2a1aa534-e021-4452-bb0a-2002dabcbc08) successfully deleted.
[root@localhost ~]# nmcli con sh
name     uuid                 type      device  
eno16777736 51d00668-2cf5-41da-ad8d-5019d62e98ad 802-3-ethernet eno16777736
 
 
# 以上操作就刪除了roundrobin模式,恢復(fù)到初始狀態(tài)。
?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
# 添加邏輯網(wǎng)卡team0,并啟用activebackup模式
[root@localhost ~]# nmcli con add type team con-name team0 ifname team0 config '{"runner":{"name":"activebackup"}}'
connection 'team0' (f0794e59-419d-4c2a-96b9-464610b6321a) successfully added.
 
# 綁定ip
[root@localhost ~]# nmcli con modify team0 ipv4.address 192.168.118.122/24 ipv4.gateway 192.168.118.1
[root@localhost ~]# nmcli con modify team0 ipv4.method manual
 
 
# 添加物理網(wǎng)卡到activebackup模式
[root@localhost ~]# nmcli con add type team-slave con-name team0-port1 ifname eno33554984 master team0
connection 'team0-port1' (52656904-6e85-4a04-98b4-2b19773fa290) successfully added.
[root@localhost ~]# nmcli con add type team-slave con-name team0-port2 ifname eno50332208 master team0
connection 'team0-port2' (44d96e3a-014a-481f-9122-4ca2d3be9f7a) successfully added.
?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
[root@localhost ~]# teamdctl team0 st
setup:
 runner: activebackup
ports:
 eno33554984
  link watches:
   link summary: up
   instance[link_watch_0]:
    name: ethtool
    link: up
    down count: 0
 eno50332208
  link watches:
   link summary: up
   instance[link_watch_0]:
    name: ethtool
    link: up
    down count: 0
runner:
 active port: eno33554984

成功,處于活動中的網(wǎng)卡為 eno33554984

5.1 測試

通過down掉活動網(wǎng)卡測試網(wǎng)絡(luò)是否仍然處于連通狀態(tài)

 Centos7/RHEL7雙網(wǎng)卡綁定的方法

測試成功。

注意: 在做網(wǎng)卡綁定的時候,如果發(fā)現(xiàn)物理網(wǎng)卡總是無法綁定到team0,請檢查該物理網(wǎng)卡是否處于up狀態(tài)。

以上就是本文的全部內(nèi)容,希望對大家的學(xué)習(xí)有所幫助,也希望大家多多支持服務(wù)器之家。

原文鏈接:http://www.cnblogs.com/hukey/p/6224969.html

延伸 · 閱讀

精彩推薦
  • CentosCentos 7開啟網(wǎng)卡自動獲取IP的詳細方法

    Centos 7開啟網(wǎng)卡自動獲取IP的詳細方法

    本篇文章主要介紹了Centos 7開啟網(wǎng)卡自動獲取IP的詳細方法,小編覺得挺不錯的,現(xiàn)在分享給大家,也給大家做個參考。一起跟隨小編過來看看吧...

    凌鋒8972021-12-29
  • CentosCentOS6.5下Redis安裝與配置詳細步驟

    CentOS6.5下Redis安裝與配置詳細步驟

    本篇文章主要介紹了CentOS6.5下Redis安裝與配置詳細步驟,詳細介紹redis單機單實例安裝與配置,服務(wù)及開機自啟動。有興趣的可以了解一下。...

    飛流11452021-12-24
  • CentosCentOS 6.6實現(xiàn)永久修改DNS地址的方法

    CentOS 6.6實現(xiàn)永久修改DNS地址的方法

    這篇文章主要介紹了CentOS 6.6實現(xiàn)永久修改DNS地址的方法,涉及針對CentOS配置文件的相關(guān)設(shè)置技巧,具有一定參考借鑒價值,需要的朋友可以參考下 ...

    Linux社區(qū)4472020-08-21
  • Centoscentos不小心刪除/root目錄該如何解決?

    centos不小心刪除/root目錄該如何解決?

    一些朋友最近在問小編centos不小心刪除/root目錄該如何解決?今天小編就為大家分享centos不小心刪除/root目錄解決辦法;希望對大家會有幫助,有需要的朋友...

    腳本之家8022019-05-29
  • Centoscentos 安裝與操作方法

    centos 安裝與操作方法

    這篇文章主要介紹了centos 安裝與操作方法,需要的朋友可以參考下...

    centos之家5272019-07-11
  • CentosCentos7運用/dev/shm進行網(wǎng)站優(yōu)化

    Centos7運用/dev/shm進行網(wǎng)站優(yōu)化

    這篇文章主要介紹了LINUX中Centos7運用/dev/shm進行網(wǎng)站優(yōu)化相關(guān)知識點,對此有興趣的朋友參考學(xué)習(xí)下。...

    彬菌9912022-03-02
  • CentosCentOS7設(shè)置日期和時間方法以及基本概念介紹

    CentOS7設(shè)置日期和時間方法以及基本概念介紹

    這篇文章主要介紹了CentOS7設(shè)置日期和時間方法以及基本概念介紹,本文講解使用CentOS7中的新命令timedatectl設(shè)置日期時間方法,需要的朋友可以參考下 ...

    CentOS之家6522019-09-19
  • CentosCentOS下Uptime命令詳解

    CentOS下Uptime命令詳解

    在Linux下,我們可以使用uptime命令,而且此命令不必使用root權(quán)限。uptime命令在系統(tǒng)中已經(jīng)默認安裝了。今天小編為大家?guī)淼氖荂entOS下Uptime命令詳解;希望...

    CentOS之家11482019-06-19
主站蜘蛛池模板: 黄色一区二区三区 | 91嫩草视频在线 | 中文字幕国产一区 | 91久久国产精品 | www.久| 久久综合久久久 | 操操操小说 | 亚洲欧美日韩另类精品一区二区三区 | 午夜视频在线 | 成人av入口 | 春色网站| 国产片在线观看.com | 欧美成人久久久免费播放 | 自拍在线 | 久久久久久九九 | 久久这里只有精品免费 | 荷兰欧美一级毛片 | 国产一区 | 久久国产精品久久喷水 | 久久国产精品久久久久久电车 | 欧美在线观看一区 | 国产精品毛片久久久久久久 | 一级黄色国产片 | 一区二区三区欧美 | 久草福利资源 | 国产综合精品一区二区三区 | 国产乱码一区二区三区在线观看 | 国产美女久久久 | 正在播放国产精品 | 色国产精品 | 亚洲视频一区二区 | 国产精品毛片一区二区三区 | 亚洲综合网站 | 精品国产精品一区二区夜夜嗨 | 99pao成人国产永久免费视频 | 欧美日韩一区二区三区在线观看 | 国产成人毛片 | 国产精品一级 | 日韩欧美国产精品 | 波多野结衣一区二区三区中文字幕 | 超色视频在线观看 |