mirror of
https://github.com/Dichgrem/Blog.git
synced 2025-02-23 05:58:36 -05:00
just push
This commit is contained in:
parent
bf716087ec
commit
4a141c3030
@ -1,5 +1,5 @@
|
||||
+++
|
||||
title = "综合工程:OpenWrt 软路由部署"
|
||||
title = "综合工程:OpenWrt 软路由部署与软件编译"
|
||||
date = 2023-08-12
|
||||
|
||||
[taxonomies]
|
||||
@ -13,45 +13,67 @@ tags = ["综合工程"]
|
||||
|
||||
无论是作为主路由或是旁路由,传统路由器由于主频低,内存小,并不适合作为软路由;而 NAS-软路由一体式 又有 all in boom 的风险,因此推荐X86平台作为物理机。当然,也可以采用 armbian 平台或是开发板,例如网心云老母鸡、树莓派等设备。截至本文撰写时间,二手平台上的价格不太利好:一台J1900平台的售价往往在200左右,而专门的多网口工控机价格在200到1000不等,树莓派更是成为了理财产品,需要慎重选择。
|
||||
|
||||
## 准备工作
|
||||
## 在X86小主机上面安装OpenWrt
|
||||
|
||||
### 准备以下工具:
|
||||
|
||||
- 1.openwrt 的编译包,由 eSir 大佬编译的三个经典版本:
|
||||
|
||||
https://drive.google.com/drive/folders/1uRXg_krKHPrQneI3F2GNcSVRoCgkqESr
|
||||
|
||||
- 2.PE 启动盘,这里推荐微PE:https://www.wepe.com.cn/download.html
|
||||
|
||||
- 3.img 写盘工具:https://www.roadkil.net/program.php?ProgramID=12#google_vignette
|
||||
|
||||
- 4.一个U盘与一台双网口物理机
|
||||
|
||||
安装流程:
|
||||
### 安装流程:
|
||||
|
||||
## 一、进入PE环境:
|
||||
1.进入PE环境:
|
||||
|
||||
1.打开微PE,将其安装进U盘中,安装完成后将 img 工具和 openwrt 包一起放进去;
|
||||
- 打开微PE,将其安装进U盘中,安装完成后将 img 工具和 openwrt 包一起放进去;
|
||||
- 将U盘插入目标主机,进入 BIOS-boot 设置U盘优先启动,各主板进入 BIOS 的按键不同,不确定的话建议都试一遍。
|
||||
|
||||
2.将U盘插入目标主机,进入 BIOS-boot 设置U盘优先启动,各主板进入 BIOS 的按键不同,不确定的话建议都试一遍。
|
||||
2.格式化硬盘并写盘
|
||||
|
||||
## 二、格式化硬盘并写盘
|
||||
- 进入PE环境中,可以看到存在名为“分区助手”的软件,打开它并将目标主机硬盘格式化;注意不要分区!不要分区!不要设置文件系统!否则后续可能无法编译!点击左上角提交并执行
|
||||
- 打开img写盘工具,将openwrt包写入硬盘,注意不要写进U盘里。
|
||||
|
||||
1.进入PE环境中,可以看到存在名为“分区助手”的软件,打开它并将目标主机硬盘格式化;注意不要分区!不要分区!不要设置文件系统!否则后续可能无法编译!
|
||||
3.进入配置界面
|
||||
|
||||
点击左上角提交并执行
|
||||
- 重启系统并快速拔出U盘,避免重新进入PE;这时系统开始运行了。注意Esir固件是不跑码的,无需担心。
|
||||
- 当看到 `please press Enter to activate this console`这个提示的时候系统就安装完毕了。可使用 passwd 命令设置密码。软路由将自动获取IP地址,随后我们在浏览器中打开该地址,即可看到 Lucl 界面。
|
||||
|
||||
2.打开img写盘工具,将openwrt包写入硬盘,注意不要写进U盘里。
|
||||
## 在ubuntu上编译openwrt的ipk包
|
||||
|
||||
## 三、进入配置界面
|
||||
首先需要ubuntu环境,可以是虚拟机或者WSL等。``注意以下操作不能使用Root用户!``
|
||||
随后安装编译依赖的各个包:
|
||||
```
|
||||
sudo apt install python3-distutils-extra git gawk libncurses-dev build-essential binutils bzip2 diff find flex gawk gcc-6+ getopt grep install libc-dev libz-dev make4.1+ perl python3.7+ rsync subversion unzip which
|
||||
|
||||
1.重启系统并快速拔出U盘,避免重新进入PE;这时系统开始运行了。注意Esir固件是不跑码的,无需担心。
|
||||
sudo apt install -y build-essential python3-dev python3-setuptools swig \
|
||||
libmesa-dev libwayland-dev libgraphene-dev \
|
||||
gawk wget git-core diffstat unzip texinfo gcc-multilib \
|
||||
libncurses5-dev libncursesw5-dev zlib1g-dev \
|
||||
libssl-dev flex bison gperf libxml-parser-perl \
|
||||
python-is-python3 python3-pip gettext
|
||||
|
||||
2.当看到 `please press Enter to activate this console`这个提示的时候系统就安装完毕了。可使用 passwd 命令设置密码。软路由将自动获取IP地址,随后我们在浏览器中打开该地址,即可看到 Lucl 界面。
|
||||
sudo apt install -y swig
|
||||
sudo apt install -y mesa-common-dev libwayland-dev libgraphene-1.0-dev
|
||||
```
|
||||
下载和安装仓库信息
|
||||
```
|
||||
./scripts/feeds update -a
|
||||
./scripts/feeds install -a
|
||||
```
|
||||
下载并选中我们需要编译的包,这里以inyn为例:
|
||||
```
|
||||
git clone https://github.com/diredocks/openwrt-inyn.git ./package/inyn
|
||||
make menuconfig
|
||||
```
|
||||
|
||||
## 后记
|
||||
|
||||
|
||||
|
||||
常用命令:
|
||||
在 `menuconfig` 的命令行界面中,选中 `Network -> inyn` 将其首部调整为 `<M>` 表示按需编译,最后选中 `Save -> OK -> Exit` 保存配置信息,然后 `Exit` 退出配置。
|
||||
编译 inyn 软件包
|
||||
```
|
||||
make package/inyn/compile V=s
|
||||
```
|
||||
## 常用命令:
|
||||
```
|
||||
# 更新软件列表
|
||||
opkg update
|
||||
@ -63,7 +85,7 @@ opkg list-upgradable | grep luci- | cut -f 1 -d ' ' | xargs opkg upgrade
|
||||
opkg list-upgradable | cut -f 1 -d ' ' | xargs opkg upgrade
|
||||
|
||||
```
|
||||
开源世界还存在着 DD-WERT、Tomato 等系统。正如互联网的发展并非一帆风顺,OpenWRT 也出现过核心开发者出走,另立山头推出 LEDE 等波折,在18年 LEDE 与 openwrt 合并后,通过众多开发者的不懈努力, OpenWRT 有了现在丰富完善的生态。
|
||||
|
||||
|
||||
## 参考
|
||||
|
||||
|
@ -734,7 +734,7 @@
|
||||
<li class="post-list">
|
||||
<a href="https://blog.dich.bid/awesome-openwrt/">
|
||||
<span class="post-date">2023-08-12</span>
|
||||
:: <span class="post-list-title">综合工程:OpenWrt 软路由部署</span></a>
|
||||
:: <span class="post-list-title">综合工程:OpenWrt 软路由部署与软件编译</span></a>
|
||||
|
||||
<span class="post-tags-inline">
|
||||
::
|
||||
|
@ -1309,7 +1309,7 @@
|
||||
|
||||
</entry>
|
||||
<entry xml:lang="en">
|
||||
<title>综合工程:OpenWrt 软路由部署</title>
|
||||
<title>综合工程:OpenWrt 软路由部署与软件编译</title>
|
||||
<published>2023-08-12T00:00:00+00:00</published>
|
||||
<updated>2023-08-12T00:00:00+00:00</updated>
|
||||
|
||||
|
@ -220,7 +220,7 @@
|
||||
<span class="button previous">
|
||||
<a href="https://blog.dich.bid/awesome-openwrt/">
|
||||
<span class="button__icon">←</span>
|
||||
<span class="button__text">综合工程:OpenWrt 软路由部署</span>
|
||||
<span class="button__text">综合工程:OpenWrt 软路由部署与软件编译</span>
|
||||
</a>
|
||||
</span>
|
||||
|
||||
|
@ -78,7 +78,7 @@
|
||||
|
||||
<div class="post">
|
||||
|
||||
<h1 class="post-title"><a href="https://blog.dich.bid/awesome-openwrt/">综合工程:OpenWrt 软路由部署</a></h1>
|
||||
<h1 class="post-title"><a href="https://blog.dich.bid/awesome-openwrt/">综合工程:OpenWrt 软路由部署与软件编译</a></h1>
|
||||
<div class="post-meta-inline">
|
||||
|
||||
<span class="post-date">
|
||||
@ -97,35 +97,59 @@
|
||||
<p>前言 openwrt 是一个自由的、兼容性好的嵌入式 linux 发行版。作为软路由玩家必备的一款神器,可以实现诸如去广告,多拨和科学上网等多种功能。本文以 openwrt 在X86平台的安装为例,介绍其部署流程。</p>
|
||||
<span id="continue-reading"></span><h2 id="wei-shen-me-shi-x86">为什么是X86?</h2>
|
||||
<p>无论是作为主路由或是旁路由,传统路由器由于主频低,内存小,并不适合作为软路由;而 NAS-软路由一体式 又有 all in boom 的风险,因此推荐X86平台作为物理机。当然,也可以采用 armbian 平台或是开发板,例如网心云老母鸡、树莓派等设备。截至本文撰写时间,二手平台上的价格不太利好:一台J1900平台的售价往往在200左右,而专门的多网口工控机价格在200到1000不等,树莓派更是成为了理财产品,需要慎重选择。</p>
|
||||
<h2 id="zhun-bei-gong-zuo">准备工作</h2>
|
||||
<h2 id="zai-x86xiao-zhu-ji-shang-mian-an-zhuang-openwrt">在X86小主机上面安装OpenWrt</h2>
|
||||
<h3 id="zhun-bei-yi-xia-gong-ju">准备以下工具:</h3>
|
||||
<ul>
|
||||
<li>1.openwrt 的编译包,由 eSir 大佬编译的三个经典版本:</li>
|
||||
<li>1.openwrt 的编译包,由 eSir 大佬编译的三个经典版本:
|
||||
https://drive.google.com/drive/folders/1uRXg_krKHPrQneI3F2GNcSVRoCgkqESr</li>
|
||||
<li>2.PE 启动盘,这里推荐微PE:https://www.wepe.com.cn/download.html</li>
|
||||
<li>3.img 写盘工具:https://www.roadkil.net/program.php?ProgramID=12#google_vignette</li>
|
||||
<li>4.一个U盘与一台双网口物理机</li>
|
||||
</ul>
|
||||
<p>https://drive.google.com/drive/folders/1uRXg_krKHPrQneI3F2GNcSVRoCgkqESr</p>
|
||||
<h3 id="an-zhuang-liu-cheng">安装流程:</h3>
|
||||
<p>1.进入PE环境:</p>
|
||||
<ul>
|
||||
<li>
|
||||
<p>2.PE 启动盘,这里推荐微PE:https://www.wepe.com.cn/download.html</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>3.img 写盘工具:https://www.roadkil.net/program.php?ProgramID=12#google_vignette</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>4.一个U盘与一台双网口物理机</p>
|
||||
</li>
|
||||
<li>打开微PE,将其安装进U盘中,安装完成后将 img 工具和 openwrt 包一起放进去;</li>
|
||||
<li>将U盘插入目标主机,进入 BIOS-boot 设置U盘优先启动,各主板进入 BIOS 的按键不同,不确定的话建议都试一遍。</li>
|
||||
</ul>
|
||||
<p>安装流程:</p>
|
||||
<h2 id="yi-jin-ru-pehuan-jing">一、进入PE环境:</h2>
|
||||
<p>1.打开微PE,将其安装进U盘中,安装完成后将 img 工具和 openwrt 包一起放进去;</p>
|
||||
<p>2.将U盘插入目标主机,进入 BIOS-boot 设置U盘优先启动,各主板进入 BIOS 的按键不同,不确定的话建议都试一遍。</p>
|
||||
<h2 id="er-ge-shi-hua-ying-pan-bing-xie-pan">二、格式化硬盘并写盘</h2>
|
||||
<p>1.进入PE环境中,可以看到存在名为“分区助手”的软件,打开它并将目标主机硬盘格式化;注意不要分区!不要分区!不要设置文件系统!否则后续可能无法编译!</p>
|
||||
<p>点击左上角提交并执行</p>
|
||||
<p>2.打开img写盘工具,将openwrt包写入硬盘,注意不要写进U盘里。</p>
|
||||
<h2 id="san-jin-ru-pei-zhi-jie-mian">三、进入配置界面</h2>
|
||||
<p>1.重启系统并快速拔出U盘,避免重新进入PE;这时系统开始运行了。注意Esir固件是不跑码的,无需担心。</p>
|
||||
<p>2.当看到 <code>please press Enter to activate this console</code>这个提示的时候系统就安装完毕了。可使用 passwd 命令设置密码。软路由将自动获取IP地址,随后我们在浏览器中打开该地址,即可看到 Lucl 界面。</p>
|
||||
<h2 id="hou-ji">后记</h2>
|
||||
<p>常用命令:</p>
|
||||
<p>2.格式化硬盘并写盘</p>
|
||||
<ul>
|
||||
<li>进入PE环境中,可以看到存在名为“分区助手”的软件,打开它并将目标主机硬盘格式化;注意不要分区!不要分区!不要设置文件系统!否则后续可能无法编译!点击左上角提交并执行</li>
|
||||
<li>打开img写盘工具,将openwrt包写入硬盘,注意不要写进U盘里。</li>
|
||||
</ul>
|
||||
<p>3.进入配置界面</p>
|
||||
<ul>
|
||||
<li>重启系统并快速拔出U盘,避免重新进入PE;这时系统开始运行了。注意Esir固件是不跑码的,无需担心。</li>
|
||||
<li>当看到 <code>please press Enter to activate this console</code>这个提示的时候系统就安装完毕了。可使用 passwd 命令设置密码。软路由将自动获取IP地址,随后我们在浏览器中打开该地址,即可看到 Lucl 界面。</li>
|
||||
</ul>
|
||||
<h2 id="zai-ubuntushang-bian-yi-openwrtde-ipkbao">在ubuntu上编译openwrt的ipk包</h2>
|
||||
<p>首先需要ubuntu环境,可以是虚拟机或者WSL等。<code>注意以下操作不能使用Root用户!</code>
|
||||
随后安装编译依赖的各个包:</p>
|
||||
<pre style="background-color:#151515;color:#e8e8d3;"><code><span>sudo apt install python3-distutils-extra git gawk libncurses-dev build-essential binutils bzip2 diff find flex gawk gcc-6+ getopt grep install libc-dev libz-dev make4.1+ perl python3.7+ rsync subversion unzip which
|
||||
</span><span>
|
||||
</span><span>sudo apt install -y build-essential python3-dev python3-setuptools swig \
|
||||
</span><span> libmesa-dev libwayland-dev libgraphene-dev \
|
||||
</span><span> gawk wget git-core diffstat unzip texinfo gcc-multilib \
|
||||
</span><span> libncurses5-dev libncursesw5-dev zlib1g-dev \
|
||||
</span><span> libssl-dev flex bison gperf libxml-parser-perl \
|
||||
</span><span> python-is-python3 python3-pip gettext
|
||||
</span><span>
|
||||
</span><span>sudo apt install -y swig
|
||||
</span><span>sudo apt install -y mesa-common-dev libwayland-dev libgraphene-1.0-dev
|
||||
</span></code></pre>
|
||||
<p>下载和安装仓库信息</p>
|
||||
<pre style="background-color:#151515;color:#e8e8d3;"><code><span>./scripts/feeds update -a
|
||||
</span><span>./scripts/feeds install -a
|
||||
</span></code></pre>
|
||||
<p>下载并选中我们需要编译的包,这里以inyn为例:</p>
|
||||
<pre style="background-color:#151515;color:#e8e8d3;"><code><span>git clone https://github.com/diredocks/openwrt-inyn.git ./package/inyn
|
||||
</span><span>make menuconfig
|
||||
</span></code></pre>
|
||||
<p>在 <code>menuconfig</code> 的命令行界面中,选中 <code>Network -> inyn</code> 将其首部调整为 <code><M></code> 表示按需编译,最后选中 <code>Save -> OK -> Exit</code> 保存配置信息,然后 <code>Exit</code> 退出配置。
|
||||
编译 inyn 软件包</p>
|
||||
<pre style="background-color:#151515;color:#e8e8d3;"><code><span>make package/inyn/compile V=s
|
||||
</span></code></pre>
|
||||
<h2 id="chang-yong-ming-ling">常用命令:</h2>
|
||||
<pre style="background-color:#151515;color:#e8e8d3;"><code><span># 更新软件列表
|
||||
</span><span>opkg update
|
||||
</span><span>
|
||||
@ -136,7 +160,6 @@
|
||||
</span><span>opkg list-upgradable | cut -f 1 -d ' ' | xargs opkg upgrade
|
||||
</span><span>
|
||||
</span></code></pre>
|
||||
<p>开源世界还存在着 DD-WERT、Tomato 等系统。正如互联网的发展并非一帆风顺,OpenWRT 也出现过核心开发者出走,另立山头推出 LEDE 等波折,在18年 LEDE 与 openwrt 合并后,通过众多开发者的不懈努力, OpenWRT 有了现在丰富完善的生态。</p>
|
||||
<h2 id="can-kao">参考</h2>
|
||||
<ul>
|
||||
<li><a href="https://openwrt.org/zh/docs/start">Openwrt wiki</a></li>
|
||||
|
@ -247,7 +247,7 @@
|
||||
|
||||
<span class="button next">
|
||||
<a href="https://blog.dich.bid/awesome-openwrt/">
|
||||
<span class="button__text">综合工程:OpenWrt 软路由部署</span>
|
||||
<span class="button__text">综合工程:OpenWrt 软路由部署与软件编译</span>
|
||||
<span class="button__icon">→</span>
|
||||
</a>
|
||||
</span>
|
||||
|
@ -79,7 +79,7 @@
|
||||
<div class="posts">
|
||||
<div class="post on-list">
|
||||
|
||||
<h1 class="post-title"><a href="https://blog.dich.bid/awesome-openwrt/">综合工程:OpenWrt 软路由部署</a></h1>
|
||||
<h1 class="post-title"><a href="https://blog.dich.bid/awesome-openwrt/">综合工程:OpenWrt 软路由部署与软件编译</a></h1>
|
||||
<div class="post-meta-inline">
|
||||
|
||||
<span class="post-date">
|
||||
|
BIN
public/pagefind/fragment/en_0f73915.pf_fragment
Normal file
BIN
public/pagefind/fragment/en_0f73915.pf_fragment
Normal file
Binary file not shown.
BIN
public/pagefind/fragment/en_1c40657.pf_fragment
Normal file
BIN
public/pagefind/fragment/en_1c40657.pf_fragment
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
public/pagefind/fragment/en_f3841a8.pf_fragment
Normal file
BIN
public/pagefind/fragment/en_f3841a8.pf_fragment
Normal file
Binary file not shown.
Binary file not shown.
BIN
public/pagefind/index/en_45fd2bf.pf_index
Normal file
BIN
public/pagefind/index/en_45fd2bf.pf_index
Normal file
Binary file not shown.
BIN
public/pagefind/index/en_99741e2.pf_index
Normal file
BIN
public/pagefind/index/en_99741e2.pf_index
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
public/pagefind/index/en_e84c495.pf_index
Normal file
BIN
public/pagefind/index/en_e84c495.pf_index
Normal file
Binary file not shown.
Binary file not shown.
BIN
public/pagefind/index/en_fdbaac4.pf_index
Normal file
BIN
public/pagefind/index/en_fdbaac4.pf_index
Normal file
Binary file not shown.
@ -1 +1 @@
|
||||
{"version":"1.2.0","languages":{"en":{"hash":"en_f83295c0d7","wasm":"en","page_count":107}}}
|
||||
{"version":"1.2.0","languages":{"en":{"hash":"en_b2888f72a2","wasm":"en","page_count":107}}}
|
BIN
public/pagefind/pagefind.en_b2888f72a2.pf_meta
Normal file
BIN
public/pagefind/pagefind.en_b2888f72a2.pf_meta
Normal file
Binary file not shown.
Binary file not shown.
@ -163,7 +163,7 @@ Dich'blog</title>
|
||||
<li class="post-list">
|
||||
<a href="https://blog.dich.bid/awesome-openwrt/">
|
||||
<span class="post-date">2023-08-12</span>
|
||||
:: <span class="post-list-title">综合工程:OpenWrt 软路由部署</span></a>
|
||||
:: <span class="post-list-title">综合工程:OpenWrt 软路由部署与软件编译</span></a>
|
||||
|
||||
<span class="post-tags-inline">
|
||||
::
|
||||
|
Loading…
x
Reference in New Issue
Block a user