PVE 安装和编译 RTL8811 无线网卡

LIXI.FUN - PVE 安装和编译 RTL8811 无线网卡

前提配置

禁用 enterprise 的源

mv /etc/apt/sources.list.d/pve-enterprise.list /etc/apt/sources.list.d/pve-enterprise.list.bak

增加 非订阅用户 的源

这一步关乎能否下载 pve-headers,在编译无线网卡的标准教程中使用的是 linux-headers 而在 PVE 中是使用 pve-headers

# 先备份
cp /etc/apt/sources.list /etc/apt/sources.list.bak

修改 /etc/apt/sources.list 内容为

deb http://mirrors.aliyun.com/debian bullseye main contrib

deb http://mirrors.aliyun.com/debian bullseye-updates main contrib

# security updates
deb http://mirrors.aliyun.com/debian-security bullseye-security main contrib

# 这个就是 非订阅用户的源了
deb http://download.proxmox.com/debian/pve bullseye pve-no-subscription

安装编译需要的软件

apt install make gcc pve-headers-`uname -r` dkms usb-modeswitch wpasupplicant net-tools

下载驱动源码

mkdir -p ~/build
cd ~/build
git clone https://github.com/brektrou/rtl8821CU.git --depth 1

编译安装

cd rtl8831CU
./dkms-install.sh

无线网连接

wifi名称密码配置

适用于 WPA/WPA2-Personal 加密的无线网络,用手机可以查看需要连接的无线网络是否是这种类型加密。

# 回车之后,输入密码,再回车
wpa_passphrase 你的wifi的SSID >> /etc/wpa_supplicant/wpa_suppplicant.conf

可以查看下是否成功生成

cat /etc/wpa_supplicant/wpa_supplicant.conf

增加 interface 配置

编辑 /etc/network/interfaces 内容为

auto lo
iface lo inet loopback

# 增加 无线网卡
auto wlx你的网卡的mac地址
iface wlx你的网卡的mac地址 inet dhcp
        wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

# 有线网卡,但我没有插网线
iface enp1s0 inet manual

# 这是我用手机 usb 分享网络时用的
iface usb0 inet dhcp

# 桥接网卡,没有它,新建虚拟机没得搞
auto vmbr0
iface vmbr0 inet static
        address 10.10.10.1
        netmask 255.255.255.0
        bridge-ports none
        bridge-stp off
        bridge-fd 0

# 注意这里是定格的,不是 vmbr0 块里的内容
post-up         iptables -t nat -A POSTROUTING -s '10.10.10.0/24' -o wlx你的网卡的mac地址 -j MASQUERADE
post-down       iptables -t nat -D POSTROUTING -s '10.10.10.0/24' -o wlx你的网卡的mac地址 -j MASQUERADE

其中的 wlx你的网卡的mac地址 如果确认驱动安装好了的话,可以使用 ifconfig 进行查看。

重启网络服务

service networking restart

不出问题的话,无线网卡就已经能够使用了,新建虚拟机的时候也不会因为桥接网卡的问题无法启动。

  • 2
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

lixifun

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值