---
title: "Build Your Own NAT Traversal with the New 2024 Version of NPS"
url: https://www.geekcorelab.cn/en-US/post/use-the-2024-new-version-of-nps-to-build-internal-network
updated: 2026-10-30T02:38:34.360747Z
author: "hhjmk"
summary: "文章介绍了新版NPS的修复与功能提升，以及其部署和配置方法。新版NPS修复了原版漏洞，保持兼容并增加新功能，部署方式与原版相同。教程详细说明了在具有公网IP的服务器上部署NPS的步骤，包括系统选择、文件下载、安装启动和配置修改。还介绍了如何通过iptables放通端口并持久化规则，以及如何新增客户端和安装配置NPC。整个过程需替换服务器IP和验证密钥以完成连接。"
---

# Build Your Own NAT Traversal with the New 2024 Version of NPS

[
![](/uploads/import-placeholder/30)
](https://github.com/ehang-io/nps)The image above shows the original NPS, which has now stopped being updated and has many issues. Fortunately, an expert has taken over its development

[
![](/uploads/import-placeholder/142)
](https://github.com/yisier/nps)The new version of NPS fixes most vulnerabilities and, while remaining compatible with the original NPS, adds more features

Its deployment method is the same as the original NPS

Deployment tutorial
----

First, you need a server with a public IP. Taking [雨云](https://www.rainyun.com/github_) as an example, purchasing a 1-core, 1GB US server is sufficient

![](/uploads/import-placeholder/200)
For the system, just choose the default Debian11+BBR network optimization

It will be created automatically upon purchase. At this point, you can first download NPS and NPC (as needed; if the server can connect to Github normally, there is no need to download NPS; if the client can connect to Github normally, there is no need to download NPC)

[Releases (github.com)](https://github.com/yisier/nps/releases)

![](/uploads/import-placeholder/72)
Since both the server and client are Linux, download the Linux 64-bit versions of NPS and NPC here

![](/uploads/import-placeholder/12)
At this point, the server should have been deployed. Let's use SSH software to connect to the server

![](/uploads/import-placeholder/72)
If the server can connect to Github normally, just copy the NPS link

Then use wget to download the file to the server

```
wget https://github.com/yisier/nps/releases/download/v0.26.17/linux_amd64_server.tar.gz
```

![](/uploads/import-placeholder/258)
Extract the file

```
tar -xvf linux_amd64_server.tar.gz
```

Install NPS

```
./nps install
```

![](/uploads/import-placeholder/254)
Start NPS

```
nps start
```

Modify the NPS configuration file
---------

After installing NPS using the method in this tutorial, the configuration file will be in the /etc/nps directory, with the filename nps.conf

In it, you can set the username, password, listening port, etc.

Access the NPS Web management console
------------

Because iptables does not allow the required ports by default

![](/uploads/import-placeholder/15)
We need to run the following commands to open the required ports

```
iptables -A INPUT -p tcp --dport 8081 -j ACCEPT #放通8081 web端口
iptables -A INPUT -p tcp --dport 8024 -j ACCEPT #放通8024 客户端连接端口
iptables -A INPUT -p tcp --dport 80 -j ACCEPT #放通80
iptables -A INPUT -p tcp --dport 443 -j ACCEPT #放通443
```

You can open more ports as needed

Then persist the iptables rules

```
apt-get install iptables-persistent
```

Just press Enter all the way through

Then log in to the Web management console and open it using your server IP:8081

![](/uploads/import-placeholder/105)
The default username and password are admin/123

Add a client
-----

![](/uploads/import-placeholder/81)
After logging in to the Web admin backend, click Client - Add

On the new page, scroll to the bottom and click Add

![](/uploads/import-placeholder/136)
Copy this verification key; it is needed when installing the client

Install the client
-----

Download NPC to the client, then use the following command to install

```
./npc install -server=服务器IP:8024 -vkey=唯一验证密钥

```

This command will install NPC on the client. You need to replace the server IP and unique verification key with the actual values

Start the client:

```
npc start
```

Then you can see that the client has connected successfully

![](/uploads/import-placeholder/411)
