ICode9

精准搜索请尝试: 精确搜索
首页 > 系统相关> 文章详细

Centos7.9 端口聚合

2022-06-10 11:02:07  阅读:270  来源: 互联网

标签:sysconfig 聚合 network etc 端口 网卡 Centos7.9 bond0 bond


服务器型号: HP DL360P Gen8

操作系统 : centos 7.9 x64

 

Centos7.9多网卡配置端口聚合
1. 关闭NetworkManager服务
systemctl stop NetworkManager
systemctl disable NetworkManager

2. 加载bond模块
modprobe bonding miimon=100 mode=0
echo "alias bond0 bonding" >> /etc/modprobe.d/bond.conf
echo "options bond0 miimon=100 mode=0" >> /etc/modprobe.d/bond.conf

3. 配置网卡文件,以网卡eth0、eth1做端口聚合为例
创建网卡bond0的配置文件
vim /etc/sysconfig/network-scripts/ifcfg-bond0
# 添加以下配置,IP地址、掩码、网关按实际填写
DEVICE=bond0
BOOTPROTO=static
USERCTL=no
ONBOOT=yes
TYPE=Bond
BONDING_MASTER=yes
BONDING_OPTS="mode=0 miimon=100"
IPADDR=192.168.50.234
NETMASK=255.255.255.0
GATEWAY=192.168.50.254

#修改网卡eth1的配置文件
vim /etc/sysconfig/network-scripts/ifcfg-eno1
DEVICE=eno1
ONBOOT=yes
BOOTPROTO=none
USERCTL=no
MASTER=bond0
SLAVE=yes

#修改网卡eth2的配置文件
vim /etc/sysconfig/network-scripts/ifcfg-eno2
DEVICE=eno2
BOOTPROTO=none
ONBOOT=yes
USERCTL=no
MASTER=bond0
SLAVE=yes
4. 重启网络服务,确认网络是网卡速率;
systemctl restart network
ethtool bond0

 

执行脚本  ip和网卡名按需更改

 

#!/bin/sh
systemctl stop NetworkManager
systemctl disable NetworkManager
modprobe bonding miimon=100 mode=0
echo "alias bond0 bonding" >> /etc/modprobe.d/bond.conf
echo "options bond0 miimon=100 mode=0" >> /etc/modprobe.d/bond.conf
cat >/etc/sysconfig/network-scripts/ifcfg-bond0 <<EOF
DEVICE=bond0
BOOTPROTO=static
USERCTL=no
ONBOOT=yes
TYPE=Bond
BONDING_MASTER=yes
BONDING_OPTS="mode=0 miimon=100"
IPADDR=192.168.50.234
NETMASK=255.255.255.0
GATEWAY=192.168.50.254
DNS1=61.128.128.68 EOF cat >/etc/sysconfig/network-scripts/ifcfg-eno1 <<EOF DEVICE=eno1 ONBOOT=yes BOOTPROTO=none USERCTL=no MASTER=bond0 SLAVE=yes EOF cat >/etc/sysconfig/network-scripts/ifcfg-eno2 <<EOF DEVICE=eno2 ONBOOT=yes BOOTPROTO=none USERCTL=no MASTER=bond0 SLAVE=yes EOF systemctl restart network

 

 

 

 

感谢原地址: Centos7多网卡配置端口聚合(bond方式) - larry-peng - 博客园 (cnblogs.com)

标签:sysconfig,聚合,network,etc,端口,网卡,Centos7.9,bond0,bond
来源: https://www.cnblogs.com/lightsoft2021/p/16359690.html

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有