-
Notifications
You must be signed in to change notification settings - Fork 2.2k
[bug]: lncli getinfo
does not return the configured P2P port.
#10234
-
Background
lncli getinfo
always returns the default P2P port 9735 on the URIs field, even when setting another port on lnd.conf
.
I verified this via lsof -i tcp:<other_port>
, which shows lnd
listening on my defined port, and lsof -i tcp:9735
, which outputs nothing. Also connected to this node from another node of mine on the non-default port.
Your environment
- version of
lnd
: 19.3-beta
Beta Was this translation helpful? Give feedback.
All reactions
HI @luisschwab,
The port shown in the lncli getinfo
response is displaying the externally advertised IP:s+ports that you've specified using the externalip
config option, and not the IP:s+ports set for the listen
config option.
As specified in the sample-lnd.conf
file, if you do not set any port for an IP for the externalip
config option, the default port used will be 9735.
In other words, if you just set:
externalip=1111年1月1日.1
That will use the default port and therefore show the lncli getinfo
response as:
"uris": [
"NODEPUB@1111年1月1日.1:9735"
],`
Where as if you specify a port for the externalip
config option:
externalip=1111年1月1日.1:9666
that will then be used for the lncli getinfo
res...
Replies: 1 comment 4 replies
-
HI @luisschwab,
The port shown in the lncli getinfo
response is displaying the externally advertised IP:s+ports that you've specified using the externalip
config option, and not the IP:s+ports set for the listen
config option.
As specified in the sample-lnd.conf
file, if you do not set any port for an IP for the externalip
config option, the default port used will be 9735.
In other words, if you just set:
externalip=1111年1月1日.1
That will use the default port and therefore show the lncli getinfo
response as:
"uris": [
"NODEPUB@1111年1月1日.1:9735"
],`
Where as if you specify a port for the externalip
config option:
externalip=1111年1月1日.1:9666
that will then be used for the lncli getinfo
response:
"uris": [
"NODEPUB@1111年1月1日.1:9666"
],`
Beta Was this translation helpful? Give feedback.
All reactions
-
👍 1
-
Interesting, I would think that behavior would be similar to Core, where it will advertise the port we define on listen
. So in my case, my node is listening on the port I defined, but advertising the default P2P port via gossip?
Beta Was this translation helpful? Give feedback.
All reactions
-
Also, changing the Tor port would need to be done via the torrc
file, correct?
Beta Was this translation helpful? Give feedback.
All reactions
-
my node is listening on the port I defined, but advertising the default P2P port via gossip
Yes, correct. Keep in mind though that you can use port forwarding locally.
changing the Tor port would need to be done via the
torrc
file
You could do that, but I also recommend you to checkout the config options lnd
enables:
Lines 936 to 1006 in 82f77e5
Note that when you're setting an advertised externalip
, you can also specify your onion address.
externalip=<your-onion-address>.onion:PORT
Beta Was this translation helpful? Give feedback.
All reactions
-
Yeah, I already do this. The config makes sense to me now, as you can specify multiple sockets and proxy them to the internal P2P port.
Beta Was this translation helpful? Give feedback.
All reactions
-
👍 1