Failed to connect newt, Oracle VPS setup #426

Closed
opened 2025-11-13 12:00:02 -06:00 by GiteaMirror · 9 comments
Owner

Originally created by @KostyalBalint on GitHub (Jun 11, 2025).

Hi Pangolin Team!

First of all, awesome project, I really love the whole app, and the documentation :)

I'm currently trying to set up Pangolin to expose my self-hosted services, but really struggling, and don't know what I'm doing wrong :(

I successfully installed Pangolin on an Oracle Free Tier VPS server running Ubuntu. I opened all the required ports 80/TCP, 443/TCP, 51820/UDP, and Pangolin seems to be running correctly.

To confirm this, here is a netcat result from my remote site:

balint@truenas:~$ nc -vzu pangolin.mydomain.com 51820
Connection to pangolin.mydomain.com (xxx.xxx.xxx.xxx) 51820 port [udp/*] succeeded!
balint@truenas:~$ nc -vz pangolin.mydomain.com 80
Connection to pangolin.mydomain.com (xxx.xxx.xxx.xxx) 80 port [tcp/http] succeeded!
balint@truenas:~$ nc -vz pangolin.mydomain.com 443
Connection to pangolin.mydomain.com (xxx.xxx.xxx.xxx) 443 port [tcp/https] succeeded! 

Also, I enabled ICMP on Oracle's Firewall, as I remember correctly that it is also needed for Pangolin to work. So I can also ping the Oracle VPS as expected.

But when I try to run newt on my remote site (truenas), I get this error:

INFO: 2025/06/11 14:04:30 Received: {Type:newt/wg/connect Data:map[endpoint:pangolin.mydomain.com:51820 publicKey:<pub_key> serverIP:100.89.128.1 targets:map[tcp:[] udp:[]] tunnelIP:100.89.128.4]}
INFO: 2025/06/11 14:04:30 WireGuard device created. Lets ping the server now...
INFO: 2025/06/11 14:04:30 Ping attempt 1
INFO: 2025/06/11 14:04:30 Pinging 100.89.128.1
WARN: 2025/06/11 14:04:40 Ping attempt 1 failed: failed to read ICMP packet: i/o timeout
INFO: 2025/06/11 14:04:40 Starting ping check
INFO: 2025/06/11 14:04:40 Ping attempt 2
INFO: 2025/06/11 14:04:40 Pinging 100.89.128.1
[...]

Also, I'm running Tailscale alongside on this setup, but I don't think that should interfere.

Thanks in advance for any guidance or directions I could take to resolve this issue

Originally created by @KostyalBalint on GitHub (Jun 11, 2025). Hi Pangolin Team! First of all, awesome project, I really love the whole app, and the documentation :) I'm currently trying to set up Pangolin to expose my self-hosted services, but really struggling, and don't know what I'm doing wrong :( I successfully installed Pangolin on an Oracle Free Tier VPS server running Ubuntu. I opened all the required ports `80/TCP, 443/TCP, 51820/UDP`, and Pangolin seems to be running correctly. To confirm this, here is a `netcat` result from my remote site: ```bash balint@truenas:~$ nc -vzu pangolin.mydomain.com 51820 Connection to pangolin.mydomain.com (xxx.xxx.xxx.xxx) 51820 port [udp/*] succeeded! balint@truenas:~$ nc -vz pangolin.mydomain.com 80 Connection to pangolin.mydomain.com (xxx.xxx.xxx.xxx) 80 port [tcp/http] succeeded! balint@truenas:~$ nc -vz pangolin.mydomain.com 443 Connection to pangolin.mydomain.com (xxx.xxx.xxx.xxx) 443 port [tcp/https] succeeded! ``` Also, I enabled ICMP on Oracle's Firewall, as I remember correctly that it is also needed for Pangolin to work. So I can also ping the Oracle VPS as expected. But when I try to run `newt` on my remote site (truenas), I get this error: ``` INFO: 2025/06/11 14:04:30 Received: {Type:newt/wg/connect Data:map[endpoint:pangolin.mydomain.com:51820 publicKey:<pub_key> serverIP:100.89.128.1 targets:map[tcp:[] udp:[]] tunnelIP:100.89.128.4]} INFO: 2025/06/11 14:04:30 WireGuard device created. Lets ping the server now... INFO: 2025/06/11 14:04:30 Ping attempt 1 INFO: 2025/06/11 14:04:30 Pinging 100.89.128.1 WARN: 2025/06/11 14:04:40 Ping attempt 1 failed: failed to read ICMP packet: i/o timeout INFO: 2025/06/11 14:04:40 Starting ping check INFO: 2025/06/11 14:04:40 Ping attempt 2 INFO: 2025/06/11 14:04:40 Pinging 100.89.128.1 [...] ``` Also, I'm running Tailscale alongside on this setup, but I don't think that should interfere. Thanks in advance for any guidance or directions I could take to resolve this issue
Author
Owner

@KostyalBalint commented on GitHub (Jun 11, 2025):

Update

I found this discussion on DC: https://discord.com/channels/1325658630518865980/1373689106432917584
According to this, it's an issue with SQLite, so I changed the database to a full-fat PostgreSQL, but the issue is still present.

@KostyalBalint commented on GitHub (Jun 11, 2025): **Update** I found this discussion on DC: https://discord.com/channels/1325658630518865980/1373689106432917584 According to this, it's an issue with SQLite, so I changed the database to a full-fat PostgreSQL, but the issue is still present.
Author
Owner

@wuyifannppp commented on GitHub (Jun 11, 2025):

ME TO
100.89.128.1 ping error

@wuyifannppp commented on GitHub (Jun 11, 2025): ME TO 100.89.128.1 ping error
Author
Owner

@AstralDestiny commented on GitHub (Jun 11, 2025):

The ping happens before the connection even is established, Honestly newt should just ping and ask what the host ip of the gerbil.. As wireguard is mostly a silent protocol and won't even tell you of connection was successful or not,

It gets the data from pangolin during it's initial callback with it's ID and Secret and starts to ICMP ping ahead of time.. Also do not enable ICMP on the vps the ICMP is purely in tunnel and it doesn't matter if both hosts reject ICMP.

You need to verify firewall rules and if you are using something like Oracle you need to add the ports on the oracle web UI as ports alone on the host doesn't mean the ports are open to the internet.

@AstralDestiny commented on GitHub (Jun 11, 2025): The ping happens before the connection even is established, Honestly newt should just ping and ask what the host ip of the gerbil.. As wireguard is mostly a silent protocol and won't even tell you of connection was successful or not, It gets the data from pangolin during it's initial callback with it's ID and Secret and starts to ICMP ping ahead of time.. Also do not enable ICMP on the vps the ICMP is purely in tunnel and it doesn't matter if both hosts reject ICMP. You need to verify firewall rules and if you are using something like Oracle you need to add the ports on the oracle web UI as ports alone on the host doesn't mean the ports are open to the internet.
Author
Owner

@KostyalBalint commented on GitHub (Jun 11, 2025):

Thanks for the reply, I'll disable ICMP. TBH, it was just a last effort idea...

Also, I enabled the ports on Oracle's web GUI as well. (Otherwise, netcat wouldn't connect, from the host I'm running newt on)

@KostyalBalint commented on GitHub (Jun 11, 2025): Thanks for the reply, I'll disable ICMP. TBH, it was just a last effort idea... Also, I enabled the ports on Oracle's web GUI as well. (Otherwise, netcat wouldn't connect, from the host I'm running newt on)
Author
Owner

@Blucose commented on GitHub (Jun 12, 2025):

I'm having the same issue. If there's any logs I can post that would help resolve this let me know.

@Blucose commented on GitHub (Jun 12, 2025): I'm having the same issue. If there's any logs I can post that would help resolve this let me know.
Author
Owner

@KostyalBalint commented on GitHub (Jun 13, 2025):

A diagnosis that you can run:

1. Stop all the Docker containers related to Pangolin

List running containers:

docker ps -a

Stop them:

docker stop <cointainer_id> <container_2_id> <ect..>

2. Start a netcat listener on the VPS for port 51820 for UDP

sudo nc -u -l -p 51820

Try sending a UDP packet to your server from a different machine, which in theory should access your VPS

echo "test" | nc -u yourdomain.com 51820

If you see "test" printed on your VPS's console, your port is definitely open.
If you don't see anything, try to resend the packet a few times, as UDP is stateless, the packet might just lost in the transmission. (Also, this is why simply trying to connect nc -vzu yourdomain.com 51820 to that "port" with netcat might show success, but actually it lies)

But if even after a few tries it doesn't go through, it is highly likely that some firewall might block the request.

I'm currently rowing in the same boat, aka the UDP request doesn't go through. Sometimes it's not the waters fault if you can't swim xD

Note:
If you try with a known open port, like 80/TCP (HTTP), you should see it working.

sudo nc -l -p 80 #Server side
echo "test" | nc yourdomain.com 80 #Client side
@KostyalBalint commented on GitHub (Jun 13, 2025): A diagnosis that you can run: **1. Stop all the Docker containers related to Pangolin** List running containers: ``` docker ps -a ``` Stop them: ``` docker stop <cointainer_id> <container_2_id> <ect..> ``` **2. Start a netcat listener on the VPS for port 51820 for UDP** ``` sudo nc -u -l -p 51820 ``` Try sending a UDP packet to your server from a different machine, which in theory should access your VPS ``` echo "test" | nc -u yourdomain.com 51820 ``` If you see "test" printed on your VPS's console, your port is definitely open. If you don't see anything, try to resend the packet a few times, as UDP is stateless, the packet might just lost in the transmission. (Also, this is why simply trying to connect `nc -vzu yourdomain.com 51820` to that "port" with netcat might show success, but actually it lies) But if even after a few tries it doesn't go through, it is highly likely that some firewall might block the request. I'm currently rowing in the same boat, aka the UDP request doesn't go through. Sometimes it's not the waters fault if you can't swim xD _Note:_ If you try with a known open port, like 80/TCP (HTTP), you should see it working. ```bash sudo nc -l -p 80 #Server side ``` ```bash echo "test" | nc yourdomain.com 80 #Client side ```
Author
Owner

@Blucose commented on GitHub (Jun 13, 2025):

A diagnosis that you can run:

1. Stop all the Docker containers related to Pangolin

List running containers:

docker ps -a

Stop them:

docker stop <cointainer_id> <container_2_id> <ect..>

2. Start a netcat listener on the VPS for port 51820 for UDP

sudo nc -u -l -p 51820

Try sending a UDP packet to your server from a different machine, which in theory should access your VPS

echo "test" | nc -u yourdomain.com 51820

If you see "test" printed on your VPS's console, your port is definitely open.
If you don't see anything, try to resend the packet a few times, as UDP is stateless, the packet might just lost in the transmission. (Also, this is why simply trying to connect nc -vzu yourdomain.com 51820 to that "port" with netcat might show success, but actually it lies)

But if even after a few tries it doesn't go through, it is highly likely that some firewall might block the request.

I'm currently rowing in the same boat, aka the UDP request doesn't go through. Sometimes it's not the waters fault if you can't swim xD

Note:
If you try with a known open port, like 80/TCP (HTTP), you should see it working.

sudo nc -l -p 80 #Server side
echo "test" | nc yourdomain.com 80 #Client side

Yeah I got as far as this. This is all working, and some more AI assisted troubleshooting seems to imply there's some mixup with the keys that pangolin is handing out. I tried a fresh install so the problem must be in the config somewhere, I'll try going for the automated installation rather than rolling my own docker compose...

@Blucose commented on GitHub (Jun 13, 2025): > A diagnosis that you can run: > > **1. Stop all the Docker containers related to Pangolin** > > List running containers: > ``` > docker ps -a > ``` > > Stop them: > ``` > docker stop <cointainer_id> <container_2_id> <ect..> > ``` > > **2. Start a netcat listener on the VPS for port 51820 for UDP** > > ``` > sudo nc -u -l -p 51820 > ``` > > Try sending a UDP packet to your server from a different machine, which in theory should access your VPS > > ``` > echo "test" | nc -u yourdomain.com 51820 > ``` > > If you see "test" printed on your VPS's console, your port is definitely open. > If you don't see anything, try to resend the packet a few times, as UDP is stateless, the packet might just lost in the transmission. (Also, this is why simply trying to connect `nc -vzu yourdomain.com 51820` to that "port" with netcat might show success, but actually it lies) > > But if even after a few tries it doesn't go through, it is highly likely that some firewall might block the request. > > I'm currently rowing in the same boat, aka the UDP request doesn't go through. Sometimes it's not the waters fault if you can't swim xD > > _Note:_ > If you try with a known open port, like 80/TCP (HTTP), you should see it working. > > ```bash > sudo nc -l -p 80 #Server side > ``` > ```bash > echo "test" | nc yourdomain.com 80 #Client side > ``` Yeah I got as far as this. This is all working, and some more AI assisted troubleshooting seems to imply there's some mixup with the keys that pangolin is handing out. I tried a fresh install so the problem must be in the config somewhere, I'll try going for the automated installation rather than rolling my own docker compose...
Author
Owner

@KostyalBalint commented on GitHub (Jun 13, 2025):

🎉 I finally got it working

The problem actually was that port 51820 was NOT open... (As I said, "sometimes it's not the waters fault if you can't swim")

Steps that worked for me, on Oracle Free Tier cloud with Ubuntu installed.

1.st step

Enable Forwarding of IP

sudo nano /etc/sysctl.conf

Remove the # for the entries:

net.ipv4.ip_forward = 1
net.ipv6.conf.all.forwarding = 1

CTRL + X and then Y for save

sudo sysctl -p

2.nd step

Go to Oracle's web interface and search for Virtual Cloud Networks, find the one that you are using for this VM (Most likely you only have one)
Go to Default Security List for vcn-20250205-2310 or something named similarly, and set Ingress rules as follows:

Image

The most important one for Wireguard is:

Steteless: Yes
Source CIDR: 0.0.0.0/0
IP Protocol: UDP
Destination Port range: 51820

For TCP, ports 80 and 443 are needed for the web UI. But if I remember correctly, there is a default rule for all TCP traffic, so if that is present, you don't need to explicitly add these again.

3.rd step

Installed everything (including Docker) with Pangolin's install script

https://docs.fossorial.io/Getting%20Started/quick-install

4.th step

Setup Pangolin, and Newt as you'd like and be happy that it (hopefully) works as expected

Notes

I guess if you have it installed you only need to do the firewall rules

Do NOT use ufw firewall on Oracle's VPS: https://community.oracle.com/customerconnect/discussion/684399/oci-ufw-was-enabled-on-ubuntu-and-ssh-connections-started-to-fail-with-connection-refused-error

The final info that helped me to put together this puzzle was from this Redit post

@KostyalBalint commented on GitHub (Jun 13, 2025): # 🎉 I finally got it working The problem actually was that port `51820` was NOT open... _(As I said, "sometimes it's not the waters fault if you can't swim")_ ## Steps that worked for me, on Oracle Free Tier cloud with Ubuntu installed. ### 1.st step Enable Forwarding of IP ```bash sudo nano /etc/sysctl.conf ``` Remove the # for the entries: ``` net.ipv4.ip_forward = 1 net.ipv6.conf.all.forwarding = 1 ``` CTRL + X and then Y for save ```bash sudo sysctl -p ``` ### 2.nd step Go to Oracle's web interface and search for `Virtual Cloud Networks`, find the one that you are using for this VM (Most likely you only have one) Go to `Default Security List for vcn-20250205-2310` or something named similarly, and set Ingress rules as follows: <img width="1122" alt="Image" src="https://github.com/user-attachments/assets/bad49182-1cd0-44a0-9884-ef1c31a402af" /> The most important one for Wireguard is: Steteless: `Yes` Source CIDR: `0.0.0.0/0` IP Protocol: `UDP` Destination Port range: `51820` For TCP, ports 80 and 443 are needed for the web UI. But if I remember correctly, there is a default rule for all TCP traffic, so if that is present, you don't need to explicitly add these again. ### 3.rd step Installed everything (including Docker) with Pangolin's install script https://docs.fossorial.io/Getting%20Started/quick-install ### 4.th step Setup Pangolin, and Newt as you'd like and be happy that it _(hopefully)_ works as expected ### Notes _I guess if you have it installed you only need to do the firewall rules_ _Do NOT use `ufw` firewall on Oracle's VPS:_ https://community.oracle.com/customerconnect/discussion/684399/oci-ufw-was-enabled-on-ubuntu-and-ssh-connections-started-to-fail-with-connection-refused-error The final info that helped me to put together this puzzle was from this [Redit post](https://www.reddit.com/r/WireGuard/comments/1baeuyx/wireguard_oracle_cloud_step_by_step/)
Author
Owner

@krod1408 commented on GitHub (Sep 30, 2025):

I had a similar issue and I followed this and it seems to have fixed the issue for me I will have to check the logs again to see if that was the problem.

How to resolve the warning
Here are the general steps to fix a Docker socket access issue. The best solution depends on your specific setup.
For a Newt service running on the host system
Add the user to the docker group: Run the following command to add the user running Newt to the docker group:
sudo usermod -aG docker $USER
Apply group changes: Log out and log back in, or run newgrp docker to apply the new group membership.
Restart the Docker daemon: Sometimes, a restart is necessary to refresh the permissions.
sudo systemctl restart docker
For Newt running as a Docker container
Correctly mount the socket: Ensure the host's Docker socket is correctly mounted into the Newt container. For example, your docker run command should include the following flag:
-v /var/run/docker.sock:/var/run/docker.sock

@krod1408 commented on GitHub (Sep 30, 2025): I had a similar issue and I followed this and it seems to have fixed the issue for me I will have to check the logs again to see if that was the problem. How to resolve the warning Here are the general steps to fix a Docker socket access issue. The best solution depends on your specific setup. For a Newt service running on the host system Add the user to the docker group: Run the following command to add the user running Newt to the docker group: sudo usermod -aG docker $USER Apply group changes: Log out and log back in, or run newgrp docker to apply the new group membership. Restart the Docker daemon: Sometimes, a restart is necessary to refresh the permissions. sudo systemctl restart docker For Newt running as a Docker container Correctly mount the socket: Ensure the host's Docker socket is correctly mounted into the Newt container. For example, your docker run command should include the following flag: -v /var/run/docker.sock:/var/run/docker.sock
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/pangolin#426