Skip to main content

Using DDNS to Achieve Remote Access to Devices on an Internal Network

Ven2s...About 3 minHome Network LayoutDDNSNetwork

Using DDNS and Port Forwarding to achieve remote access to devices on an internal network

Introduction

  • Recently, I got into an AI drawing software called stable-diffusion-webui. Due to its heavy reliance on GPU, I could only use my home computer for this purpose (which has a 6-year-old GTX 1060😥). However, as I work remotely, I decided to explore the realm of Dynamic Domain Name System (DDNS) to achieve remote control of my home computer and other network devices.

Z
D
B

  • This tutorial (memo) serves two purposes: to showcase achievements and to provide guidance for others with similar needs. Many tutorials I found didn't explain DDNS clearly or how to use it.

  • DDNSopen in new window (Dynamic Domain Name System) is a service that maps the dynamic IPv4 address of a home network to a fixed domain name resolution service.

  • Cloudflareopen in new window is a globally renowned DNS service provider.

  • DDNS-GOopen in new window is an excellent DDNS resolution service tool. Many thanks to the author for solving my crucial problem.

  • Public IPopen in new window - I must say, the service level of the telecom company is impressive. They provided me with a public IP within half a day. Although there are many ways to bypass the public IP for accessing the internal network, through my testing, using more advanced methods like remote connection services and tunneling tools, the most straightforward method still offers the best cost-effectiveness and user experience.

    RDP
    You can see the latency here is very low

Getting Started

  • Before we begin, let me briefly explain my home network layout. There is a weak current box with a fiber optic modem in bridge mode, a main router responsible for dialing, a K2P router in the bedroom in AP mode, an old laptop acting as a secondary router (secondary route), which is installed with PVE, PVE uses openWRT, and a desktop computer. I forgot to draw it on visio.

    Network Layout
    Network Layout Diagram
  • Don't ask me why I don't use DHCP on openWRT. I tried many times but couldn't connect to the internet. It might be because the network port is bound to the MAC address. I don't know how to unbind it. So, I can only bind the MAC of my computer on the main router to connect to the internet. (Maybe it's not the reason; even binding the WAN port address on openWRT doesn't allow me to connect to the internet.) My home network environment is really too complicated😥

Let's Begin

  • Download DDNS-GOopen in new window to your local machine and unzip it. Then, use administrator privileges to navigate to the root directory.

Installation

.\ddns-go.exe -s install

Uninstall

.\ddns-go.exe -s uninstall
DDNS-GO
DDNS-GO
  • After installation, you can see the ddns-go service in the services, and set it to start automatically.

    DDNS-GO Service
    Enable DDNS-GO service
  • Open http://127.0.0.1:9876open in new window, you can see that ddns-go supports many dynamic resolution service providers as shown below.

    DDNS-GO Configuration 1
    DDNS-GO Page
  • Go to cloudflare and get the API token, which is the Token in the image below. Pay attention to selecting all regions for zone resources.

    Cloudflare Configuration 1
    Cloudflare Configuration 2

  • Return to DDNS-GO as shown in the image below. Configure it as shown below. If you have a public network, only select IPv4. If you don't have a public network, select IPv6 (I have both, so I selected both; you can do the same without any issues). Enter your domain name after the hostname. For information on how to obtain IPv6, I'll do a detailed tutorial next time. (I recommend a handy CF domestic APIopen in new window that can accurately obtain your local IP address, regardless of whether you use a scientific Internet access tool).

    DDNS-GO Configuration 2
    DDNS-GO Configuration 3
    DDNS-GO Configuration 4

  • After clicking saveOnce saved successfully, you will see the A record (IPv4 address) or AAAA record (IPv6 address) that you have resolved on Cloudflare in your domain's DNS service, and you can also see the successful resolution prompt in ddns-go.

  • At this point, you have finally successfully resolved your dynamic IP. Set up port forwarding services on the main router and secondary router, and you can access your home devices anytime, anywhere.

Take some time to record how to effectively forward ports to prevent me from forgetting again

Comments
  • Latest
  • Oldest
  • Hottest
Powered by Waline v2.15.8