日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > linux >内容正文

linux

bond的主备模式_linux-rhel7配置网卡bond双网卡主备模式

發布時間:2024/8/5 linux 39 豆豆
生活随笔 收集整理的這篇文章主要介紹了 bond的主备模式_linux-rhel7配置网卡bond双网卡主备模式 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

參考以下文章中的 2.centos7配置bonding:

https://www.cnblogs.com/huangweimin/articles/6527058.html

以下是配置過程的操作和打印消息:

[root@lnltedmr3 modprobe.d]# systemctl stop NetworkManager.service

[root@lnltedmr3 modprobe.d]# systemctl disable NetworkManager.service

Removed symlink /etc/systemd/system/multi-user.target.wants/NetworkManager.service.

Removed symlink /etc/systemd/system/dbus-org.freedesktop.NetworkManager.service.

Removed symlink /etc/systemd/system/dbus-org.freedesktop.nm-dispatcher.service.

Removed symlink /etc/systemd/system/network-online.target.wants/NetworkManager-wait-online.service.

[root@lnltedmr3 modprobe.d]# modprobe --first-time bonding

[root@lnltedmr3 modprobe.d]# lsmod | grep bonding

bonding 152656 0

[root@lnltedmr3 modprobe.d]# cd /etc/sysconfig/network-scripts/

[root@lnltedmr3 network-scripts]# vim ifcfg-bond0

[root@lnltedmr3 network-scripts]# cat ifcfg-bond0

DEVICE=bond0

TYPE=Bond

ONBOOT=yes

BOOTPROTO=static

IPADDR=10.204.197.144

PREFIX=24

GATEWAY=10.204.197.1

BONDING_MASTER=yes

BONDING_OPTS="mode=1 miimon=100"

[root@lnltedmr3 network-scripts]# ls

ifcfg-bond0 ifdown-ipv6 ifup-bnep ifup-sit

ifcfg-eno1 ifdown-isdn ifup-eth ifup-Team

ifcfg-eno2 ifdown-post ifup-ib ifup-TeamPort

ifcfg-eno3 ifdown-ppp ifup-ippp ifup-tunnel

ifcfg-eno4 ifdown-routes ifup-ipv6 ifup-wireless

ifcfg-lo ifdown-sit ifup-isdn init.ipv6-global

ifdown ifdown-Team ifup-plip network-functions

ifdown-bnep ifdown-TeamPort ifup-plusb network-functions-ipv6

ifdown-eth ifdown-tunnel ifup-post

ifdown-ib ifup ifup-ppp

ifdown-ippp ifup-aliases ifup-routes

[root@lnltedmr3 network-scripts]# ll

總用量 268

-rw-r--r--. 1 root root 156 2月 25 23:51 ifcfg-bond0

-rw-r--r--. 1 root root 408 2月 25 23:30 ifcfg-eno1

-rw-r--r--. 1 root root 353 2月 25 23:31 ifcfg-eno2

-rw-r--r--. 1 root root 277 2月 22 23:06 ifcfg-eno3

-rw-r--r--. 1 root root 277 2月 22 23:06 ifcfg-eno4

-rw-r--r--. 1 root root 254 8月 24 2018 ifcfg-lo

lrwxrwxrwx. 1 root root 24 2月 22 22:56 ifdown -> ../../../usr/sbin/ifdown

-rwxr-xr-x. 1 root root 654 8月 24 2018 ifdown-bnep

-rwxr-xr-x. 1 root root 6532 8月 24 2018 ifdown-eth

-rwxr-xr-x. 1 root root 6190 6月 27 2018 ifdown-ib

-rwxr-xr-x. 1 root root 781 8月 24 2018 ifdown-ippp

-rwxr-xr-x. 1 root root 4540 8月 24 2018 ifdown-ipv6

lrwxrwxrwx. 1 root root 11 2月 22 22:56 ifdown-isdn -> ifdown-ippp

-rwxr-xr-x. 1 root root 2130 8月 24 2018 ifdown-post

-rwxr-xr-x. 1 root root 1068 8月 24 2018 ifdown-ppp

-rwxr-xr-x. 1 root root 870 8月 24 2018 ifdown-routes

-rwxr-xr-x. 1 root root 1456 8月 24 2018 ifdown-sit

-rwxr-xr-x. 1 root root 1621 3月 18 2017 ifdown-Team

-rwxr-xr-x. 1 root root 1556 3月 18 2017 ifdown-TeamPort

-rwxr-xr-x. 1 root root 1462 8月 24 2018 ifdown-tunnel

lrwxrwxrwx. 1 root root 22 2月 22 22:56 ifup -> ../../../usr/sbin/ifup

-rwxr-xr-x. 1 root root 12415 8月 24 2018 ifup-aliases

-rwxr-xr-x. 1 root root 910 8月 24 2018 ifup-bnep

-rwxr-xr-x. 1 root root 13475 8月 24 2018 ifup-eth

-rwxr-xr-x. 1 root root 10114 6月 27 2018 ifup-ib

-rwxr-xr-x. 1 root root 12075 8月 24 2018 ifup-ippp

-rwxr-xr-x. 1 root root 11893 8月 24 2018 ifup-ipv6

lrwxrwxrwx. 1 root root 9 2月 22 22:56 ifup-isdn -> ifup-ippp

-rwxr-xr-x. 1 root root 650 8月 24 2018 ifup-plip

-rwxr-xr-x. 1 root root 1064 8月 24 2018 ifup-plusb

-rwxr-xr-x. 1 root root 4997 8月 24 2018 ifup-post

-rwxr-xr-x. 1 root root 4154 8月 24 2018 ifup-ppp

-rwxr-xr-x. 1 root root 2001 8月 24 2018 ifup-routes

-rwxr-xr-x. 1 root root 3303 8月 24 2018 ifup-sit

-rwxr-xr-x. 1 root root 1755 3月 18 2017 ifup-Team

-rwxr-xr-x. 1 root root 1876 3月 18 2017 ifup-TeamPort

-rwxr-xr-x. 1 root root 2711 8月 24 2018 ifup-tunnel

-rwxr-xr-x. 1 root root 1836 8月 24 2018 ifup-wireless

-rwxr-xr-x. 1 root root 5419 8月 24 2018 init.ipv6-global

-rw-r--r--. 1 root root 20671 8月 24 2018 network-functions

-rw-r--r--. 1 root root 31027 8月 24 2018 network-functions-ipv6

[root@lnltedmr3 network-scripts]# ls

ifcfg-bond0 ifdown-ipv6 ifup-bnep ifup-sit

ifcfg-eno1 ifdown-isdn ifup-eth ifup-Team

ifcfg-eno2 ifdown-post ifup-ib ifup-TeamPort

ifcfg-eno3 ifdown-ppp ifup-ippp ifup-tunnel

ifcfg-eno4 ifdown-routes ifup-ipv6 ifup-wireless

ifcfg-lo ifdown-sit ifup-isdn init.ipv6-global

ifdown ifdown-Team ifup-plip network-functions

ifdown-bnep ifdown-TeamPort ifup-plusb network-functions-ipv6

ifdown-eth ifdown-tunnel ifup-post

ifdown-ib ifup ifup-ppp

ifdown-ippp ifup-aliases ifup-routes

[root@lnltedmr3 network-scripts]# vim ifcfg-eno1

[root@lnltedmr3 network-scripts]# cp ifcfg-eno1 ifcfg-eno1_bak20190225

[root@lnltedmr3 network-scripts]# ls

ifcfg-bond0 ifdown-ippp ifup-aliases ifup-routes

ifcfg-eno1 ifdown-ipv6 ifup-bnep ifup-sit

ifcfg-eno1_bak20190225 ifdown-isdn ifup-eth ifup-Team

ifcfg-eno2 ifdown-post ifup-ib ifup-TeamPort

ifcfg-eno3 ifdown-ppp ifup-ippp ifup-tunnel

ifcfg-eno4 ifdown-routes ifup-ipv6 ifup-wireless

ifcfg-lo ifdown-sit ifup-isdn init.ipv6-global

ifdown ifdown-Team ifup-plip network-functions

ifdown-bnep ifdown-TeamPort ifup-plusb network-functions-ipv6

ifdown-eth ifdown-tunnel ifup-post

ifdown-ib ifup ifup-ppp

[root@lnltedmr3 network-scripts]# cp ifcfg-eno2 ifcfg-eno2_bak20190225

[root@lnltedmr3 network-scripts]# ls

ifcfg-bond0 ifdown-ib ifup ifup-ppp

ifcfg-eno1 ifdown-ippp ifup-aliases ifup-routes

ifcfg-eno1_bak20190225 ifdown-ipv6 ifup-bnep ifup-sit

ifcfg-eno2 ifdown-isdn ifup-eth ifup-Team

ifcfg-eno2_bak20190225 ifdown-post ifup-ib ifup-TeamPort

ifcfg-eno3 ifdown-ppp ifup-ippp ifup-tunnel

ifcfg-eno4 ifdown-routes ifup-ipv6 ifup-wireless

ifcfg-lo ifdown-sit ifup-isdn init.ipv6-global

ifdown ifdown-Team ifup-plip network-functions

ifdown-bnep ifdown-TeamPort ifup-plusb network-functions-ipv6

ifdown-eth ifdown-tunnel ifup-post

[root@lnltedmr3 network-scripts]# vim ifcfg-eno1

[root@lnltedmr3 network-scripts]# cat ifcfg-eno1

BOOTPROTO="none"

NAME="eno1"

UUID="e874fd6b-bc2d-492a-bada-29c930274618"

DEVICE="eno1"

ONBOOT="yes"

MASTER=bond0

SLAVE=yes

[root@lnltedmr3 network-scripts]# vim ifcfg-eno2

[已修改但尚未保存]

/bin/bash: q: 未找到命令

Shell 已返回127

請按 ENTER 或其它命令繼續

[root@lnltedmr3 network-scripts]#

[root@lnltedmr3 network-scripts]# vim ifcfg-eno2

[已修改但尚未保存]

/bin/bash: q: 未找到命令

Shell 已返回127

請按 ENTER 或其它命令繼續

[root@lnltedmr3 network-scripts]# vim ifcfg-eno2

[root@lnltedmr3 network-scripts]# cat ifcfg-eno2

BOOTPROTO=none

NAME=eno2

UUID=c1dcedee-720b-4434-bc06-26049ee823e4

DEVICE=eno2

ONBOOT=no

MASTER=bond0

SLAVE=yes

[root@lnltedmr3 network-scripts]# systemctl restart network

[root@lnltedmr3 network-scripts]# cat /proc/net/boning/bond0

cat: /proc/net/boning/bond0: 沒有那個文件或目錄

[root@lnltedmr3 network-scripts]# cd /proc

[root@lnltedmr3 proc]# cd net/bonding/

[root@lnltedmr3 bonding]# ls

bond0

[root@lnltedmr3 bonding]# cat bond0

Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011)

Bonding Mode: fault-tolerance (active-backup)

Primary Slave: None

Currently Active Slave: eno1

MII Status: up

MII Polling Interval (ms): 100

Up Delay (ms): 0

Down Delay (ms): 0

Slave Interface: eno1

MII Status: up

Speed: 1000 Mbps

Duplex: full

Link Failure Count: 0

Permanent HW addr: 00:10:e0:c7:63:46

Slave queue ID: 0

Slave Interface: eno2

MII Status: up

Speed: 1000 Mbps

Duplex: full

Link Failure Count: 0

Permanent HW addr: 00:10:e0:c7:63:47

Slave queue ID: 0

[root@lnltedmr3 bonding]# ping 10.204.197.1

PING 10.204.197.1 (10.204.197.1) 56(84) bytes of data.

64 bytes from 10.204.197.1: icmp_seq=1 ttl=255 time=0.315 ms

64 bytes from 10.204.197.1: icmp_seq=2 ttl=255 time=0.316 ms

^C

--- 10.204.197.1 ping statistics ---

2 packets transmitted, 2 received, 0% packet loss, time 1000ms

rtt min/avg/max/mdev = 0.315/0.315/0.316/0.017 ms

[root@lnltedmr3 bonding]# ping 10.204.197.100

PING 10.204.197.100 (10.204.197.100) 56(84) bytes of data.

64 bytes from 10.204.197.100: icmp_seq=1 ttl=255 time=0.405 ms

64 bytes from 10.204.197.100: icmp_seq=2 ttl=255 time=0.284 ms

64 bytes from 10.204.197.100: icmp_seq=3 ttl=255 time=0.235 ms

64 bytes from 10.204.197.100: icmp_seq=4 ttl=255 time=0.226 ms

^C

--- 10.204.197.100 ping statistics ---

4 packets transmitted, 4 received, 0% packet loss, time 3000ms

rtt min/avg/max/mdev = 0.226/0.287/0.405/0.073 ms

[root@lnltedmr3 bonding]# ifconfig -a

bond0: flags=5187 mtu 1500

inet 10.204.197.144 netmask 255.255.255.0 broadcast 10.204.197.255

inet6 fe80::210:e0ff:fec7:6346 prefixlen 64 scopeid 0x20

ether 00:10:e0:c7:63:46 txqueuelen 1000 (Ethernet)

RX packets 12589 bytes 758396 (740.6 KiB)

RX errors 0 dropped 0 overruns 0 frame 0

TX packets 113 bytes 10785 (10.5 KiB)

TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

eno1: flags=6211 mtu 1500

ether 00:10:e0:c7:63:46 txqueuelen 1000 (Ethernet)

RX packets 10614473 bytes 637160478 (607.6 MiB)

RX errors 0 dropped 0 overruns 0 frame 0

TX packets 5884 bytes 497029 (485.3 KiB)

TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

eno2: flags=6211 mtu 1500

ether 00:10:e0:c7:63:46 txqueuelen 1000 (Ethernet)

RX packets 10608986 bytes 636745165 (607.2 MiB)

RX errors 0 dropped 0 overruns 0 frame 0

TX packets 144 bytes 11841 (11.5 KiB)

TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

eno3: flags=4098 mtu 1500

ether 00:10:e0:c7:63:48 txqueuelen 1000 (Ethernet)

RX packets 0 bytes 0 (0.0 B)

RX errors 0 dropped 0 overruns 0 frame 0

TX packets 0 bytes 0 (0.0 B)

TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

eno4: flags=4098 mtu 1500

ether 00:10:e0:c7:63:49 txqueuelen 1000 (Ethernet)

RX packets 0 bytes 0 (0.0 B)

RX errors 0 dropped 0 overruns 0 frame 0

TX packets 0 bytes 0 (0.0 B)

TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

lo: flags=73 mtu 65536

inet 127.0.0.1 netmask 255.0.0.0

inet6 ::1 prefixlen 128 scopeid 0x10

loop txqueuelen 1000 (Local Loopback)

RX packets 2941 bytes 232132 (226.6 KiB)

RX errors 0 dropped 0 overruns 0 frame 0

TX packets 2941 bytes 232132 (226.6 KiB)

TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

virbr0: flags=4099 mtu 1500

inet 192.168.122.1 netmask 255.255.255.0 broadcast 192.168.122.255

ether 52:54:00:6e:73:d5 txqueuelen 1000 (Ethernet)

RX packets 0 bytes 0 (0.0 B)

RX errors 0 dropped 0 overruns 0 frame 0

TX packets 0 bytes 0 (0.0 B)

TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

virbr0-nic: flags=4098 mtu 1500

ether 52:54:00:6e:73:d5 txqueuelen 1000 (Ethernet)

RX packets 0 bytes 0 (0.0 B)

RX errors 0 dropped 0 overruns 0 frame 0

TX packets 0 bytes 0 (0.0 B)

TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

[root@lnltedmr3 bonding]#

其他參考資料:

https://www.cnblogs.com/suzhigang/p/6140018.html

https://www.cnblogs.com/geaozhang/p/6763876.html

總結

以上是生活随笔為你收集整理的bond的主备模式_linux-rhel7配置网卡bond双网卡主备模式的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。