448 words
2 minutes
编译自己的 OpenWrt:从构建到基本配置
编译OpenWrt
-
拉取openwrt
-
切换到稳定版本(我使用的23.05)
必须使用稳定版本,如果使用SNAPSHOT版本,会导致各种错误发生
-
拉取argon
Terminal window cd openwrt/packagegit clone https://github.com/jerrykuku/luci-theme-argon.git -
根据官方文档配置环境
在
./scripts/feeds update -a或者./scripts/feeds install -a时,如果失败,则查看输出,下载缺失的包 -
在使用
make menuconfig时,需要注意一下事项-
基本设置
Target Image --> Kernel partition size --> 32MB # 在我编译的时候一直提示BIOS所剩空间很小,于是稍微调大了一些Target Image --> Root filesystem partition size --> 512MB # 太小会导致编译失败Target system --> x86Subtarget --> x86_64Target Profile --> Generic x86/64Kernel modules --> Network Support --> kmod-9pnetGlobal build setting --> Select all kernel module packages by default # 如果需要kernel module可以直接模块化挂载,不至于重新编译 -
使用WebUI以及argon
LuCI --> Collections --> luciLuCI --> Themes --> luci-theme-argon -
安装openvpn
LuCI --> Applications --> luci-app-openvpnLuCI --> Collections --> luci-ssl-opensslNetwork --> VPN --> openvpn-openssl -
安装V2raya
LuCI --> Applications --> luci-app-v2rayaNetwork --> IP Addresses and Names --> v2ray-geoipNetwork --> IP Addresses and Names --> v2ray-geosite
-
创建OpenWrt并进行基本配置
-
创建Openwrt VM
-
将
./bin/targets/x86/64/openwrt-x86-64-generic-ext4-combined.img.gz存入PVE的iso中 -
执行命令
qm importdisk VM_Id /var/lib/vz/template/iso/openwrt-23.05-x86-64-generic-ext4-combined.img local-lvm -
设置开机引导顺序
-
启动后访问Web UI
-
-
配置防火墙
在Openwrt的WebUI上配置NAT和Forward。NAT使用MASQUERADE模式,端口转发设置为全部允许
-
开启
quem-guest-agent执行命令
opkg update && opkg install quem-ga && reboot -
配置Nextdns
按照官方引导配置
dnsmasq.conf即可如果使用的不是稳定版本可能会导致DNS不稳定
-
配置V2ray
按照官方的手册进行配置
在配置好代理后,所有通过代理的主机都需要设置ssh才能使用github的ssh功能,具体设置参照文档
编译自己的 OpenWrt:从构建到基本配置
https://blog.emilejones.top/posts/infrastructure/编译自己的openwrt/
评论