甲骨文ARM DD Debian10 并升级内核开启内核自带的 BBR

2021年06月07日 · 默认分类 · 技术分享 · 623次阅读
参考:Hostloc 脚本来源:Github

安装Debian10:

安装依赖

root@loli:~# apt-get update -y && apt-get install -y xz-utils openssl gawk file wget screen && screen -S os

下载脚本

root@loli:~# curl -fLO https://raw.githubusercontent.com/bohanyang/debi/master/debi.sh && chmod a+rx debi.sh

运行脚本(以下命令选项开启了 BBR;设置了网卡名称形式是 eth0 而不是 ens3 这种;如果不是 ARM 架构,还可以添加 --cloud-kernel 使用轻量版内核;netdoge.com为默认密码可自行修改)

root@loli:~# ./debi.sh --cdn --network-console --ethx --bbr --user root --password netdoge.com

没有报错重启等待10分钟以后再连接(如果提示密码不对就是没有DD完,等就行。)

root@loli:~# shutdown -r now

升级内核

安装依赖

root@loli:~# apt-get update && apt-get install -y lsb-release && apt-get clean all && apt update && apt-get install --reinstall ca-certificates

安装方法1(推荐):

修改更新源

root@loli:~# echo -e "deb http://http.debian.net/debian stretch-backports main\ndeb-src http://http.debian.net/debian stretch-backports main" | tee /etc/apt/sources.list.d/sources.list

更新package

root@loli:~# apt-get update && apt-get dist-upgrade

安装内核:

root@loli:~# apt -t $(lsb_release -sc)-backports install linux-image-$(dpkg --print-architecture) linux-headers-$(dpkg --print-architecture) -y
因为在补充方法2的时候我的甲骨文已经被删号了,所以用的amd64的内核做的演示。请自行修改!!!

安装方法2:

修改更新源(下面我拿腾讯云的源做示范,觉得慢可以自行修改)
root@loli:~# vi /etc/apt/sources.list
然后把下面的内容给粘贴进去(先备份)
deb http://mirrors.ustc.edu.cn/debian stable main contrib non-free
# deb-src http://mirrors.ustc.edu.cn/debian stable main contrib non-free
deb http://mirrors.ustc.edu.cn/debian stable-updates main contrib non-free
# deb-src http://mirrors.ustc.edu.cn/debian stable-updates main contrib non-free

# deb http://mirrors.ustc.edu.cn/debian stable-proposed-updates main contrib non-free
# deb-src http://mirrors.ustc.edu.cn/debian stable-proposed-updates main contrib non-free

更新package

root@loli:~# apt-get update && apt-get dist-upgrade

搜索内核

root@loli:~# apt-cache search linux-image

然后在选择下面你需要安装的内核。如:

root@loli:~# apt-get install linux-image-4.19.0-0.bpo.9-cloud-amd64 -y

重启系统

root@loli:~# reboot

检查内核

root@loli:~# uname -r

方法二在重启之后可能用的还是以前的老内核,我们需要修改一下内核的启动顺序

查看当前内核的启动顺序

root@loli:~# cat /boot/grub/grub.cfg

修改grub文件(我拿我方法2里面的X86内核来做演示,你记得修改。)

root@loli:~# vim /etc/default/grub

把里面的GRUB_DEFAULT=0修改为

GRUB_DEFAULT="Advanced options for Debian GNU/Linux>Debian GNU/Linux, with Linux 4.19.0-0.bpo.9-cloud-amd64"

其中的Advanced options for Debian GNU/Linux是一级菜单,Debian GNU/Linux, with Linux 4.19.0-0.bpo.9-cloud-amd64是二级菜单,中间用>连接。
然后输入:wq保存退出
更新修改后的grub

root@loli:~# update-grub

现在重新 cat /boot/grub/grub.cfg 就可以看到已经更新好了
重启后输入 uname -r 也可以看到当前使用的内核。

开启内核自带的BBR

修改系统变量
root@loli:~# echo "net.core.default_qdisc=fq" >> /etc/sysctl.conf
root@loli:~# echo "net.ipv4.tcp_congestion_control=bbr" >> /etc/sysctl.conf
保存并生效

root@loli:~# sysctl -p

接下来看看我们的内核是否已开启BBR

root@loli:~# sysctl net.ipv4.tcp_available_congestion_control

如果这样显示的话就是已经开启了
net.ipv4.tcp_available_congestion_control = reno cubic bbr
查看BBR是否已经启动了

root@loli:~# lsmod | grep bbr

如果这样显示的话就是已经启动了
tcp_bbr 20480 1

标签:甲骨文,ARM,Debian,Linux,BBR

最后编辑于:2021-09-04 22:42

留言