NPS内网穿透工具学习2-服务端搭建

序言 通俗约定您已经,通晓基本的Linux知识(解压复制粘贴移动)、了解基本的网络知识(知晓什么是公网IP什么是内网IP)登录已root用户为准 版本 v0.26.9 linux_amd64_server.tar.gz centos7 已关闭Firewalld 下载解压安装 1 2 3 4 5 mkdir /home/nps cd /home/nps wegt https://github.com/ehang-io/nps/releases/download/v0.26.9/linux_amd64_server.tar.gz tar -zxvf linux_amd64_server.tar.gz ./nps install 撰写程序NPS配置文件 打开配置文件 vim /etc/nps/nps.conf 撰写systemd配置文件 vim创建service文件 1 vim /usr/lib/systemd/system/nps.service 填入以下内容 1 2 3 4 5 6 7 8 9 10 11 12 [Unit] Description=nps service After=network.target syslog.target Wants=network.target [Service] Type=simple ExecStart=/usr/bin/nps start ExecStop=/usr/bin/nps stop [Install] WantedBy=multi-user.target 启动并设置开机自启动 1 2 sudo systemctl start nps.service sudo systemctl enable nps.service 启动nps:sudo systemctl start nps 打开自启动:sudo systemctl enable nps 重启应用:sudo systemctl restart nps 停止应用:sudo systemctl stop nps 查看应用:sudo systemctl status nps 访问设置 关闭防火墙并设置关闭开机启动 ...

十二月 28, 2020 · 1 分钟 · 117 字 · 白墨

NPS 内网穿透工具学习记录

介绍 2021年5月18日更新 官方更新了docker安装方式,推荐用这个方法强烈推荐 地址 nps是一款轻量级、高性能、功能强大的内网穿透代理服务器。目前支持tcp、udp流量转发,可支持任何tcp、udp上层协议(访问内网网站、本地支付接口调试、ssh访问、远程桌面,内网dns解析等等……),此外还支持内网http代理、内网socks5代理、p2p等,并带有功能强大的web管理端。支持中文 官方文档 https://ehang-io.github.io/nps/#/ 登录界面 安装 https://github.com/ehang-io/nps/releases 去Github下载对应计算机架构系统版本的服务器包 部分架构包图 Github加速下载 https://d.serctl.com/ 安装为系统服务 1 ./nps install 注意事项 看下面这句话 1 2 3 2020/12/27 13:52:08当前目录中的静态文件和配置文件将无用 2020/12/27 13:52:08新的配置文件位于/etc/nps中,您可以对其进行编辑 注意客户端与服务端版本一样 使用systemctl来控制启动服务端 1 sudo vi /lib/systemd/system/nps.service [Unit] Description=nps service After=network.target syslog.target Wants=network.target [Service] Type=simple ExecStart=/usr/bin/nps start [Install] WantedBy=multi-user.target 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 * 启动nps:`sudo systemctl start nps` * 打开自启动:`sudo systemctl enable nps` * 重启应用:`sudo systemctl restart nps` * 停止应用:`sudo systemctl stop nps` * 查看应用:`sudo systemctl status nps` ### 注意事项 现在NPS的配置文件在/etc/nps中,不用在当前目录配置 可以删除了 ### 默认端口 * nps默认配置文件使用了80,443,8080,8024端口 * 80与443端口为域名解析模式默认端口 * 8080为web管理访问端口 * 8024为网桥端口,用于客户端与服务器通信 访问web控制端 -------- http://公网ip:8080 注意 需要开启防火墙端口,云服务器也需要安全组放行 客户端安装与systemctl来控制启动 -------------------- ### 注意事项 [注意看官方文档](https://ehang-io.github.io/nps/#/use?id=%E6%B3%A8%E5%86%8C%E5%88%B0%E7%B3%BB%E7%BB%9F%E6%9C%8D%E5%8A%A1),很完善 下面报错是因为systemctl找不到npc二进制启动文件,指定就行 ![](https://gao4.top/wp-content/uploads/2020/12/Snipaste_2020-12-27_22-38-23.png) 启动报错 安装客户端 ----- 解压后执行 ./npc install ...

十二月 27, 2020 · 1 分钟 · 187 字 · 白墨

Tinc全球虚拟局域网搭建记录

安装 1 apt-get install tinc 开启IPv4转发 1 echo "net.ipv4.ip_forward = 1" >> /etc/sysctl.conf && sysctl -p 创建一个名为imlala的虚拟网络 1 mkdir -p /etc/tinc/imlala && mkdir -p /etc/tinc/imlala/hosts 新建tinc.conf配置文件 1 vim.tiny /etc/tinc/imlala/tinc.conf 配置文件内容 1 2 3 4 5 Name=imlala Interface=vpn Cipher=aes-256-cbc Digest=sha512 ConnectTo=imlala 网络名就是imlala,网卡接口名vpn,以及加密方式 建hosts文件 1 vim.tiny /etc/tinc/imlala/hosts/imlala 需要注意这个文件名必须和tinc.conf内的Name 写入如下配置 1 2 Address = 你的VPS公网IP Subnet = 10.0.0.1/32 完成之后生成密匙对 1 tincd -n imlala -K4096 按两下回车全部保持默认配置,生成完成之后,对应的文件路径 ...

八月 6, 2020 · 2 分钟 · 260 字 · 白墨