ubuntu开启bbr

Ubuntu开启BBR

(图片来源网络,侵删)

1. 什么是BBR

BBR(Bottleneck Bandwidth and Roundtrip propagation time)是一种网络拥塞控制算法,它可以提高网络传输速度和效率,在Ubuntu系统中,可以通过开启BBR来优化网络性能。

2. 开启BBR的步骤

2.1 安装依赖库

需要安装一些必要的依赖库,以便进行后续的操作,打开终端,输入以下命令:

sudo aptget update
sudo aptget install y iproute2 iputilsping

2.2 检查内核版本

确保你的Ubuntu系统内核版本支持BBR,输入以下命令查看内核版本:

uname r

如果内核版本大于等于4.9,那么支持BBR。

2.3 开启BBR

2.3.1 使用sysctl命令

输入以下命令,开启BBR:

sudo sysctl net.core.default_qdisc=fq
sudo sysctl net.ipv4.tcp_congestion_control=bbr

2.3.2 使用tc命令

输入以下命令,开启BBR:

sudo tc qdisc add dev eth0 root handle 1: bbr default 10
sudo tc filter add dev eth0 protocol ip parent 1: prio 1 u32 match ip src 0.0.0.0/0 flowid 1:1

注意:请将eth0替换为你的实际网卡名称。

2.4 验证BBR是否开启成功

输入以下命令,查看BBR是否已经开启:

sysctl net.ipv4.tcp_congestion_control

如果输出结果为net.ipv4.tcp_congestion_control = bbr,则表示BBR已经成功开启。

3. 单元表格

操作 命令
安装依赖库 sudo aptget updatesudo aptget install y iproute2 iputilsping
检查内核版本 uname r
使用sysctl命令开启BBR sudo sysctl net.core.default_qdisc=fqsudo sysctl net.ipv4.tcp_congestion_control=bbr
使用tc命令开启BBR sudo tc qdisc add dev eth0 root handle 1: bbr default 10sudo tc filter add dev eth0 protocol ip parent 1: prio 1 u32 match ip src 0.0.0.0/0 flowid 1:1
验证BBR是否开启成功 sysctl net.ipv4.tcp_congestion_control

发表评论

访客

◎欢迎参与讨论,请在这里发表您的看法和观点。