直接运行
- 默认监听
0.0.0.0:11010tcp+udp; - 不加
-i:只做中继,不创建虚拟网卡;
sudo ./easytier-core --network-name myvpn --network-secret mypass
系统服务
创建 systemd service 文件
编辑文件:/etc/systemd/system/easytier.service
[Unit]
Description=EasyTier Private Relay Node(s390x)
After=network.target
[Service]
Type=simple
# 私有中继,不配置虚拟网卡‑i,仅做中继转发;替换 network‑name、network‑secret
ExecStart=/usr/local/bin/easytier-core --network-name mytestnet --network-secret MyStrongPass123
Restart=always
RestartSec=5
# 调高最大文件句柄,中继节点多连接必备
LimitNOFILE=1048576
# 输出stdout/stderr到journal日志
StandardOutput=journal
StandardError=journal
[Install]
WantedBy=multi-user.target
再执行
# 加载新unit
systemctl daemon-reload
# 开机自启并立即启动
systemctl enable --now easytier
# 查看运行状态
systemctl status easytier
本地测试端口
nc -zv 127.0.0.1 11010
nc -zv 148.100.11.116 11010
放行端口
root@vp2:~# iptables -I INPUT 5 -p tcp --dport 11010 -j ACCEPT
iptables -I INPUT 5 -p udp --dport 11010 -j ACCEPT
root@vp2:~# iptables -L INPUT -n -v --line-numbers
Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
num pkts bytes target prot opt in out source destination
1 22136 1921K ACCEPT 0 -- * * 127.0.0.0/8 127.0.0.0/8
2 156K 9175K ACCEPT 6 -- * * 0.0.0.0/0 0.0.0.0/0 ctstate NEW tcp dpt:22
3 260K 17M ACCEPT 1 -- * * 0.0.0.0/0 0.0.0.0/0
4 2389K 2595M ACCEPT 0 -- * * 0.0.0.0/0 0.0.0.0/0 ctstate RELATED,ESTABLISHED
5 0 0 ACCEPT 17 -- * * 0.0.0.0/0 0.0.0.0/0 udp dpt:11010
6 0 0 ACCEPT 6 -- * * 0.0.0.0/0 0.0.0.0/0 tcp dpt:11010
7 757K 43M REJECT 0 -- * * 0.0.0.0/0 0.0.0.0/0 reject-with icmp-host-prohibited
持久化保存iptables
apt update
apt install -y iptables-persistent
# 将当前内存iptables规则保存到磁盘
netfilter-persistent save
# 从磁盘重新加载规则到内存
netfilter-persistent reload
命令行上传文件中转
1、通过在文件目录执行新建临时http目录传文件:
python3 -m http.server 8000
浏览器打开:`http://IP:8000`,点文件名直接下载
2、免费中转网盘
curl -F "file=@你的文件路径" https://x0.at/
3、4.5M限制中转上传下载
echo "hello world" | curl -X POST https://uldl.sh/u -d @-
https://uldl.sh/alex/hello
curl -X POST https://uldl.sh/u -F file=@notes.md
https://uldl.sh/alex/notes
curl https://uldl.sh/alex/notes
# My Notes
This is a markdown file uploaded via curl.
Access it from anywhere.