第1章 场景描述
Windows11通过远程桌面连接访问非局域网内的windows10。
业务分析:在非局域网下使用远程桌面连接工具需要通过内网穿透实现。
第2章 资源准备
第3章 操作步骤
3.1.在云服务器安装nps(服务端)
1)下载&解压
wget https://github.com/ehang-io/nps/releases/download/v0.26.10/linux_amd64_server.tar.gz
tar -zxf linux_amd64_server.tar.gz
2)安装
./nps install
3)修改配置文件
文件地址/opt/conf/nps.conf
appname = nps
#Boot mode(dev|pro)
runmode = dev
#HTTP(S) proxy port, no startup if empty
http_proxy_ip=0.0.0.0
http_proxy_port=80
https_proxy_port=443
https_just_proxy=true
#default https certificate setting
https_default_cert_file=/opt/conf/server.pem
https_default_key_file=/opt/conf/server.key
##bridge
bridge_type=tcp
bridge_port=8024
bridge_ip=0.0.0.0
# Public password, which clients can use to connect to the server
# After the connection, the server will be able to open relevant ports and parse related domain names according to its own configuration file.
public_vkey=123
#Traffic data persistence interval(minute)
#Ignorance means no persistence
#flow_store_interval=1
# log level LevelEmergency->0 LevelAlert->1 LevelCritical->2 LevelError->3 LevelWarning->4 LevelNotice->5 LevelInformational->6 LevelDebug->7
log_level=7
#log_path=nps.log
#Whether to restrict IP access, true or false or ignore
#ip_limit=true
#p2p
#p2p_ip=127.0.0.1
#p2p_port=6000
#web
web_host=a.o.com
web_username=xxx
web_password=xxx
web_port = 8080
web_ip=0.0.0.0
web_base_url=
web_open_ssl=false
web_cert_file=/opt/conf/server.pem
web_key_file=/opt/conf/server.key
web_key_file=/opt/conf/server.key
# if web under proxy use sub path. like http://host/nps need this.
#web_base_url=/nps
#Web API unauthenticated IP address(the len of auth_crypt_key must be 16)
#Remove comments if needed
#auth_key=test
auth_crypt_key =1234567812345678
#allow_ports=9001-9009,10001,11000-12000
#Web management multi-user login
allow_user_login=false
allow_user_register=false
allow_user_change_username=false
#extension
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
#cache
http_cache=false
http_cache_length=100
#get origin ip
http_add_origin_header=false
#pprof debug options
#pprof_ip=0.0.0.0
#pprof_port=9999
#client disconnect timeout
disconnect_timeout=60
修改登录的账号密码
4)启动
nps start
5)开通服务的端口
firewall-cmd --zone=public --add-port=8080/tcp --permanent
firewall-cmd --reload
firewall-cmd --permanent --list-ports
6)登录服务端界面
浏览器地址:云服务器IP地址+端口号
3.2.登录nps页面设置
1)新建一个客户端的链接方式
客户端 —> 新增
创建唯一验证密钥,其他默认即可
2)创建TCP隧道
3.3.在windows中安装npc(客户端)
下载地址:
https://github.com/ehang-io/nps/releases/tag/v0.26.10
解压到本地
修改配置文件
执行安装npc服务
使用管理员身份打开cmd命令提示符窗口
npc.exe install -server=117.50.180.78:8024 -vkey=123456 -type=tcp
查看服务端中服务是否注册成功,客户端地址是否出现,连接在线
第4章 验证
使用远程桌面连接工具查看是否可以正常连接