10

在局域网内开启Zerotier网关

 3 years ago
source link: https://blog.ihipop.info/2020/06/5246.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

跳至内容

小顾de杂记

O(∩_∩)O~|Across the great wall we can reach the every corner in the world.

在局域网内开启Zerotier网关

Zerotier目前不支持设置下发路由的metric,如果你的局域网机器需要充当网关的角色(其他客户端通过这台机访问局域网),Zerotier下发的路由会覆盖掉局域网自动下发的路由,导致路由混乱失效。

在官方解决这个问题之前,只能设置自动管理路由,让程序不自动应用官方下发的路由。

以下配置在ERL3上测试通过

先期安装和简单配置

在Ubnt上安装它是很简单的,设备会被识别为Debian alike system 然后被安装脚本自动处理

curl -s https://install.zerotier.com | sudo bash

安装完成以后,把Zerotier的数据配置移动到ubnt底配置分区,防止升级系统后丢配置

mv /var/lib/zerotier-one /config/scripts/
ln -s /config/scripts/zerotier-one

加入网络,看下有无问题,没有话进行下一步:

为了让Zerotier的网络接口显示在Ubnt的节目上,还需要更改下Zerotier的网口命名

假设你的网络ID是$NETWORKID ,那么就往/var/lib/zerotier-one/devicemap 写入

$NETWORKID=eth4

因为这个设备有eth1-eth3占用了,只能到eth4开始

最后,启动,看到eth4设备后,通过ubnt内置的配置编辑器对eth4增加一项描述即可

set interfaces ethernet eth4 description "ZeroTier YOURNAME"
commit

就能在UI里面看见这个设备了

解决路由覆盖问题

前面提到了,为了让外部设备访问内部网络,通过Zerotier官网下发的路由会导致在局域网的客户端路由异常。

为了解决这个问题,我们开启充当网关设备的都这个客户端的路由手动管理。

zerotier-cli set $NETWORKID allowManaged=0

然后,设置Zerotier的子网10.10.10.0/24都走eth4,并且给eth4分配一个固定IP

set interfaces ethernet eth4 address 10.10.10.12/24
commit

这样路由设置能持久,也不会Zerotier下发的路由冲突

存在的问题

Ubnt的非网络计算性能真的很糟糕,如果有条件,建议还是弄个旁路由处理这些事情,Ubnt擅长的还是NAT硬件加速,装上Zerotier当个备胎用用吧。

Author Info : From:在局域网内开启Zerotier网关 URL:https://blog.ihipop.info/2020/06/5246.html Please Reserve This Link,Thanks!

发布于 2020年06月24日2020年06月24日作者 ihipop分类 MyOriginal标签 UbntZerotier路由

发表评论 取消回复

邮箱地址不会被公开。 必填项已用*标注

评论

姓名 *

电子邮件 *

站点


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK