This all started when I was wanting to find an easy way to see if a node setup using direct connection is correct, be it via port-forwarding in the router or say a VPS with public IP address for the VPS. (EG @Dimitar is doing this with PC directly connected to internet and no router)
The issues that can stop connection can include
- port-forwarding in router not configured right (ie tcp instead of udp, or incorrect port number or incorrect LAN ip address)
- firewall in device incorrectly configured or not at all and the required ports are not open for udp
- node manager not being told the ports to use for listening, or incorrect ports specified. (--node-port)
When asking around Joshuef showed the function where a peer is asked for a quote (requiring the multiaddr) and then @roland told me of the nat-detection command in safenode-manager and a list of servers to choose from.
/ip4/138.68.131.45/tcp/17709
/ip4/138.68.131.45/tcp/17710
/ip4/138.68.133.45/tcp/17700
/ip4/138.68.133.45/tcp/17701
/ip4/138.68.133.45/tcp/17702
/ip4/138.68.133.45/tcp/17703
Some of the issues I came across using safenode-manager and the nat-detection command are that
- upnp was not detected as available on a computer that successfully will use the --upnp option in safenode-manager
- direct connection was not detected on a VPS w/firewall that uses it successfully.
- starlink (forwarding and upnp not available) it detected correctly
In all 3 cases the safenode-manager nat-detection command said it was private. This means that the launcher would set home-network for all 3 cases.
This lead me to realise at least one thing
- The port number being used by the nat-detection command in the manager is using a random port to test to the servers and thus will never be able to be successful for a setup that has portforwarding and/or the firewall set correctly to only allow the ports needed for nodes. Also correctly setting the protocol
- that there is either a problem with upnp or the way it tries to upnp in my router that is different to the way nodes use it.
Now today @chriso relayed a message and that I can set the port number in the nat-detection program.
So I used the nat-detection program that the safenode-manager downloaded and used the port number on my VPS (opened in f/w for udp traffic). Tried first time and got error for upnp not available which is expected since there is no router with VPS that has public IP, then ran this
nat-detection -n -v --port 40000 /ip4/138.68.131.45/tcp/17708
This gave no output and just returned to the prompt. So I ran it again echoing the return value from the command. It gave a value of 12. But without knowing what that signifies I donāt know what it found
But thinking further I realised this would be a sure failure as well since the servers @roland gave me (see above) would not work in my correctly setup firewall. The servers are for tcp, and I only opened udp
Thus using those servers will result in failure for anyone with correctly setup firewalls and/or routers trying for direct connections and using the launcher.
Also for being able to check to see if the setup is all correct it will say that homenetwork is the only option.
Thoughts opinions. This is a summary of what Iāve seen but hopefully gives enough information to work on.