服务器编译路由器openwrt固件(lean),功能可自选,放心无后门

lede仓库地址:https://github.com/coolsnowwolf/lede

一、使用win10自己编译lean的openwrt

使用 win10 自己编译 lean 大大的 openwrt

一、打开 win10 内置的 linux 功能,可能家庭版的 win10 会没有,专业版肯定有的。


进入设置,应用,应用和功能,可选功能


![sh2.png](https://img.blog.jiangqing.xyz/img/202309141706378.png/sh2.png)


![sh2.png](https://img.blog.jiangqing.xyz/img/202309141708082.png/sh2.png)


![sh2.png](https://img.blog.jiangqing.xyz/img/202309141716882.png/sh2.png)


二、在应用商店安装 Ubuntu


![sh2.png](https://img.blog.jiangqing.xyz/img/202309141716988.png/sh2.png)


打开 Ubuntu,首次运行会提示输入用户名和密码,按提示做就可以了。


![sh2.png](https://img.blog.jiangqing.xyz/img/202309141717026.png/sh2.png)


三、下载编译 openwrt,全程最好全局开打倒美帝


1、打开 lean openwrt 的仓库


> [coolsnowwolf/lede: Lean’s OpenWrt source (github.com)](https://github.com/coolsnowwolf/lede)


2、在 ubuntu 中输入


```javascript
sudo apt-get update
```


_复制代码_


这里会要求输密码,输密码的时候是不会显示任何东西的。


![sh2.png](https://img.blog.jiangqing.xyz/img/202309141717191.png/sh2.png)


运行完再输入


```javascript
sudo apt-get -y install build-essential asciidoc binutils bzip2 gawk gettext git libncurses5-dev libz-dev patch python3 python2.7 unzip zlib1g-dev lib32gcc1 libc6-dev-i386 subversion flex uglifyjs git-core gcc-multilib p7zip p7zip-full msmtp libssl-dev texinfo libglib2.0-dev xmlto qemu-utils upx libelf-dev autoconf automake libtool autopoint device-tree-compiler g++-multilib antlr3 gperf wget curl swig rsync
```


_复制代码_


运行完再输入


```javascript
git clone https://github.com/coolsnowwolf/lede
```


_复制代码_


然后


```javascript
cd lede
```


**这个时候需要修改一下配置文件,显示反抗帝国主义。**


**资源管理器进入**


```javascript
C:\Users\用户名\AppData\Local\Packages\CanonicalGroupLimited.Ubuntu18.04onWindows_一堆字母数字\LocalState\rootfs\home\用户名\lede

#**(建议把这个目录固定到快速访问)**
```


![sh2.png](https://img.blog.jiangqing.xyz/img/202309141720079.png/sh2.png)


**用记事本打开** **`feeds.conf.default`** **文件,删除最后一行前面的 “****`#`****” 号。如果不做这步,就不能召唤航母打美帝。**


![sh2.png](https://img.blog.jiangqing.xyz/img/202309141720799.png/sh2.png)


分别输入,这几部等候时间会比较长,一定要全程反对帝国主义


```javascript
./scripts/feeds update -a
```


```javascript
./scripts/feeds install -a
```


```javascript
make menuconfig
```


顺利的话,会进入这个界面


![sh2.png](https://img.blog.jiangqing.xyz/img/202309141721939.png/sh2.png)


这里仅根据我常用的配置举例


> 💡 键盘上下移动光标,回车进入菜单,esc 返回,y 选择,n 去除选择。


`Target System` 和 `subtarge` 选 `x86`


`Target Images`,默认会勾选虚拟机的 `vmdk` 格式,如果不需要的话,可以按 N 取消,再按两下 esc 退出。


![sh2.png](https://img.blog.jiangqing.xyz/img/202309141721325.png/sh2.png)


**如果需要 IPv6 支持,需要在 Extra packages 里勾选 ipv6helper,自动会把所有 ipv6 需要的组件都选上的,不需要再去别的地方选了。**


现在宽带都支持 ipv6 了,我是上海移动宽带,开启 ipv6 后没有发现什么不正常的地方,美帝也能打。


![sh2.png](https://img.blog.jiangqing.xyz/img/202309141721102.png/sh2.png)


![sh2.png](https://img.blog.jiangqing.xyz/img/202309141721983.png/sh2.png)


最重要的都在 Luci 里设置,如果不知道怎么选,建议就默认。


**这个帖子里有比较详细的插件说明**[**OpenWrt 编译 LuCI-> Applications 添加插件应用说明 - L 大【2021.1.20】 - OPENWRT 专版 - 恩山无线论坛 - Powered by Discuz! (right.com.cn)**](https://www.right.com.cn/forum/thread-344825-1-1.html)


![sh2.png](https://img.blog.jiangqing.xyz/img/202309141722015.png/sh2.png)


Themes 是主题,个人觉得默认主题就可以了, 路由器这都后台又不是天天要看到的。


![sh2.png](https://img.blog.jiangqing.xyz/img/202309141722012.png/sh2.png)


`Applications` 是最重要的,几乎所有的插件都在里面。N 是取消选中,Y 是选中。


打倒美帝


![sh2.png](https://img.blog.jiangqing.xyz/img/202309141722992.png/sh2.png)


京东签到


![sh2.png](https://img.blog.jiangqing.xyz/img/202309141722063.png/sh2.png)


激活 office 的 KMS


![sh2.png](https://img.blog.jiangqing.xyz/img/202309141722585.png/sh2.png)


如果之前看过我的帖子,用爱快虚拟机装 openwrt 的话,


[爱快虚拟机装 openwrt,流控科学两不误。修复终端监控显示问题 - 软路由,x86 系统,openwrt(x86) 等 - 恩山无线论坛 - Powered by Discuz! (right.com.cn)](https://www.right.com.cn/forum/thread-2640416-1-1.html)


需要在 network 里安装 snmpd


![sh2.png](https://img.blog.jiangqing.xyz/img/202309141723254.png/sh2.png)


![sh2.png](https://img.blog.jiangqing.xyz/img/202309141723112.png/sh2.png)


全部选中完成后,按两下 esc,再按回车保存退出。


![sh2.png](https://img.blog.jiangqing.xyz/img/202309141723068.png/sh2.png)


配置完就可以编译啦,第一次编译的时候比较长


**输入** **`source /etc/environment`****,这一步很重要,不输这段代码肯定会报错。**


```javascript
source /etc/environment
```


保持全局反美帝,根据网速,下载时间挺长的。


```javascript
make -j8 download V=s
```


最后一步就是编译了。


```javascript
make -j1 V=s
```


**这个错就是没有输** **`source /etc/environment`** **造成的**


![sh2.png](https://img.blog.jiangqing.xyz/img/202309141723923.png/sh2.png)


编译成功


![sh2.png](https://img.blog.jiangqing.xyz/img/202309141723243.png/sh2.png)


文件放在 `C:\Users\huang\AppData\Local\Packages\CanonicalGroupLimited.Ubuntu18.04onWindows_79rhkp1fndgsc\LocalState\rootfs\home\huang\lede\bin\targets\x86\64` 目录里


![sh2.png](https://img.blog.jiangqing.xyz/img/202309141724402.png/sh2.png)


三、刷机


默认登陆 IP 192.168.1.1, 密码 password


如果是虚拟机,直接上传镜像就可以了。


实体机可以参考这两个帖子,用 dd 刷机,心里感觉比在 web 界面里直接升级干净。


[【网络教程】如何使用 dd 命令方式刷机安装软路由固件,如果使用 dd 命令方式升级软路由_xiaoqiangclub 的博客 - CSDN 博客](https://blog.csdn.net/xiaoqiangclub/article/details/106073915)


[如何使用 dd 命令刷固件 - LEDE/OpenWRT - KoolShare - 源于玩家 服务玩家](https://koolshare.cn/thread-179791-1-1.html)


![sh2.png](https://img.blog.jiangqing.xyz/img/202309141724433.png/sh2.png)


四、第二次编译


第一次编译成功,以后再编译速度就很快了,一般 20 分钟搞定


**记得先要输** **`source /etc/environment`**


如果不需要更改配置:


```javascript
source /etc/environment
cd lede
git pull
./scripts/feeds update -a && ./scripts/feeds install -a make defconfig
make -j8 download
6make -j(((nproc) + 1)) V=s
```


_复制代码_


如果需要更改:


```shell
source /etc/environment
cd lede
git pull
./scripts/feeds update -a && ./scripts/feeds install -a
rm -rf ./tmp && rm -rf .config
make menuconfig
make -j8 download
make -j(((nproc) + 1)) V=s
```

二、路由器系列编译选择(斐讯K2P为例)

斐讯 K2P 编译 OpenWRT 教程 - 编译属于自己的固件

**准备工具**


**1.Ubuntu20.04 LTS(debian系列均可)**


**2. 科学 * 上网环境**


**3.** [**Openwrt 源码**](https://github.com/coolsnowwolf/lede)


**部署编译环境注意事项**


**不要用 root 用户进行编译!!!**


**1. 安装必要软件**


```shell
sudo apt-get update
```


```shell
 sudo apt-get -y install build-essential asciidoc binutils bzip2 gawk gettext git libncurses5-dev libz-dev patch python3 python2.7 unzip zlib1g-dev lib32gcc1 libc6-dev-i386 subversion flex uglifyjs git-core gcc-multilib p7zip p7zip-full msmtp libssl-dev texinfo libglib2.0-dev xmlto qemu-utils upx libelf-dev autoconf automake libtool autopoint device-tree-compiler g++-multilib antlr3 gperf wget curl swig rsync
```


**2. 下载 OpenWRT 源码**


```shell
git clone [https://github.com/coolsnowwolf/lede](https://github.com/coolsnowwolf/lede)
```


**3. 添加违禁软件插件**


```shell
cd lede
nano feeds.conf.default
把 #src-git helloworld https://github.com/fw876/helloworld 前面的 # 注释删除并保存
```


**4. 更新配置**


```shell
./scripts/feeds update -a
./scripts/feeds install -a
```


**5. 选择K2P,配置编译文件**


```shell
make menuconfig
Target System 选择 **MediaTek Ralink MIPS**
Subtarget 选择 **MT7621 based boards**
Target Profile 选择 **Phicomm K2P**
```


**添加插件**


```shell
LuCI -> Applications
```


**换主题**


```shell
LuCI -> Themes
```


推荐 Argon 主题 好看!


**6. 保存配置文件**


选中 save 回车保存文件, 文件名为 .config


**7. 修改默认 IP 地址**


```shell
/package/base-files/files/bin/config_generate
```


修改里面唯一的 192.168.1.1 即可


**8. 编译固件**


下载编译所需的 dl 库


```shell
make download -j16
```


```shell
make -j1 V=s 
```


开始编译 (-j1 后面是线程数。第一次编译推荐用单线程 ***实测16线程也没影响**)


编译漫长, 静静等待即可


如编译过程中无报错 你可以在 `./bin/targets/ramips/mt7621` 目录下找到编译好的固件


固件名


> 💡 penwrt-ramips-mt7621-k2p-squashfs-sysupgrade.bin


**刷入固件后如果出现不能开机的情况,可以尝试将闪存布局从 公版 改为 斐讯!!!**


**成功刷入固件开机后 强烈建议 恢复出厂设置一次, 也许能解决不少问题。**

LuCI仓库 -> Applications 插件应用说明

> 💡 2022.11.28 更新 !!!


```shell
make menuconfig  进入定制界面
```


进入编译选项配置界面,. 按照需要配置.(‘***’ 代表编入固件,‘M’ 表示编译成模块或者 IPK 包, ‘空’不编译**)


注:应用后面标记 “


---


” 为最近新添加;标记 “ **!** ” 与其他插件依赖或冲突。


---


```shell
LuCI ---> Applications ---> luci-app-accesscontrol  #访问时间控制
LuCI ---> Applications ---> luci-app-acme  #ACME自动化证书管理环境(丢弃)
LuCI ---> Applications ---> luci-app-adblock   #ADB广告过滤
LuCI ---> Applications ---> luci-app-adbyby-plus  #广告屏蔽大师Plus +
LuCI ---> Applications ---> luci-app-adbyby   #广告过滤大师(丢弃)
LuCI ---> Applications ---> luci-app-adguardhome  #AdGuard home广告过滤(Le库以外的插件)
LuCI ---> Applications ---> luci-app-adkill   #广告过滤(丢弃)
LuCI ---> Applications ---> luci-app-advanced-reboot  #Linksys高级重启
LuCI ---> Applications ---> luci-app-advancedsetting  #系统高级设置(Le库以外的插件)
LuCI ---> Applications ---> luci-app-ahcp  #Ad-Hoc配置协议(AHCP) ipv6 and 双栈 自动配置协议 !
LuCI ---> Applications ---> luci-app-airplay2   #Apple AirPlay2 AirPlay无损音乐推流(安卓+IOS)
LuCI ---> Applications ---> luci-app-aliddns   #阿里DDNS客户端(丢弃,集成至ddns)
LuCI ---> Applications ---> luci-app-aliyundrive-fuse  #阿里云盘FUSE磁盘挂载  *
LuCI ---> Applications ---> luci-app-aliyundrive-webdav  #阿里云盘 WebDAV 服务
LuCI ---> Applications ---> luci-app-amule  #aMule下载工具 !
LuCI ---> Applications ---> luci-app-argon-config  #Argon主题配置插件(Le库以外的插件)
LuCI ---> Applications ---> luci-app-aria2 # Aria2下载工具
LuCI ---> Applications ---> luci-app-arpbind  #IP/MAC绑定
LuCI ---> Applications ---> luci-app-asterisk  #支持Asterisk电话服务器
LuCI ---> Applications ---> luci-app-attendedsysupgrade  #固件更新升级相关
LuCI ---> Applications ---> luci-app-autoreboot  #支持计划重启
LuCI ---> Applications ---> luci-app-baidupcs-web  #百度网盘管理
LuCI ---> Applications ---> luci-app-bcp38  #BCP38网络入口过滤(不确定)
LuCI ---> Applications ---> luci-app-bird1-ipv4  #对Bird1-ipv4的支持
LuCI ---> Applications ---> luci-app-bird1-ipv6  #对Bird1-ipv6的支持
LuCI ---> Applications ---> luci-app-bird4   #Bird 4(未知)(丢弃)
LuCI ---> Applications ---> luci-app-bird6   #Bird 6(未知)(丢弃)
LuCI ---> Applications ---> luci-app-bmx6  #BMX6路由协议
LuCI ---> Applications ---> luci-app-bmx7  #BMX7路由协议(丢弃)
LuCI ---> Applications ---> luci-app-caldav  #联系人(丢弃)
LuCI ---> Applications ---> luci-app-cifs-mount   #CIFS/SMB挂载设置
LuCI ---> Applications ---> luci-app-cifsd  #CIFS/SMB网络共享
LuCI ---> Applications ---> luci-app-cjdns  #加密IPV6网络相关
LuCI ---> Applications ---> luci-app-clamav  #ClamAV杀毒软件
LuCI ---> Applications ---> luci-app-clash  #Clash客户端(Le库以外的插件)
LuCI ---> Applications ---> luci-app-commands  #Shell命令模块
LuCI ---> Applications ---> luci-app-cshark  #CloudShark捕获工具
LuCI ---> Applications ---> luci-app-dawn  #分布式AP管理程序
LuCI ---> Applications ---> luci-app-ddns   #动态域名 DNS(集成阿里DDNS客户端)
LuCI ---> Applications ---> luci-app-diag-core   #core诊断工具
LuCI ---> Applications ---> luci-app-diskman   #磁盘管理工具
    luci-app-diskman ---> Include btrfs-progs   #新型的写时复制 (COW)
    luci-app-diskman ---> Include lsblk   #lsblk命令 用于列出所有可用块设备的信息
    luci-app-diskman ---> Include mdadm   #mdadm命令 用于创建、管理、监控RAID设备的工具
    luci-app-diskman ---> Include kmod-md-raid456   #RAID 4,5,6 驱动程序模块(丢弃)
    luci-app-diskman ---> Include kmod-md-linear   #RAID 驱动程序模块(丢弃)
LuCI ---> Applications ---> luci-app-dnscrypt-proxy  #DNSCrypt解决DNS污染
LuCI ---> Applications ---> luci-app-dnsfilter  #DNSFilter基于DNS的广告过滤
LuCI ---> Applications ---> luci-app-dnsforwarder  #DNSForwarder防DNS污染
LuCI ---> Applications ---> luci-app-dnspod  #DNSPod动态域名解析(丢弃)
LuCI ---> Applications ---> luci-app-docker  #Docker容器
LuCI ---> Applications ---> luci-app-dockerman  #Dockerman容器  *
LuCI ---> Applications ---> luci-app-dump1090  #民航无线频率(不确定)
LuCI ---> Applications ---> luci-app-dynapoint  #DynaPoint(未知)
LuCI ---> Applications ---> luci-app-e2guardian   #Web内容过滤器
LuCI ---> Applications ---> luci-app-easymesh   #简单MESH(可有线+无线回程)
LuCI ---> Applications ---> luci-app-eqos  #基于IP地址限速(Le库以外的插件)
LuCI ---> Applications ---> luci-app-familycloud   #家庭云盘(丢弃)
LuCI ---> Applications ---> luci-app-fileassistant   #文件管理助手(Le库以外的插件)
LuCI ---> Applications ---> luci-app-filetransfer  #文件传输(可web安装ipk包)
LuCI ---> Applications ---> luci-app-firewall   #添加防火墙
LuCI ---> Applications ---> luci-app-flowoffload  #Turbo ACC网络加速(集成FLOW,BBR,NAT,DNS(丢弃,移至TurboACC)
LuCI ---> Applications ---> luci-app-freifunk-diagnostics   #freifunk组件 诊断(未知)(丢弃)
LuCI ---> Applications ---> luci-app-freifunk-policyrouting  #freifunk组件 策略路由(未知)(丢弃)
LuCI ---> Applications ---> luci-app-freifunk-widgets  #freifunk组件 索引(未知)(丢弃)
LuCI ---> Applications ---> luci-app-frpc   #内网穿透Frp客户端
LuCI ---> Applications ---> luci-app-frps   #内网穿透Frp服务端
LuCI ---> Applications ---> luci-app-fwknopd  #Firewall Knock Operator服务器
LuCI ---> Applications ---> luci-app-guest-wifi   #WiFi访客网络
LuCI ---> Applications ---> luci-app-gfwlist   #GFW域名列表(丢弃)
LuCI ---> Applications ---> luci-app-go-aliyundrive-webdav   #阿里云盘webdav协议(文件管理/同步等) (丢弃)
LuCI ---> Applications ---> luci-app-gost  #隐蔽的https代理(Le库以外的插件)
LuCI ---> Applications ---> luci-app-haproxy-tcp   #HAProxy负载均衡-TCP
LuCI ---> Applications ---> luci-app-hd-idle  #硬盘休眠
LuCI ---> Applications ---> luci-app-hnet  #Homenet Status家庭网络控制协议
LuCI ---> Applications ---> luci-app-https-dns-proxy  #通过HTTPS代理为DNS提供Web UI
LuCI ---> Applications ---> luci-app-ipsec-server  #服务器 IPSec  *
LuCI ---> Applications ---> luci-app-ipsec-virtual**d  #virtual**服务器 IPSec
LuCI ---> Applications ---> luci-app-jd-dailybonus  #京东签到服务(丢弃)
LuCI ---> Applications ---> luci-app-kodexplorer  #KOD可道云私人网盘(与vnStat冲突 ! )
LuCI ---> Applications ---> luci-app-kooldns  #virtual**服务器 ddns替代方案(丢弃)
LuCI ---> Applications ---> luci-app-koolproxy  #KP去广告(丢弃)
LuCI ---> Applications ---> luci-app-lxc   #LXC容器管理
LuCI ---> Applications ---> luci-app-meshwizard #网络设置向导(丢弃)
LuCI ---> Applications ---> luci-app-minidlna   #完全兼容DLNA / UPnP-AV客户端的服务器软件
LuCI ---> Applications ---> luci-app-mjpg-streamer   #兼容Linux-UVC的摄像头程序
LuCI ---> Applications ---> luci-app-mosdns   #MosDNS转发器  *
LuCI ---> Applications ---> luci-app-mtwifi  #MTWiFi驱动的支持 (丢弃)
LuCI ---> Applications ---> luci-app-mmc-over-gpio   #添加SD卡操作界面(丢弃)
LuCI ---> Applications ---> luci-app-multiwan   #多拨虚拟网卡(丢弃,移至syncdial)
LuCI ---> Applications ---> luci-app-mwan   #MWAN负载均衡(丢弃)
LuCI ---> Applications ---> luci-app-music-remote-center   #PCHiFi 数字转盘遥控
LuCI ---> Applications ---> luci-app-mwan3   #MWAN3负载均衡
LuCI ---> Applications ---> luci-app-mwan3helper   #MWAN3分流助手
LuCI ---> Applications ---> luci-app-n2n_v2   #N2N内网穿透 N2N v2 virtual**服务
LuCI ---> Applications ---> luci-app-netdata  #Netdata实时监控(图形化)
LuCI ---> Applications ---> luci-app-nfs   #NFS网络共享
LuCI ---> Applications ---> luci-app-nft-qos  #QOS流控 Nftables版
LuCI ---> Applications ---> luci-app-ngrokc  #Ngrok 内网穿透(丢弃)
LuCI ---> Applications ---> luci-app-nlbwmon   #网络带宽监视器
LuCI ---> Applications ---> luci-app-noddos  #NodDOS Clients 阻止DDoS攻击
LuCI ---> Applications ---> luci-app-nps   #内网穿透nps
LuCI ---> Applications ---> luci-app-ntpc   #NTP时间同步服务器
LuCI ---> Applications ---> luci-app-ocserv  #OpenConnect virtual**服务
LuCI ---> Applications ---> luci-app-olsr  #OLSR配置和状态模块
LuCI ---> Applications ---> luci-app-olsr-services  #OLSR服务器
LuCI ---> Applications ---> luci-app-olsr-viz   #OLSR可视化
LuCI ---> Applications ---> luci-app-ocserv   #OpenConnect virtual**服务(丢弃)
LuCI ---> Applications ---> luci-app-omcproxy  #嵌入式IGMPv3和MLDv2组播代理  *
LuCI ---> Applications ---> luci-app-openclash  #运行在OpenWrt上的Clash代理客户端(Le库以外的插件)
LuCI ---> Applications ---> luci-app-openvirtual**  #Openvirtual**客户端
LuCI ---> Applications ---> luci-app-openvirtual**-server  #易于使用的Openvirtual**服务器 Web-UI
LuCI ---> Applications ---> luci-app-oscam   #OSCAM服务器(丢弃)
LuCI ---> Applications ---> luci-app-p910nd   #打印服务器模块
LuCI ---> Applications ---> luci-app-pagekitec   #Pagekitec内网穿透客户端
LuCI ---> Applications ---> luci-app-“师夷长技以制夷”  #“师夷长技以制夷”(Li大佬插件)
    Configuration ---> Include Brook  #Brook代理(跨平台强加密且不可检测代理)
    Configuration ---> Include china-dns-NG  #防污染DNS服务
    Configuration ---> Include Haproxy  #HAProxy  #HAProxy负载均衡
    Configuration ---> Include Hysteria  #Hysteria双边加速工具
    Configuration ---> Include Kcptun  #Kcptun双边加速工具
    Configuration ---> Include NaiveProxy  #NaiveProxy代理(Chrome网络堆栈伪装流量)
    Configuration ---> Include PDNSD  #DNS服务器
    Configuration ---> Include SS Libev Client  #SS Libev客户端(轻量级)
    Configuration ---> Include SS Libev Server  #SS Libev服务端(轻量级)
    Configuration ---> Include SS Rust Client  #SS Rust客户端(负载均衡/探测延迟)
    Configuration ---> Include “师夷长技以制夷” Libev Client  #“师夷长技以制夷” Libev客户端(轻量级)
    Configuration ---> Include “师夷长技以制夷” Libev Server  #“师夷长技以制夷” Libev服务端(轻量级)
    Configuration ---> Include Simple-Obfs (SS plugin)  #simple-Obfs简单混淆工具(Nginx)
    Configuration ---> Include Trojan_GO  #Trojan_GO代理(直接模仿协议HTTPS)
    Configuration ---> Include Trojan_Plus  #Trojan_Plus代理(直接模仿协议HTTPS)
    Configuration ---> Include “师夷长技以制夷”  #“师夷长技以制夷”代理
    Configuration ---> Include “师夷长技以制夷”-plugin (SS plugin)  #SS “师夷长技以制夷”插件(WebSocket+TLS )
    Configuration ---> Include Xray  #Xray代理(XTLS)
    Configuration ---> Include Xray-Plugin (SS Plugin)  #SS Xray插件(WebSocket+TLS )   *
    Configuration ---> Include Dns2socks  #DNS服务器(丢弃)
    Configuration ---> Include “师夷长技以制夷”2  #“师夷长技以制夷”2代理(透明TCP定向Socks/HTTPS代理服务器)(丢弃)
    Configuration ---> Include SS  #SS代理(丢弃)
    Configuration ---> Include SS Server  #SS服务器(丢弃)
    Configuration ---> Include SS Rust (AEAD ciphers only)  #“师夷长技以制夷”UST代理(AEAD加密)(丢弃)
    Configuration ---> Include “师夷长技以制夷”   #“师夷长技以制夷”代理(丢弃)
    Configuration ---> Include ShSR Server  #“师夷长技以制夷”服务器(丢弃)
    Configuration ---> Include Https DNS Proxy(DoH)  #HttpsDNS服务(丢弃)
LuCI ---> Applications ---> luci-app-pgyvirtual**  #蒲公英virtual**   *
LuCI ---> Applications ---> luci-app-phtunnel  #花生壳PHTunnel内网穿透   *
LuCI ---> Applications ---> luci-app-polipo  #Polipo代理(是一个小型且快速的网页缓存代理)
LuCI ---> Applications ---> luci-app-pppoe-relay  #PPPoE NAT穿透 点对点协议(PPP)
LuCI ---> Applications ---> luci-app-p p t p-server  #virtual**服务器 p p t p
LuCI ---> Applications ---> luci-app-privoxy  #Privoxy网络代理(带过滤无缓存)
LuCI ---> Applications ---> luci-app-ps3netsrv  #PS3 NET服务器(用于加载蓝光/游戏ISO/PKG)
LuCI ---> Applications ---> luci-app-pushbot  #全能推送(钉钉推送,企业微信推送,Bark,PushPlus推送)
LuCI ---> Applications ---> luci-app-qbittorrent  #BT下载工具(qBittorrent)
    Build Version Selection (Static Build)  ---> Static Build  #选择静态编译版本
    Build Version Selection (Static Build)  ---> Dynamic Build  #选择动态编译版本
LuCI ---> Applications ---> luci-app-qbittorrent-simple  #BT下载工具(qBittorrent)简化版   *
    Build Version Selection (Static Build)  ---> Static Build  #选择静态编译版本
    Build Version Selection (Static Build)  ---> Dynamic Build  #选择动态编译版本
LuCI ---> Applications ---> luci-app-qos   #流量服务质量(QoS)流控
LuCI ---> Applications ---> luci-app-radicale   #CalDAV/CardDAV同步工具
LuCI ---> Applications ---> luci-app-ramfree  #释放内存
LuCI ---> Applications ---> luci-app-rclone  #命令行云端同步工具
    Include rclone-webui  #Rclone界面
    Include rclone-ng (another webui)  #Rclone另一个界面
    Include fuse-utils (mount cloud storage)  #fuse-utils(挂载云存储)(丢弃)
LuCI ---> Applications ---> luci-app-rp-pppoe-server  #Roaring Penguin PPPoE Server 服务器
LuCI ---> Applications ---> luci-app-samba   #网络共享(Samba)
LuCI ---> Applications ---> luci-app-samba4   #网络共享(Samba4)
LuCI ---> Applications ---> luci-app-serverchan   #微信/请不要发布这类群,谢谢推送的插件
LuCI ---> Applications ---> luci-app-sfe  #Turbo ACC网络加速(丢弃,移至TurboACC)
LuCI ---> Applications ---> luci-app-“师夷长技以制夷”   #SS“师夷长技以制夷”(丢弃)
LuCI ---> Applications ---> luci-app-“师夷长技以制夷”-libes  #SS-libev服务端
LuCI ---> Applications ---> luci-app-shairplay  #支持AirPlay功能
LuCI ---> Applications ---> luci-app-siitwizard  #SIIT配置向导  SIIT-Wizzard
LuCI ---> Applications ---> luci-app-simple-adblock  #简单的广告拦截
LuCI ---> Applications ---> luci-app-smartdns  #SmartDNS本地服务器(丢弃)
LuCI ---> Applications ---> luci-app-socat  #Socat多功能的网络工具(端口转发)   *
LuCI ---> Applications ---> luci-app-softethervirtual**  #SoftEther virtual**服务器  NAT穿透
LuCI ---> Applications ---> luci-app-splash  #Client-Splash是无线MESH网络的一个热点认证系统
LuCI ---> Applications ---> luci-app-sqm  #流量智能队列管理(QOS)
LuCI ---> Applications ---> luci-app-squid   #Squid代理服务器
LuCI ---> Applications ---> luci-app-“师夷长技以制夷”-plus   #“师夷长技以制夷”“师夷长技以制夷”Plus+(Le大佬插件)
    SS Client Selection (SS-libev)   ---> None  #不选  *
    SS Client Selection (SS-libev)   ---> SS-libev  #选择 SS Libev,C语言版(轻量级) *
    SS Client Selection (SS-libev)   ---> “师夷长技以制夷”ust  #选择 SS rust,Rust语言版(负载均衡/探测延迟)  *
    SS Server Selection (SS-libev)   ---> None  #不选  *
    SS Server Selection (SS-libev)   ---> SS-libev  #选择 SS Libev,C语言版(轻量级)  *
    SS Server Selection (SS-libev)   ---> “师夷长技以制夷”ust  #选择 SS rust,Rust语言版(负载均衡/探测延迟)  *
    “师夷长技以制夷”-core Selection (Xray-core)  ---> None  #不选  *
    “师夷长技以制夷”-core Selection (Xray-core)  ---> “师夷长技以制夷”-core  #“师夷长技以制夷”核心  *
    “师夷长技以制夷”-core Selection (Xray-core)  ---> Xray-core  #Xray核心  *
    “师夷长技以制夷”-core Selection (Xray-core)  ---> SagerNet-core  #“师夷长技以制夷”核心增强版  *
    luci-app-“师夷长技以制夷”-plus ---> Include Kcptun  #Kcptun双边加速工具
    luci-app-“师夷长技以制夷”-plus ---> Include Hysteria  #轻量代理-专为恶劣网络环境进行优化的网络工具(双边加速)  *
    luci-app-“师夷长技以制夷”-plus ---> Include IPT2Socks  #IPT2Socks轻量代理  *
    luci-app-“师夷长技以制夷”-plus ---> Include NaiveProxy  #NaiveProxy代理(Chrome网络堆栈伪装流量)
    luci-app-“师夷长技以制夷”-plus ---> Include “师夷长技以制夷”2  #“师夷长技以制夷”2代理(透明TCP定向Socks/HTTPS代理服务器)
    luci-app-“师夷长技以制夷”-plus ---> Include Simple-Obfs Plugin  #SS Simple-Obfs混淆代理(Nginx)
    luci-app-“师夷长技以制夷”-plus ---> Include SS “师夷长技以制夷” Plugin  #SS “师夷长技以制夷”代理(WebSocket+TLS )
    luci-app-“师夷长技以制夷”-plus ---> Include “师夷长技以制夷” Libev Client  #“师夷长技以制夷” Libev客户端(轻量级)
    luci-app-“师夷长技以制夷”-plus ---> Include “师夷长技以制夷” Libev Server  #“师夷长技以制夷” Libev服务端(轻量级)
    luci-app-“师夷长技以制夷”-plus ---> Include Trojan  #Trojan代理(直接模仿协议HTTPS)
    Include libustream-ssl  ---> Include libustream-wolfssl  #选择wolfSSL库(传输层安全协议)
    Include libustream-ssl  ---> Include libustream-openssl  #选择OpenSSL库(传输层安全协议)
    luci-app-“师夷长技以制夷”-plus ---> Include SS Libev Client  #SS Libev客户端(轻量级)
    luci-app-“师夷长技以制夷”-plus ---> Include SS Libev Server  #SS Libev服务端(轻量级)
    luci-app-“师夷长技以制夷”-plus ---> Include SS Rust Client  #SS Rust客户端(负载均衡/探测延迟)
    luci-app-“师夷长技以制夷”-plus ---> Include SS Rust Server  #SS Rust服务端(负载均衡/探测延迟)
    luci-app-“师夷长技以制夷”-plus ---> Include Xray  #Xray代理(XTLS)
    luci-app-“师夷长技以制夷”-plus ---> Include SS New Version  #新SS代理(丢弃)
    luci-app-“师夷长技以制夷”-plus ---> Include SS  #SS代理(丢弃)
    luci-app-“师夷长技以制夷”-plus ---> Include SS Rust (AEAD ciphers only)  #“师夷长技以制夷”UST代理(AEAD密码)  (丢弃)
    luci-app-“师夷长技以制夷”-plus ---> Include “师夷长技以制夷”  #“师夷长技以制夷”代理(丢弃)
    luci-app-“师夷长技以制夷”-plus ---> Include Xray (“师夷长技以制夷”/Trojan-GO implemented)  #Xray代理(丢弃)
    luci-app-“师夷长技以制夷”-plus ---> Include Trojan-go  #Trojan-go代理(丢弃)
    luci-app-“师夷长技以制夷”-plus ---> Include SS Server  #SS服务器(丢弃)
    luci-app-“师夷长技以制夷”-plus ---> Include SS Rust Server  #SS Rust服务器(丢弃)
    luci-app-“师夷长技以制夷”-plus ---> Include “师夷长技以制夷” Server  #“师夷长技以制夷”服务器(丢弃)
    luci-app-“师夷长技以制夷”-plus ---> Include DNS2SOCKS  #DNS服务器(丢弃)
    luci-app-“师夷长技以制夷”-plus ---> Include “师夷长技以制夷” Socks and Tunnel(丢弃)
    luci-app-“师夷长技以制夷”-plus ---> Include Socks Server  #socks代理服务器(丢弃)
LuCI ---> Applications ---> luci-app-“师夷长技以制夷”-pro  #“师夷长技以制夷”-Pro(丢弃)
LuCI ---> Applications ---> luci-app-“师夷长技以制夷”server-python  #“师夷长技以制夷”R Python服务器
LuCI ---> Applications ---> luci-app-statistics  #流量监控工具
LuCI ---> Applications ---> luci-app-syncdial  #多拨虚拟网卡(原macvlan)
LuCI ---> Applications ---> luci-app-tinyproxy  #Tinyproxy是 HTTP(S)代理服务器
LuCI ---> Applications ---> luci-app-transmission   #BT下载工具
LuCI ---> Applications ---> luci-app-travelmate  #旅行路由器
LuCI ---> Applications ---> luci-app-ttyd   #网页终端命令行
LuCI ---> Applications ---> luci-app-turboacc   #Turbo ACC 网络加速(支持 Fast Path 或者 硬件 NAT)
    luci-app-turboacc ---> Include Flow Offload   #Flow Offload加速(提高路由转发效率)  *
    luci-app-turboacc ---> Include Shortcut-FE  #Shortcut-FE 流量分载
    luci-app-turboacc ---> Include Shortcut-FE CM   #Shortcut-FE 流量分载(高通芯片版)  *
    luci-app-turboacc ---> Include BBR CCA  #BBR拥塞控制算法提升TCP网络性能
    luci-app-turboacc ---> Include Pdnsd   #DNS防污染 Pdnsd  *
    luci-app-turboacc ---> Include DNSForwarder  #DNS防污染 Forwarder
    luci-app-turboacc ---> Include DNSProxy  #DNS防污染 Proxy
LuCI ---> Applications ---> luci-app-udpxy  #udpxy做组播服务器
LuCI ---> Applications ---> luci-app-uhttpd  #uHTTPd Web服务器
LuCI ---> Applications ---> luci-app-unblockmusic  #解锁网易云灰色歌曲3合1新版本
    UnblockNeteaseMusic Golang Version  #Golang版本
    UnblockNeteaseMusic NodeJS Version  #NodeJS版本
LuCI ---> Applications ---> luci-app-unblockneteasemusic-go  #解除网易云音乐(合并)
LuCI ---> Applications ---> luci-app-unblockneteasemusic-mini  #解除网易云音乐(合并)
LuCI ---> Applications ---> luci-app-unbound  #Unbound DNS解析器
LuCI ---> Applications ---> luci-app-upnp   #通用即插即用UPnP(端口自动转发)
LuCI ---> Applications ---> luci-app-usb-printer  #USB 打印服务器
LuCI ---> Applications ---> luci-app-uugamebooster  #UU网游加速器
LuCI ---> Applications ---> luci-app-“师夷长技以制夷”-server   #“师夷长技以制夷” 服务器
LuCI ---> Applications ---> luci-app-“师夷长技以制夷”-pro  #“师夷长技以制夷”透明代理(丢弃,集成“师夷长技以制夷”)
LuCI ---> Applications ---> luci-app-verysync  #微力同步
LuCI ---> Applications ---> luci-app-vlmcsd  #KMS服务器设置
LuCI ---> Applications ---> luci-app-vnstat   #vnStat网络监控(图表)(与kodexplorer冲突 ! )
LuCI ---> Applications ---> luci-app-virtual**bypass  #virtual** BypassWebUI  绕过virtual**设置
LuCI ---> Applications ---> luci-app-vsftpd  #FTP服务器
LuCI ---> Applications ---> luci-app-v“师夷长技以制夷”  #V“师夷长技以制夷”“师夷长技以制夷”(je大佬插件)
    luci-app-v“师夷长技以制夷” ---> Include Xray  #Xray代理(XTLS)
    luci-app-v“师夷长技以制夷” ---> Include Trojan  #Trojan代理(直接模仿协议HTTPS)
    luci-app-v“师夷长技以制夷” ---> Include Kcptun  #Kcptun双边加速工具
    luci-app-v“师夷长技以制夷” ---> Include “师夷长技以制夷” Xray Plugin  #SS Xray代理
    luci-app-v“师夷长技以制夷” ---> Include “师夷长技以制夷”R Libev Server  #“师夷长技以制夷” Libev服务端(轻量级)
LuCI ---> Applications ---> luci-app-watchcat  #断网检测功能与定时重启
LuCI ---> Applications ---> luci-app-webadmin  #Web管理页面设置
LuCI ---> Applications ---> luci-app-webdav  #WebDAV阿里云盘  *
LuCI ---> Applications ---> luci-app-webshell  #网页命令行终端(丢弃)
LuCI ---> Applications ---> luci-app-wifischedule  #WiFi 计划
LuCI ---> Applications ---> luci-app-wireguard  #virtual**服务器 WireGuard状态
LuCI ---> Applications ---> luci-app-wirele“师夷长技以制夷”egdb  #WiFi无线
LuCI ---> Applications ---> luci-app-wol   #WOL网络唤醒
LuCI ---> Applications ---> luci-app-wrtbwmon  #实时流量监测
LuCI ---> Applications ---> luci-app-xlnetacc  #迅雷快鸟
LuCI ---> Applications ---> luci-app-zerotier  #ZeroTier内网穿透
```


---


### 1、支持 iPv6:


```shell
1、Extra packages  --->  ipv6helper  (选定这个后下面几项自动选择了)
Network  --->  odhcp6c
Network  --->  odhcpd-ipv6only
LuCI  --->  Protocols  --->  luci-proto-ipv6
LuCI  --->  Protocols  --->  luci-proto-ppp
```


### 2、打开适用于 VMware 的 VM Tools


```shell
Utilities  --->  open-vm-tools  #打开适用于VMware的VM Tools
Utilities  --->  open-vm-tools-fuse  #打开适用于VMware的VM Tools
```


3、第二次编译:


```shell
cd lede
git pull
./scripts/feeds update -a
./scripts/feeds install -a
make defconfig
make download -j8
make V=s -j$(nproc)
```


4、编译丰富插件时,建议修改下面两项默认大小,留足插件空间。


```shell
Target Images ---> (16) Kernel partition size (in MB)                        #默认是 (16) 建议修改 (256)
Target Images ---> (400) Root filesystem partition size (in MB)         #默认是 (400) 建议修改 (512)
```

lede仓库官方教程

# 欢迎来到 Lean 的 LEDE 源码仓库


## 注意

1. **不要用 root 用户进行编译**
2. 国内用户编译前最好准备好梯子
3. 默认登陆IP 192.168.1.1 密码 password

## 编译命令

1. 首先装好 Linux 系统,推荐 Debian 11 或 Ubuntu LTS
2. 安装编译依赖

    ```shell
    sudo apt update -y
    sudo apt full-upgrade -y
    sudo apt install -y ack antlr3 asciidoc autoconf automake autopoint binutils bison build-essential \\
    bzip2 ccache cmake cpio curl device-tree-compiler fastjar flex gawk gettext gcc-multilib g++-multilib \\
    git gperf haveged help2man intltool libc6-dev-i386 libelf-dev libglib2.0-dev libgmp3-dev libltdl-dev \\
    libmpc-dev libmpfr-dev libncurses5-dev libncursesw5-dev libreadline-dev libssl-dev libtool lrzsz \\
    mkisofs msmtp nano ninja-build p7zip p7zip-full patch pkgconf python2.7 python3 python3-pyelftools \\
    libpython3-dev qemu-utils rsync scons squashfs-tools subversion swig texinfo uglifyjs upx-ucl unzip \\
    vim wget xmlto xxd zlib1g-dev python3-setuptools
    
    ```

3. 下载源代码,更新 feeds 并选择配置

    ```shell
    git clone <https://github.com/coolsnowwolf/lede>
    cd lede
    ./scripts/feeds update -a
    ./scripts/feeds install -a
    make menuconfig
    
    ```

4. 下载 dl 库,编译固件
(-j 后面是线程数,第一次编译推荐用单线程)

    ```shell
    make download -j8
    make V=s -j1
    
    ```


本套代码保证肯定可以编译成功。里面包括了 R23 所有源代码,包括 IPK 的。


你可以自由使用,但源码编译二次发布请注明我的 GitHub 仓库链接。谢谢合作!


二次编译:


```shell
cd lede
git pull
./scripts/feeds update -a
./scripts/feeds install -a
make defconfig
make download -j8
make V=s -j$(nproc)

```


如果需要重新配置:


```shell
rm -rf ./tmp && rm -rf .config
make menuconfig
make V=s -j$(nproc)

```


编译完成后输出路径:bin/targets


### 如果你使用 WSL/WSL2 进行编译


由于 WSL 的 PATH 中包含带有空格的 Windows 路径,有可能会导致编译失败,请在 `make` 前面加上:


```shell
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

```


由于默认情况下,装载到 WSL 发行版的 NTFS 格式的驱动器将不区分大小写,因此大概率在 WSL/WSL2 的编译检查中会返回以下错误:


```text
Build dependency: OpenWrt can only be built on a case-sensitive filesystem

```


一个比较简洁的解决方法是,在 `git clone` 前先创建 Repository 目录,并为其启用大小写敏感:


```powershell
# 以管理员身份打开终端
PS > fsutil.exe file setCaseSensitiveInfo <your_local_lede_path> enable
# 将本项目 git clone 到开启了大小写敏感的目录 <your_local_lede_path> 中
PS > git clone [email protected]:coolsnowwolf/lede.git <your_local_lede_path>

```


> 对已经 git clone 完成的项目目录执行 fsutil.exe 命令无法生效,大小写敏感只对新增的文件变更有效。


### macOS 原生系统进行编译

1. 在 AppStore 中安装 Xcode
2. 安装 Homebrew:

    ```shell
    /usr/bin/ruby -e "$(curl -fsSL <https://raw.githubusercontent.com/Homebrew/install/master/install>)"
    
    ```

3. 使用 Homebrew 安装工具链、依赖与基础软件包:

    ```shell
    brew unlink awk
    brew install coreutils diffutils findutils gawk gnu-getopt gnu-tar grep make ncurses pkg-config wget quilt xz
    brew install gcc@11
    
    ```

4. 然后输入以下命令,添加到系统环境变量中:

    ```shell
    echo 'export PATH="/usr/local/opt/coreutils/libexec/gnubin:$PATH"' >> ~/.bashrc
    echo 'export PATH="/usr/local/opt/findutils/libexec/gnubin:$PATH"' >> ~/.bashrc
    echo 'export PATH="/usr/local/opt/gnu-getopt/bin:$PATH"' >> ~/.bashrc
    echo 'export PATH="/usr/local/opt/gnu-tar/libexec/gnubin:$PATH"' >> ~/.bashrc
    echo 'export PATH="/usr/local/opt/grep/libexec/gnubin:$PATH"' >> ~/.bashrc
    echo 'export PATH="/usr/local/opt/gnu-sed/libexec/gnubin:$PATH"' >> ~/.bashrc
    echo 'export PATH="/usr/local/opt/make/libexec/gnubin:$PATH"' >> ~/.bashrc
    
    ```

5. 重新加载一下 shell 启动文件 `source ~/.bashrc`,然后输入 `bash` 进入 bash shell,就可以和 Linux 一样正常编译了

## 特别提示

1. 源代码中绝不含任何后门和可以监控或者劫持你的 HTTPS 的闭源软件, SSL 安全是互联网最后的壁垒。安全干净才是固件应该做到的;
2. 广告
3. QCA IPQ60xx 开源仓库地址:[https://github.com/coolsnowwolf/openwrt-gl-ax1800](https://github.com/coolsnowwolf/openwrt-gl-ax1800)
4. 存档版本仓库地址:[https://github.com/coolsnowwolf/openwrt](https://github.com/coolsnowwolf/openwrt)

欢迎指出任何有错误或不够清晰的表达,可以在下面评论区评论。

×

喜欢就点赞,疼爱就打赏

//