惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Google DeepMind News
Google DeepMind News
Apple Machine Learning Research
Apple Machine Learning Research
博客园_首页
爱范儿
爱范儿
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
罗磊的独立博客
M
MIT News - Artificial intelligence
D
Docker
量子位
T
Tailwind CSS Blog
人人都是产品经理
人人都是产品经理
月光博客
月光博客
有赞技术团队
有赞技术团队
J
Java Code Geeks
A
About on SuperTechFans
P
Proofpoint News Feed
Jina AI
Jina AI
Y
Y Combinator Blog
T
The Blog of Author Tim Ferriss
The GitHub Blog
The GitHub Blog
Microsoft Security Blog
Microsoft Security Blog
V
V2EX
GbyAI
GbyAI
F
Fortinet All Blogs

/home/hexchain

在 Linux 上使用 Docker 和 Java 开发酷 Q 插件 跨架构升级 Fedora LaTeX 笔记 OpenWrt 编译配置笔记 tar 分卷压缩与解压缩 为不同 GitHub repo 使用不同 ssh key Linux 上使用财付通控件
使用 networkd 管理 HE.net TunnelBroker
hexchain · 2015-01-26 · via /home/hexchain

systemd-networkd 是一个很科学的网络管理工具。支持 sit 隧道,可以拿来管理 HE.net 的 TunnelBroker。

进入 TunnelBroker 的隧道 -> Example Configuration 页面,在下拉菜单中选择 Debian/Ubuntu。

例如:

auto he-ipv6
iface he-ipv6 inet6 v4tunnel
    address 2001:db8:12:34::2
    netmask 64
    endpoint 172.16.12.19
    local 192.168.24.17
    ttl 255
    gateway 2001:db8:12:34::1

然后创建以下文件: /etc/systemd/he-tunnel.netdev

[Match]

[NetDev]
Description=HE.net Tunnelbroker sit device
Name=he-ipv6
Kind=sit
MTUBytes=1480

[Tunnel]
Local=192.168.24.17  # 上面的 "local" 字段
Remote=172.16.12.19  # 上面的 "endpoint" 字段
TTL=255

/etc/systemd/he-tunnel.network

[Match]
Name=he-ipv6

[Network]
Address=2001:db8:12:34::2/64  # "address"/"netmask"
Gateway=2001:db8:12:34::1     # "gateway"
DNS=2001:4860:4860::8888      # 建议按照 IPv6 Tunnel 页上 Available DNS Resolvers 一节进行设置
DNS=2001:4860:4860::8844

在样例配置中,Linux-net-tools 方案和 Linux-iproute2 方案都不需要指定 IPv6 的网关地址,我也不知道怎么让 networkd 实现同样效果…

最后在主接口的.network文件的[Network]一节里加入如下内容:

Tunnel=he-ipv6

这样就能让隧道随主接口自动建立。