Skip to content
Download

NAT Traversal Server Deployment

NAT traversal refers to mapping certain ports of a server located in an internal network onto the public Internet through technical means, allowing public network clients to access the internal server.

Currently common technologies include Frp, Ngrok, etc. They work by setting up a proxy service on a public server to forward traffic to the internal server, achieving NAT traversal. Of course, if your NAT type is NAT1 (Full Cone NAT), you can use the STUN protocol for NAT traversal.

Below, we introduce the setup process for both techniques. The proxy server uses SakuraFrp as an example, and STUN traversal uses Lucky as an example.

  1. Configure the server-side network parameters as needed.
  2. Set the listening port as desired; here we use the default TCP port 11010 as an example.
  3. Click “Run Network.” Enter Address and Port
  1. Open the FRP website — Register — Log in — Complete identity verification.
  2. Check the status of available FRP nodes.
  3. Create an FRP tunnel. Due to ISP QoS and node settings, TCP tunnels are recommended as the first choice.

SakuraFrp Create Tunnel

  1. Change the local IP to a LAN IP (loopback addresses like 127.0.0.1 will prevent the virtual network from connecting).

Modify Local IP

  1. Change the local port to the listening port you configured in QtEasyTier (default 11010).

Tunnel Result

When choosing a relay node, consider the following in order of priority:

  • Prefer multi-line / tri-line nodes in the same province.
  • If no same-province node is available, prefer physically closer multi-line / tri-line nodes.
  • If no multi-line / tri-line nodes are available, prefer nodes of the same ISP and avoid cross-ISP access as much as possible. On this basis, choose a node that is physically closer.
  • When no other options exist, choose a node physically closest to you.
  • Specifically, for China Broadcom (广电) users without multi-line / tri-line options, try China Mobile or China Unicom nodes.
  1. Download the appropriate third-party launcher or frpc for your device. Download Software
  2. Configure the launcher (follow the guided setup; not detailed here).
  3. Start the tunnel.
  4. Check the FRP logs to obtain the FRP relay address and port. FRP Logs
  5. When forming a virtual network, enter the FRP relay address and port in the server field.

This section is based on Lucky or other STUN NAT traversal software. Lucky is used as the example below.

STUN (Session Traversal Utilities for NAT) NAT traversal technology helps solve network connection problems caused by NAT technology. STUN allows NAT1 users to obtain a public port and expose internal service ports to the external network through router port forwarding or Lucky’s built-in forwarding, achieving NAT traversal.

The port penetration provided by the STUN feature is for trial use only, and the frequency of port changes cannot be guaranteed. Please note that no technical support is provided for STUN stability-related issues. Likewise, we do not offer any solutions for accessing internal networks without a public IPv4 address.

For basic STUN NAT traversal usage, see STUN NAT Traversal.

The server startup method is the same as before and will not be repeated.

  1. Check your NAT type.

  2. Configure DMZ or UPnP.

  3. Create a penetration port. (1) TCP Penetration Under Lucky -> NAT Traversal -> STUN NAT Traversal, create a new penetration rule. Set the penetration protocol to IPv4-TCP.

    • The penetration channel local port can be 0 (random port) or a manually specified unused port above 10240 (recommended).
    • The target address should be the device’s IP address (must not be within 127.0.0.0/8).
    • The target port is the corresponding EasyTier listening port. STUN Reference Config (2) UDP Penetration
    • UDP penetration is the same as TCP, except the penetration type is changed to UDP. (3) Manual Configuration
    • Instead of using Lucky’s built-in port forwarding, manually open the corresponding firewall and port forwarding rules for higher forwarding efficiency.
  4. Successful STUN NAT Traversal STUN NAT Traversal Result

  5. Fixing the STUN penetration port EasyTier supports obtaining links via DNS TXT records, SRV records, and HTTP(s) requests to retrieve the peer device’s IP + port. Therefore, we can use Lucky -> Dynamic DNS to create corresponding resolution records or Lucky -> Web Service to achieve dynamic address resolution. (1) TXT Record Under Lucky -> Dynamic DNS -> Add DDNS Record, add a TXT record. Set the record name to the domain to be updated, record type to TXT, and record content to Lucky’s global variable tcp://{STUN_RuleName_ADDR}. DDNS TXT Reference Config DDNS Config Result (2) SRV Record Configuration and flexibility are lower than TXT, so we will not expand on how to implement this here. If needed, refer to ie-12’s tutorial. (3) HTTP Record The advantage of HTTP over DNS TXT records is that dynamically changing ports can be resolved in real time without lag caused by DNS caching. However, the prerequisite is setting up a Web reverse proxy and STUN penetration.

    Under Lucky -> Web Service -> Add Sub Rule, create a site. Set the service type to Text Output and the frontend address to your domain resolution address. This address can be the same as your TXT record, since one is an A/AAAA record and the other is a TXT record — they do not conflict. HTTP(s) Reference Config

  1. Enter the STUN penetration address and port in the server field.
  2. Or enter the TXT record in the server field.
  3. Start the virtual network. Enter TXT Record