dashpay / dash

Dash - Reinventing Cryptocurrency
https://www.dash.org
MIT License
1.49k stars 1.2k forks source link

Masternode cannot connect behind a router. #3334

Open mountassir opened 4 years ago

mountassir commented 4 years ago

Describe the issue

I am trying to set up a masternode on a machine, which is behind a router and the masternode itself is failing to initialize.

I used the router's WAN address to setup the masternode and forwarded the port to the machine.

I am seeing this error in the log:

CActiveDeterministicMasternodeManager::Init -- Checking inbound connection to 'my.ip.address:24126' CActiveDeterministicMasternodeManager::Init -- ERROR: Could not connect to my.ip.address:24126

my.ip.address is exactly what I have in the config file externalip=my.ip.address. This is the router's WAN IP address which the node is trying to connect to, where it should be connecting to the machine's IP address instead.

This is not an issue when using a VPS for example where the machines IP address and externalip are the same.

It is failing this check Source Code which was merged in this Commit but I am note sure what the behavior was before that.

When I try to bypass the check above, or not have an externalip in my config, the node does seem to use the machine's IP address but then fails with this error Error. Local address does not match the address from ProTx" within the same function as above Source Code.

I am testing a build where both checks are bypassed and the masternode seems to be connecting and working as expected so far.

Ideally the checks in CActiveMasternodeManager::Init() should be the local's IP address and not always assume that machine_ip=external_ip.

Is there any way to override this through the config file? Or to actually both external and local IP addresses?

Machine specs:

PastaPastaPasta commented 4 years ago

Have you tried -allowprivatenet? It still might not work, but it might

PastaPastaPasta commented 4 years ago

potentially similar https://github.com/dashpay/dash/issues/3586