下载地址:https://cpe-package.upwan.net/upwan-cpe-2.2.4.x86.tar.gz (md5:c46058431cd2874069771c47f0f50348)
功能说明:
1、连接 UPWAN 云网络
2、自动配置系统路由
3、自带 DNS 服务,监听于 0.0.0.0:53 端口 (默认启动,如需禁用,请在启动中带 --nodns 参数)
部署说明:
1、下载 vCPE 软件
wget https://cpe-package.upwan.net/upwan-cpe-XXX.x86.tar.gz
tar zxf upwan-cpe-XXX.x86.tar.gz
得到 uptunnel 二进制运行文件
2、第一次启动 vCPE 软件,先获取 CPE ID,并在管理后台绑定设备
sudo ./uptunnel console
得到以下输出内容
------------------------------------------------------------------------------------------------------
Running on console mode!
Got Iface name: eth0
and Iface Mac: 0A:A5:DC:03:9F:D2
new key files were generated OK!
//
// UPWAN CPE-0A227D36 -- Doing Connection -->>>
Device with CPE-ID: CPE-0A227D36 is not bound, please contact with service provider, try 30s later!
------------------------------------------------------------------------------------------------------
3、在管理后台绑定当前 CPE ID 后
------------------------------------------------------------------------------------------------------
2021-10-13 07:07:59 INFO [httptasks::tasks_threadpool] thread starts running....
2021-10-13 07:07:59 INFO [uptunnel::cpe] DNS Process has been started!
2021-10-13 07:08:00 INFO [uptunnel::cpe] Ready to connect to server: 129.227.137.239!
2021-10-13 07:08:00 INFO [uptunnel::cpe] Server ip pool: ["129.227.137.239/32", "129.227.137.239/32", "129.227.137.239/32"]
2021-10-13 07:08:00 INFO [uptunnel::cpe] Connected Ok!
...
------------------------------------------------------------------------------------------------------
成功接入云网络
4、Ctrl+C 停止程序,并配置开机自动启动。 完成部署
sudo sysctl -w net.ipv4.ip_forward=1 //打开服务器网络流量转发功能
注意事项:
AWS 需要禁用源/目标检查
提示信息:
sudo ./uptunnel console // 指在前台运行程序
sudo ./uptunnel start // 指在后台运行程序(程序日志输出在系统中,如 /var/log/messages)
sudo ./uptunnel stop // 停止程序
sudo ./uptunnel start --nodns // --nodns 选项指不启动内置 DNS 服务(默认启动)
[参考] 配置 Systemd 系统服务:
请把以下配置内容写入 /etc/systemd/system/uptunnel.service 配置文件,并把 uptunnel 程序移动至:/usr/bin/uptunnel
[Unit]
Description=UPWAN tunnel
After=syslog.target network-online.target
Wants=network-online.target
Documentation=https://www.upwan.net/
[Service]
PrivateTmp=true
WorkingDirectory=/etc/
ExecStart=/usr/bin/uptunnel console
LimitNPROC=10
DeviceAllow=/dev/null rw
DeviceAllow=/dev/net/tun rw
Restart=always
RestartSec=1
ProtectSystem=true
KillMode=process
[Install]
WantedBy=multi-user.target
#end
执行 systemctl daemon-reload 加载配置文件
执行 systemctl start uptunnel 启动服务
执行 systemctl stop uptunnel 停止服务
执行 systemctl enable uptunnel 设置开机自动启动