<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>内网穿透归档 - Liao&#039;s blog</title>
	<atom:link href="https://www.laobaiblog.top/tag/%E5%86%85%E7%BD%91%E7%A9%BF%E9%80%8F/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.laobaiblog.top/tag/内网穿透/</link>
	<description>路漫漫其修远兮，吾将上下而求索</description>
	<lastBuildDate>Wed, 02 Nov 2022 06:45:06 +0000</lastBuildDate>
	<language>zh-Hans</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://www.laobaiblog.top/wp-content/uploads/2022/01/cropped-tyuu-32x32.png</url>
	<title>内网穿透归档 - Liao&#039;s blog</title>
	<link>https://www.laobaiblog.top/tag/内网穿透/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Docker安装nps实现[OpenWrt]内网穿透</title>
		<link>https://www.laobaiblog.top/2022/11/02/docker%e5%ae%89%e8%a3%85nps%e5%ae%9e%e7%8e%b0openwrt%e5%86%85%e7%bd%91%e7%a9%bf%e9%80%8f/</link>
		
		<dc:creator><![CDATA[大白]]></dc:creator>
		<pubDate>Wed, 02 Nov 2022 06:36:43 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[分享]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[nps]]></category>
		<category><![CDATA[openwrt]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[内网穿透]]></category>
		<guid isPermaLink="false">https://www.laobaiblog.top/?p=334</guid>

					<description><![CDATA[<p>一、NPS 概述 NPS 是一款轻量级、功能强大的内网穿透代理服务器。支持 tcp、udp 流量转发 &#8230;</p>
<p><a href="https://www.laobaiblog.top/2022/11/02/docker%e5%ae%89%e8%a3%85nps%e5%ae%9e%e7%8e%b0openwrt%e5%86%85%e7%bd%91%e7%a9%bf%e9%80%8f/">Docker安装nps实现[OpenWrt]内网穿透</a>最先出现在<a href="https://www.laobaiblog.top">Liao&#039;s blog</a>。</p>
]]></description>
										<content:encoded><![CDATA[<h3>一、NPS 概述</h3>
<p>NPS 是一款轻量级、功能强大的内网穿透代理服务器。支持 tcp、udp 流量转发，支持内网 http 代理、内网 socks5 代理，同时支持 snappy 压缩、站点保护、加密传输、多路复用、header 修改等。支持 web 图形化管理，集成多用户模式。管理系统比 FRP 方便很多，更容易上手。</p>
<h3>二、配置要求</h3>
<ul>
<li>一台拥有公网 IP 的服务器。</li>
<li>开放端口例如：(8080,8024,80,443）等可以不是这些端口，nps可以配置任意端口，实现与其它服务共存。</li>
</ul>
<h3>三、相关文档</h3>
<ul>
<li>NPS 配置文档：https://ehang-io.github.io/nps/#/</li>
<li>NPS 安装包：https://github.com/ehang-io/nps/releases</li>
<li>NPS 源码：https://github.com/ehang-io/nps</li>
</ul>
<h3>四、环境说明</h3>
<ul>
<li>服务器端是我的Ubuntu(arm)云服务器；</li>
<li><strong>客户端是本地N1盒子Openwrt系统的nps插件（无需安装客户端）</strong>。</li>
</ul>
<h3>五、演示安装</h3>
<h4>1. 服务端</h4>
<ul>
<li><strong>Docker拉取Nps镜像</strong></li>
</ul>
<pre><code class="language-shell line-numbers">#拉取nps镜像
docker pull ffdfgdfg/nps
#创建nps配置文件目录
mkdir -p /root/nps/conf
</code></pre>
<ul>
<li>github下载配置文件，<strong>将nps-master下的conf文件拷贝至服务器上的/root/nps/conf目录下</strong></li>
</ul>
<p><a class="wp-editor-md-post-content-link" href="https://www.laobaiblog.top/wp-content/uploads/2022/11/wp_editor_md_265c4dd6295be6b20c0ebbaea52b7f2f.jpg"><img decoding="async" src="https://www.laobaiblog.top/wp-content/uploads/2022/11/wp_editor_md_265c4dd6295be6b20c0ebbaea52b7f2f.jpg" alt="" /></a></p>
<p><span id="more-334"></span></p>
<p><a class="wp-editor-md-post-content-link" href="https://www.laobaiblog.top/wp-content/uploads/2022/11/wp_editor_md_5f324c40e1444e06a3980f7f451b335a.jpg"><img decoding="async" src="https://www.laobaiblog.top/wp-content/uploads/2022/11/wp_editor_md_5f324c40e1444e06a3980f7f451b335a.jpg" alt="" /></a></p>
<ul>
<li><strong>修改nps.conf配置</strong></li>
</ul>
<pre><code class="language-shell line-numbers">#编辑nps.conf
vim /root/nps/conf/nps.conf

#nps.conf
appname = nps
runmode = dev

http_proxy_ip=0.0.0.0
http_proxy_port=19000
https_proxy_port=19001
https_just_proxy=true

https_default_cert_file=conf/server.pem
https_default_key_file=conf/server.key

bridge_type=tcp
bridge_port=19002
bridge_ip=0.0.0.0

public_vkey=123

log_level=7

web_host=a.o.com
web_username=admin
web_password=123
web_port = 19003
web_ip=0.0.0.0
web_base_url=
web_open_ssl=false
web_cert_file=conf/server.pem
web_key_file=conf/server.key
auth_crypt_key =1234567887654321
allow_user_login=false
allow_user_register=false
allow_user_change_username=false
allow_flow_limit=false
allow_rate_limit=false
allow_tunnel_num_limit=false
allow_local_proxy=false
allow_connection_num_limit=false
allow_multi_ip=false
system_info_display=false
http_cache=false
http_cache_length=100
http_add_origin_header=false[object Object]


</code></pre>
<ul>
<li><strong>docker启动nps，注意防火墙是否开放相关端口</strong></li>
</ul>
<pre><code class="language-shell line-numbers">#启动nps，端口开放19000-19010
docker run -d -p 19000-19010:19000-19010 -v /root/nps/conf:/conf --name=nps --restart=always ffdfgdfg/nps
</code></pre>
<ul>
<li><strong>访问Nps后台：http://IP:19003 默认账号密码是配置文件中的admin/123(可自行更改)。</strong></li>
</ul>
<p><a class="wp-editor-md-post-content-link" href="https://www.laobaiblog.top/wp-content/uploads/2022/11/wp_editor_md_dc27a065af42956f136ee1424fd069e9.jpg"><img decoding="async" src="https://www.laobaiblog.top/wp-content/uploads/2022/11/wp_editor_md_dc27a065af42956f136ee1424fd069e9.jpg" alt="" /></a></p>
<ul>
<li><strong>创建nps客户端及tcp隧道</strong></li>
</ul>
<p><a class="wp-editor-md-post-content-link" href="https://www.laobaiblog.top/wp-content/uploads/2022/11/wp_editor_md_1f47862aa69dd09a9dd397316ba0d9cc.jpg"><img decoding="async" src="https://www.laobaiblog.top/wp-content/uploads/2022/11/wp_editor_md_1f47862aa69dd09a9dd397316ba0d9cc.jpg" alt="" /></a></p>
<p><!--more--></p>
<p>创建客户端，点击客户端详情查看 <strong>-server/-key</strong> 两个参数。</p>
<p><a class="wp-editor-md-post-content-link" href="https://www.laobaiblog.top/wp-content/uploads/2022/11/wp_editor_md_3e67ef83c08e03524f834e442df1a1a9.jpg"><img decoding="async" src="https://www.laobaiblog.top/wp-content/uploads/2022/11/wp_editor_md_3e67ef83c08e03524f834e442df1a1a9.jpg" alt="" /></a></p>
<h4>2. 客户端</h4>
<ul>
<li><strong>进入内网OpenWrt，打开nps插件，输入server及key参数保存，在服务端即可发现客户端已连接。</strong></li>
</ul>
<p><a class="wp-editor-md-post-content-link" href="https://www.laobaiblog.top/wp-content/uploads/2022/11/wp_editor_md_fa3e4010917fd1997f207478acc8c24f.jpg"><img decoding="async" src="https://www.laobaiblog.top/wp-content/uploads/2022/11/wp_editor_md_fa3e4010917fd1997f207478acc8c24f.jpg" alt="" /></a></p>
<h4>3. 配置转发</h4>
<ul>
<li><strong>查看客户端状态</strong></li>
</ul>
<p>此处可以看到一个客户端ID为6，连接状态为在线。</p>
<p><a class="wp-editor-md-post-content-link" href="https://www.laobaiblog.top/wp-content/uploads/2022/11/wp_editor_md_701405fdb3565a5c8c329c7b615ee226.jpg"><img decoding="async" src="https://www.laobaiblog.top/wp-content/uploads/2022/11/wp_editor_md_701405fdb3565a5c8c329c7b615ee226.jpg" alt="" /></a></p>
<ul>
<li><strong>添加tcp隧道转发</strong></li>
</ul>
<p>如下配置表示<strong>将服务端的1XXX6端口转发到局域网内192.168.50.1/3的80/5244等端口</strong>。其他的UDP、SOCKS、HTTP也是类似的配置不再赘述。</p>
<p><a class="wp-editor-md-post-content-link" href="https://www.laobaiblog.top/wp-content/uploads/2022/11/wp_editor_md_7a46b904fdeb607003c0270434ee4951.jpg"><img decoding="async" src="https://www.laobaiblog.top/wp-content/uploads/2022/11/wp_editor_md_7a46b904fdeb607003c0270434ee4951.jpg" alt="" /></a></p>
<h4>4. 总结</h4>
<p>NPS及OpenWrt的配置安装都很便捷，如果你有一台自己的VPS云服务器，可以尝试一下，将你的家庭本地电脑映射到外网服务器。<strong>访问公网IP+对应1XXXX端口即可访问到内网对应服务。</strong></p>
<h4>5. 参考文章</h4>
<p>不同的安装环境可以看看其他博文：</p>
<p>超详细openwrt内网穿透-nps小白教程：https://vpsxb.net/419/<br />
软路由openwrt之nps内网穿透插件服务：https://www.vjsun.com/424.html<br />
nps实现内网穿透，电脑免费变云服务器：https://tangly1024.com/article/nps-centos-nat-traversal<br />
N1盒子op系统nps内网穿透对接腾讯云傻妞：https://blog.csdn.net/hebine7/article/details/122373365<br />
docker安装nps实现内网穿透：https://5616760.com/docker/nps/2021/08/09/docker-nps.html</p>
<p><a href="https://www.laobaiblog.top/2022/11/02/docker%e5%ae%89%e8%a3%85nps%e5%ae%9e%e7%8e%b0openwrt%e5%86%85%e7%bd%91%e7%a9%bf%e9%80%8f/">Docker安装nps实现[OpenWrt]内网穿透</a>最先出现在<a href="https://www.laobaiblog.top">Liao&#039;s blog</a>。</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
