快速回忆
ibdev2netdev
lsmod |grep bond
modprobe bonding
lsmod |grep bond
echo +bond0 > /sys/class/net/bonding_masters #创建
ifconfig bond0
cat /proc/net/bonding/bond0
echo 4 > /sys/class/net/bond0/bonding/mode #设置LACP bonding模式
cat /proc/net/bonding/bond0
echo +eth0 > /sys/class/net/bond0/bonding/slaves #如果添加失败,可能是由于eth口并未成功down掉
ifconfig eth0 down
ifconfig eth1 down
echo +eth0 > /sys/class/net/bond0/bonding/slaves #如果添加失败,可能是由于eth口并未成功down掉
echo +eth1 > /sys/class/net/bond0/bonding/slaves
ifconfig bond0 192.168.1.101 #手动配置
dhclient bond0 #动态获取
ifconfig bond0 up #启动bonging口
背景
将两个portbond到一起,可以实现带宽倍增的效果。本文主要介绍了两种将两个网络端口绑定(bonding)以实现带宽倍增的方法。第一种方法通过sysfs文件配置,包括关闭网卡、启动bonding模块、创建bonding口并设置模式,最后将网卡加入bonding口并启动。第二种方法使用NetworkManager服务配置文件,通过创建bonding配置文件和从属网卡配置文件,重启网络服务并验证bonding接口状态。此外,还简要提及了使用nmicli配置bonding的步骤。注意这些操作均需root权限或sudo执行。
m 方法1:使用sysfs文件配置
假设网卡1有2个port分别是eth0和eth1
m.1 关闭2个网卡
如果是远程登录的卡注意会断网,要么带外操作要么其他网卡访问
如果不关闭,可能无法将网卡加入bond口
ifconfig eth0 down
ifconfig eth1 down
ifdown eth0 #如果是NetworkManager服务启动了
ifdown eth1
m.2 启动bonding模块
bonding模块是一个内核模块
modprobe bonding


最低0.47元/天 解锁文章

576

被折叠的 条评论
为什么被折叠?



