<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Openwrt on Zayn's Blog</title><link>https://blog.treesir.pub/categories/openwrt/</link><description>Recent content in Openwrt on Zayn's Blog</description><generator>Hugo -- gohugo.io</generator><language>zh-cn</language><managingEditor>yangzun@treesir.pub (Zayn)</managingEditor><webMaster>yangzun@treesir.pub (Zayn)</webMaster><copyright>2021-2026 Zayn</copyright><lastBuildDate>Thu, 29 Jul 2021 08:56:04 +0800</lastBuildDate><atom:link href="https://blog.treesir.pub/categories/openwrt/index.xml" rel="self" type="application/rss+xml"/><item><title>使用斐讯 N1 和 OpenWrt 搭建 K3s 集群</title><link>https://blog.treesir.pub/posts/n1-openwrt-k3s-deploy/</link><pubDate>Tue, 26 Jan 2021 09:26:39 +0800</pubDate><author>yangzun@treesir.pub (Zayn)</author><guid>https://blog.treesir.pub/posts/n1-openwrt-k3s-deploy/</guid><description>&lt;h2 class="relative group">环境说明
&lt;div id="环境说明" class="anchor">&lt;/div>
&lt;span
class="absolute top-0 w-6 transition-opacity opacity-0 ltr:-left-6 rtl:-right-6 not-prose group-hover:opacity-100">
&lt;a class="group-hover:text-primary-300 dark:group-hover:text-neutral-700 !no-underline" href="#%e7%8e%af%e5%a2%83%e8%af%b4%e6%98%8e" aria-label="锚点">#&lt;/a>
&lt;/span>
&lt;/h2>
&lt;h2 class="relative group">软件版本
&lt;div id="软件版本" class="anchor">&lt;/div>
&lt;span
class="absolute top-0 w-6 transition-opacity opacity-0 ltr:-left-6 rtl:-right-6 not-prose group-hover:opacity-100">
&lt;a class="group-hover:text-primary-300 dark:group-hover:text-neutral-700 !no-underline" href="#%e8%bd%af%e4%bb%b6%e7%89%88%e6%9c%ac" aria-label="锚点">#&lt;/a>
&lt;/span>
&lt;/h2>
&lt;ul>
&lt;li>K3s 版本：v1.19.7+k3s1&lt;/li>
&lt;li>Docker 版本：19.03.13 (N1)，19.03.12 (OpenWrt)&lt;/li>
&lt;li>写盘工具：balenaEtcher&lt;/li>
&lt;/ul>
&lt;h2 class="relative group">硬件配置
&lt;div id="硬件配置" class="anchor">&lt;/div>
&lt;span
class="absolute top-0 w-6 transition-opacity opacity-0 ltr:-left-6 rtl:-right-6 not-prose group-hover:opacity-100">
&lt;a class="group-hover:text-primary-300 dark:group-hover:text-neutral-700 !no-underline" href="#%e7%a1%ac%e4%bb%b6%e9%85%8d%e7%bd%ae" aria-label="锚点">#&lt;/a>
&lt;/span>
&lt;/h2>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>IP 地址&lt;/th>
&lt;th>机型&lt;/th>
&lt;th>配置&lt;/th>
&lt;th>操作系统&lt;/th>
&lt;th>角色&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>192.168.8.1&lt;/td>
&lt;td>占美（机型不详）&lt;/td>
&lt;td>4C 2G（CPU N2940）&lt;/td>
&lt;td>OpenWrt（X86_64 自编译）&lt;/td>
&lt;td>node/agent&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>192.168.8.112&lt;/td>
&lt;td>斐讯 N1&lt;/td>
&lt;td>4C 2G&lt;/td>
&lt;td>Armbian（5.0.2-aml-s905）&lt;/td>
&lt;td>master/server&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;h2 class="relative group">OpenWrt 自编译
&lt;div id="openwrt-自编译" class="anchor">&lt;/div>
&lt;span
class="absolute top-0 w-6 transition-opacity opacity-0 ltr:-left-6 rtl:-right-6 not-prose group-hover:opacity-100">
&lt;a class="group-hover:text-primary-300 dark:group-hover:text-neutral-700 !no-underline" href="#openwrt-%e8%87%aa%e7%bc%96%e8%af%91" aria-label="锚点">#&lt;/a>
&lt;/span>
&lt;/h2>
&lt;p>需要自编译的原因：之前使用 esir 打包的高大全 OpenWrt 固件部署 K3s 时发现，内核没有开启 &lt;code>vxlan&lt;/code> 特性，导致部署失败。如果您使用的 OpenWrt 固件已开启 &lt;code>vxlan&lt;/code> 特性，可跳过此步骤。&lt;/p></description></item><item><title>Docker 部署多网口 openWrt 软路由</title><link>https://blog.treesir.pub/posts/openwrt-docker-multi-net/</link><pubDate>Thu, 19 Nov 2020 17:56:52 +0800</pubDate><author>yangzun@treesir.pub (Zayn)</author><guid>https://blog.treesir.pub/posts/openwrt-docker-multi-net/</guid><description>&lt;h2 class="relative group">环境说明:
&lt;div id="环境说明" class="anchor">&lt;/div>
&lt;span
class="absolute top-0 w-6 transition-opacity opacity-0 ltr:-left-6 rtl:-right-6 not-prose group-hover:opacity-100">
&lt;a class="group-hover:text-primary-300 dark:group-hover:text-neutral-700 !no-underline" href="#%e7%8e%af%e5%a2%83%e8%af%b4%e6%98%8e" aria-label="锚点">#&lt;/a>
&lt;/span>
&lt;/h2>
&lt;blockquote>
&lt;p>操作系统: Centos 7.8.2003&lt;/p>
&lt;p>内核版本: 4.14.129-bbrplus&lt;/p>
&lt;p>Docker 版本: 19.03.12&lt;/p>
&lt;p>使用 Docker 镜像: &lt;a
href="https://hub.docker.com/r/raymondwong/openwrt_r9"
target="_blank"
>raymondwong/openwrt_r9:20.1.24-x86_64&lt;/a>&lt;/p>
&lt;p>网卡说明: 板载螃蟹网卡、绿联 &lt;code>usb3.0&lt;/code> 千M 网卡&lt;/p></description></item><item><title>K3s 集群修改 Flannel CNI 插件网络模式</title><link>https://blog.treesir.pub/posts/k3s-change-flannel-cni-model/</link><pubDate>Thu, 29 Jul 2021 08:56:04 +0800</pubDate><author>yangzun@treesir.pub (Zayn)</author><guid>https://blog.treesir.pub/posts/k3s-change-flannel-cni-model/</guid><description>&lt;h2 class="relative group">背景说明
&lt;div id="背景说明" class="anchor">&lt;/div>
&lt;span
class="absolute top-0 w-6 transition-opacity opacity-0 ltr:-left-6 rtl:-right-6 not-prose group-hover:opacity-100">
&lt;a class="group-hover:text-primary-300 dark:group-hover:text-neutral-700 !no-underline" href="#%e8%83%8c%e6%99%af%e8%af%b4%e6%98%8e" aria-label="锚点">#&lt;/a>
&lt;/span>
&lt;/h2>
&lt;blockquote>
&lt;p>在 &lt;a
href="https://www.treesir.pub/post/n1-openwrt-k3s-deploy/"
target="_blank"
>之前搭建&lt;/a> 的 k3s 集群中因为某些原因我将 openwrt 节点，进行了系统重装，更改固件为了 &lt;code>esir&lt;/code> 高大全的 op 固件，由于其 固件中没有将 &lt;code>vxlan&lt;/code> 模块编译进内核当中，而 k3s &lt;code>默认&lt;/code> 使用的 cni 为 &lt;code>flannel 的 vxlan&lt;/code> 模式，导致在初始化节点的时候会出现错误，导致节点添加不成功，我们知道原生 flannel 支持的模式不只单单只有 vxlan，还支持 &lt;strong>host-gw&lt;/strong>、&lt;strong>udp&lt;/strong> 模式。进行查阅 k3s 相关资料，看到 k3s 是支持切换多种网络模式的，于是决定将 flannel 模式更改为 &lt;code>host-gw&lt;/code> 。&lt;/p></description></item><item><title>Docker 部署 OpenWrt 软路由及宿主机通信配置</title><link>https://blog.treesir.pub/posts/n1-docker/</link><pubDate>Sun, 15 Nov 2020 16:09:10 +0800</pubDate><author>yangzun@treesir.pub (Zayn)</author><guid>https://blog.treesir.pub/posts/n1-docker/</guid><description>&lt;h2 class="relative group">环境配置
&lt;div id="环境配置" class="anchor">&lt;/div>
&lt;span
class="absolute top-0 w-6 transition-opacity opacity-0 ltr:-left-6 rtl:-right-6 not-prose group-hover:opacity-100">
&lt;a class="group-hover:text-primary-300 dark:group-hover:text-neutral-700 !no-underline" href="#%e7%8e%af%e5%a2%83%e9%85%8d%e7%bd%ae" aria-label="锚点">#&lt;/a>
&lt;/span>
&lt;/h2>
&lt;p>本文档基于以下环境配置进行部署：&lt;/p>
&lt;ul>
&lt;li>&lt;strong>宿主机 IP&lt;/strong>：192.168.8.102&lt;/li>
&lt;li>&lt;strong>OpenWrt 容器 IP&lt;/strong>：192.168.8.111 (macvlan 模式)&lt;/li>
&lt;li>&lt;strong>主路由网关&lt;/strong>：192.168.8.1&lt;/li>
&lt;li>&lt;strong>网络段&lt;/strong>：192.168.8.0/24&lt;/li>
&lt;li>&lt;strong>Docker 镜像&lt;/strong>：&lt;code>raymondwong/openwrt_r9:21.2.1-arm64&lt;/code>&lt;/li>
&lt;li>&lt;strong>操作系统&lt;/strong>：ARMBIAN&lt;/li>
&lt;/ul>
&lt;h2 class="relative group">部署 OpenWrt 软路由
&lt;div id="部署-openwrt-软路由" class="anchor">&lt;/div>
&lt;span
class="absolute top-0 w-6 transition-opacity opacity-0 ltr:-left-6 rtl:-right-6 not-prose group-hover:opacity-100">
&lt;a class="group-hover:text-primary-300 dark:group-hover:text-neutral-700 !no-underline" href="#%e9%83%a8%e7%bd%b2-openwrt-%e8%bd%af%e8%b7%af%e7%94%b1" aria-label="锚点">#&lt;/a>
&lt;/span>
&lt;/h2>
&lt;h2 class="relative group">1. 安装 Docker Compose
&lt;div id="1-安装-docker-compose" class="anchor">&lt;/div>
&lt;span
class="absolute top-0 w-6 transition-opacity opacity-0 ltr:-left-6 rtl:-right-6 not-prose group-hover:opacity-100">
&lt;a class="group-hover:text-primary-300 dark:group-hover:text-neutral-700 !no-underline" href="#1-%e5%ae%89%e8%a3%85-docker-compose" aria-label="锚点">#&lt;/a>
&lt;/span>
&lt;/h2>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-bash" data-lang="bash">&lt;span class="line">&lt;span class="cl">&lt;span class="c1"># Debian/Ubuntu 系统&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">apt install -y docker-compose
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1"># CentOS/RHEL 系统&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">yum install -y docker-compose
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>
&lt;h2 class="relative group">2. 创建配置文件
&lt;div id="2-创建配置文件" class="anchor">&lt;/div>
&lt;span
class="absolute top-0 w-6 transition-opacity opacity-0 ltr:-left-6 rtl:-right-6 not-prose group-hover:opacity-100">
&lt;a class="group-hover:text-primary-300 dark:group-hover:text-neutral-700 !no-underline" href="#2-%e5%88%9b%e5%bb%ba%e9%85%8d%e7%bd%ae%e6%96%87%e4%bb%b6" aria-label="锚点">#&lt;/a>
&lt;/span>
&lt;/h2>
&lt;p>首先创建工作目录并准备 Docker Compose 配置文件：&lt;/p></description></item></channel></rss>