NIC Bonding on CentOS 7 with nmtui
|
NIC Bonding on CentOS 7 withnmtui 当系统管理员希望增加可用带宽,并提供冗余和负载平衡的数据传输,内核支持bonding允许以聚合的方式实现。简单地说,绑定意味着将两个或多个物理网络接口(称为奴隶)聚合成一个单独的逻辑节点(称为主网络)。如果一个特定的NIC(网络接口卡)的经验问题,通信不受影响只要其他保持活跃。 1.先决条件 默认情况下,bonding内核模块没有启用。因此,我们将需要加载它并确保它持久。使用modprobe--first-time加载bonding模块,如果加载模块失败,会发出警告。 # modprobe --first-time bonding 以上的命令仅加载bondiing模块为当前会话,服务器重启后模块不会自动加载。为了确保持续加载,创建/etc/modules-load.d/bonding.conf文件放置于文件夹/etc/modules-load.d目录中,确保每次服务器重启时加载bonding模块。 # echo "# Load thebonding kernel module at boot" > /etc/modules-load.d/bonding.conf # echo "bonding">> /etc/modules-load.d/bonding.conf 服务器重启之后确保bonding模块自动加载 [root@MiWiFi-R3-srvDesktop]# lsmod|grep bonding bonding136705 0 [root@MiWiFi-R3-srvDesktop]# 2.配置bonding 查看系统当前可用网卡,当前两块网卡上均无可用连接。 [root@MiWiFi-R3-srvDesktop]# nmcli device status DEVICE TYPESTATE CONNECTION eno16777736 ethernetdisconnected -- eno33554992 ethernetdisconnected -- lo loopback unmanaged-- [root@MiWiFi-R3-srvDesktop]# nmcli connection show NAME UUIDTYPE DEVICE 当前服务器网卡信息如下 [root@MiWiFi-R3-srvDesktop]# ifconfig eno16777736: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 ether 00:0c:29:51:e8:75 txqueuelen 1000 (Ethernet) RX packets 2227 bytes 216343 (211.2 KiB) RX errors 0 dropped 0overruns 0 frame 0 TX packets 109 bytes 10643 (10.3 KiB) TX errors 0dropped 0 overruns 0 carrier0 collisions 0 eno33554992:flags=4163<UP,SimSun;font-size:16px;"> ether 00:0c:29:51:e8:7f txqueuelen 1000 (Ethernet) RX packets 2633 bytes 300745 (293.6 KiB) TX packets 138 bytes 11748 (11.4 KiB) TX errors 0 dropped 0 overruns 0 carrier 0collisions 0 lo:flags=73<UP,LOOPBACK,RUNNING> mtu65536 inet 127.0.0.1 netmask 255.0.0.0 inet6 ::1 prefixlen 128scopeid 0x10<host> looptxqueuelen 0 (Local Loopback) RX packets 2 bytes 196 (196.0 B) TX packets 2 bytes 196 (196.0 B) 登陆图形界面,nmtui打开配置界面如下 [root@MiWiFi-R3-srvDesktop]#nmtui
点击add
bondàcreate进去bond配置界面
设置profile name及device名,选择add添加网卡,如下
设置profile name 为eth0,device设置为网卡eno16777736,点击ok。相同方法配置eth1,device设置为eno33554992。
配置完成后,返回主界面,设置mode为active-backup,设置primary设备为eno16777736。点击ok退出。
查看服务器当前配置 [root@MiWiFi-R3-srvDesktop]# cat /proc/net/bonding/mybond Ethernet Channel BondingDriver: v3.7.1 (April 27,2011) Bonding Mode: fault-tolerance(active-backup) Primary Slave: eno16777736(primary_reselect always) Currently Active Slave:eno16777736 MII Status: up MII Polling Interval (ms):100 Up Delay (ms): 0 Down Delay (ms): 0 Slave Interface: eno33554992 Speed: 1000 Mbps Duplex: full Link Failure Count: 0 Permanent HW addr:00:0c:29:51:e8:7f Slave queue ID: 0 Slave Interface: eno16777736 Speed: 1000 Mbps Permanent HW addr:00:0c:29:51:e8:75 [root@MiWiFi-R3-srvDesktop]# 查看网卡信息,eno16777736与eno33554992网卡mac地址相同 eno16777736:flags=6211<UP,SLAVE,MULTICAST> mtu 1500 ether 00:0c:29:51:e8:7f txqueuelen 1000 (Ethernet) RX packets 3626 bytes 343058 (335.0 KiB) TX packets 138 bytes 15571 (15.2 KiB) eno33554992:flags=6211<UP,0);">00:0c:29:51:e8:7f txqueuelen 1000 (Ethernet) RX packets 4034 bytes 428144 (418.1 KiB) RX errors 0 dropped 34overruns 0 frame 0 TX packets 139 bytes 11838 (11.5 KiB) mybond:flags=5187<UP,MASTER,SimSun;font-size:16px;"> inet 192.168.31.119 netmask 255.255.255.0 broadcast 192.168.31.255 inet6 fe80::20c:29ff:fe51:e87f prefixlen 64scopeid 0x20<link> ether 00:0c:29:51:e8:7f txqueuelen 0(Ethernet) RX packets 66 bytes 8172 (7.9 KiB) RX errors 0dropped 34 overruns 0 frame 0 TX packets 30 bytes 5018 (4.9 KiB) 再次查看当前设置状态 mybond bondconnected mybond eno16777736 ethernetconnected eth0 eno33554992 ethernetconnected eth1 当前设备的链接信息
3.bonding模式 mode= value balance-rr or 0 Sets a round-robin policy for faulttolerance and load balancing.Transmissions are received and sent outsequentially on each bonded slave interface beginning with the first oneavailable. (编辑:安卓应用网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |









