Hello, welcome to NETVN channel
In this video I will show you how to build a private vpn server that does not need port forwarding on the router and also does not need dynamic domain name service.
To do that I prepare an old laptop and turn it into a vpn server
I will install Ubuntu server operating system on this computer
You need to make sure the target computer is connected to the internet
First you go to the Ubuntu homepage and download the server installation version
I use an 8GB USB stick to create the Ubuntu server installer
Next I used the rufus tool to create a bootable installation USB stick
With rufus tool you can easily create a bootable installer
After obtaining the installer, you plug it into the target computer
In the BIOS or UEFI you set the computer to boot from the USB stick
Next are the steps to install Ubuntu server operating system on the target computer
You will be asked to set the language, keyboard
You don't need to set up a static ip address for the target computer because you don't need to forward the port on the router
So I set the target computer to use the dynamic ip address allocated from the router
While installing the operating system you are asked to create an administrator account, create a new one and write it down to access this computer over the network
Make sure to enable OpenSSH server when installing Ubuntu Server operating system
Here you remove the installation USB stick from the target computer and press Enter key to restart the computer
Target computer has ip address 192.168.1.13
Thus I have completed the installation of Ubuntu Server OS for the target laptop
Next I use a Windows 11 computer to access the target computer over the network
If you don't know the ip address of the target computer you can use ip address scanner software to find it.
I will use it for remote access over the network using ssh
You use the admin account created when installing the Ubuntu server operating system and the ip address of the target computer for remote access over the network using ssh
To build my own vpn server without port forwarding on the router I use zerotier
You just need to register for a free account, which is enough for your personal needs
This is my network identifier, clients will connect to this network using this network identifier
Zerotier allows you to route between a physical network and a virtual private network so that remote network devices can access local resources over the internet.
And here are the instructions from the Zerotier homepage
Next I will use this to turn the target computer into a vpn server without port forwarding on the router
You will install zerotier to the target computer
To install zerotier on Ubuntu server operating system, just copy this command and paste it into the command window as above
Zerotier has been successfully installed on the target computer
Next I set up this computer to join the vpn network I just created
This is the command for this computer to join the vpn network named netvn
You copy and paste the network identifier to complete the command
Join vpn network successfully
Next you allow this computer to join the vpn network named netvn
And this is the information of this computer when joining the network, including ip address, interface name, network identifier
Next you route between the two physical networks and the zerotier network so that remote computers can access the local network using the target computer.
You need to determine the range of local network ip addresses you are using
Here I use the address range of 192.168.1.0/24
With this range of ip addresses, you route as above
You replace 24 with 23 to make sure the routing works well
The remote computers will access the local network through the ip address of the target computer
so you copy and paste the ip address of the target computer here
Next you set up port forwarding on the Ubuntu server computer
Port forwarding on the target computer to forward traffic between two network interfaces, one physical network interface and one zerotier network interface
NPort forwarding on the target computer to forward traffic between two network interfaces, one physical network interface and one zerotier network interface
Default port forwarding on Ubuntu server disable so you enable it
Open the sysctl.conf file and uncomment the net.ipv4.ip_forward line to enable port forwarding.
Then don't forget to save your changes before closing the file
As instructed here you use these 3 commands to forward between two network interfaces
Before port forwarding you need to define the network interface names
The network interfaces you need to define are the physical network interface and the vpn network interface created by zerotier
On Ubuntu server you install the net tools package to look up information about the network interfaces of the target computer
Next you use the ifconfig command to look up information about the network interface
And here are the names of the interfaces on the Ubuntu server computer
I will copy the network interface names to edit the commands to suit the target computer
The first command you just need to edit the physical network interface name
The remaining two commands you edit both the physical network interface name and the vpn network interface created by zerotier
After updating the correct network interface name, just copy and paste the command as above
With these 3 commands you have completed routing between two network interfaces on the target computer
The next command will save the routes you just set up even when the Ubuntu server computer restarts
So I built a vpn server that doesn't need port forwarding on the router and doesn't need a static public ip address or dynamic domain name service
Next I will check from a Windows computer over the internet
But before that, don't forget to find yourself a t-shirt below this video
Or click like and subscribe
And this is the laptop I will join the vpn network and access the resources of the local network via the internet
This laptop has a different public address than the target computer
To join the newly created vpn network you go to the zerotier homepage and download the client for Windows operating system
After downloading, install it like any other software
Want to join a vpn network named netvn, I enter the correct network identifier and join
This computer has joined a vpn network called netvn
But it needs administrator permission, so I go to the admin page and allow this computer to join
The remote Windows computer has been joined to the network named netvn
Now from the remote computer I have access to internal resources
This computer has ip address 192.168.11.3
With the ping command I know this computer is connected to the network 192.168.1.0/24
From this computer I access the shared folder in the local network
The computer with the shared folder has an ip address of 192.168.1.12
Successful access
Thank you for watching, don't forget to like and subscribe to the channel
On this computer I try disconnecting to check if the vpn server is working properly
As you can see it works well, this way you can build a server without port forwarding on the router, no need to use dynamic domain name service
Good luck