centos7升级内核 ,wireguard优化

一、centos7升级内核

uname -r 查看内核版本

升级前

 

 

 

升级后

 

 

参考链接: https://www.cnblogs.com/rick-zhang/p/14944510.html

1
2
3
4
5
6
7
8
9
10
11
12
13
# 启用 ELRepo 仓库
rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
rpm -Uvh http://www.elrepo.org/elrepo-release-7.0-2.el7.elrepo.noarch.rpm
yum --disablerepo="*" --enablerepo="elrepo-kernel" list available
yum --enablerepo=elrepo-kernel install kernel-ml
 
vi /etc/default/grub
修改GRUB_DEFAULT=0
 
# 重新创建内核配置
grub2-mkconfig -o /boot/grub2/grub.cfg
 
reboot

  

 

2、wireguard优化

内核升级后,wireguard无法启动,报错信息如下

 

 

1
2
3
4
5
6
# wg-quick up /etc/wireguard/wg0.conf
[#] ip link add wg0 type wireguard
RTNETLINK answers: Operation not supported
Unable to access interface: Protocol not supported
[#] ip link delete dev wg0
Cannot find device "wg0"

 

参考链接:https://www.wireguard.com/install/ 

重新安装后恢复

1
2
3
4
5
yum install yum-utils epel-release
yum-config-manager --setopt=centosplus.includepkgs=kernel-plus --enablerepo=centosplus --save
sed -e 's/^DEFAULTKERNEL=kernel$/DEFAULTKERNEL=kernel-plus/' -i /etc/sysconfig/kernel
yum install kernel-plus wireguard-tools
reboot

  

 

重新添加ip转发

1
2
3
4
5
vi /etc/sysctl.conf
net.ipv4.ip_forward=1
 
sysctl -p
echo 1 > /proc/sys/net/ipv4/ip_forward

  

 

posted on   mrqiao001  阅读(1536)  评论(0编辑  收藏  举报

相关博文:
阅读排行:
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 地球OL攻略 —— 某应届生求职总结
· 提示词工程——AI应用必不可少的技术
· Open-Sora 2.0 重磅开源!
· 周边上新:园子的第一款马克杯温暖上架
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

统计

点击右上角即可分享
微信分享提示