-
Notifications
You must be signed in to change notification settings - Fork 1.6k
#1 Real IP gossiped inclusive with the flag --listen-addr=
, #2 If --listen-addr= if cant find the assigned IP, error and connect using another IP. same for the ports.
#437
Comments
--listen-addr=/ip4/10.0.0.2/tcp/30333
--listen-addr=
--listen-addr=
--listen-addr=
and used another IP if asigned is not available.
--listen-addr=
and used another IP if asigned is not available.--listen-addr=
and another IP(like real IP) is used if asigned is not available.
--listen-addr=
and another IP(like real IP) is used if asigned is not available.--listen-addr=
and another IP(like real IP) is used if asigned is not available, same the ports.
@tomaka sounds like he is right and we should make this an hard error? If the binding to the address fails, we should not just switch to listening on a different address. |
For #1, the real IP address it show you is what we call the external IP address. I thought there was a CLI option to configure the external addresses that are advertised (like is the case in parity-ethereum), but I can't find it and I guess it doesn't exist. For #2, I don't see what you mean. If listening on an IP:port fails (according to the Linux kernel), you're supposed to see a warning and nothing more happens: https://github.com/paritytech/substrate/blob/7fc21ceafbd01f3fadff7d1ebd51b7c6ba9f86ac/core/network/src/service.rs#L212-L216 |
For #1, here when the listen-address flag, why gossiped my real IP? Ok, some pic better. for #2 too stop node, stop VPN, node start cant uses the IP, then connect using another, cant peer to my nodes. (can be one VPN or IP FO, or another external IP) more pic My question is, does this not bring connectivity problems? It is best if the node does not connect if the external IP is not available and stop some panic msg? instead of using another IP? IP and the same when cant use the assigned ports just connected using others. Thanks |
--listen-addr=
and another IP(like real IP) is used if asigned is not available, same the ports.--listen-addr=
, #2 If --listen-addr= if cant find the assigned IP, error and connect using another IP. same for the ports.
Is this still a problem? |
I am observing this here too, where while I assign a specific interface and port through --listen-addr, polkadot is still displaying "Discovered new external address for our node: /ip4/1.2.3.4/tcp/30334/p2p/12D3KooWXXX" on interfaces that are not specified on --listen-addr. |
On v0.9.0, I experience this as well. Not necessarily an issue for me - just consistently throws up all my local interfaces in the log. |
I'm not sure what the problem is. Discovery works like that:
You can't send Alice's private IP to Charlie and expect Charlie to be able to connect, if that's what you have in mind |
Two points:
|
You seem mistaken. These private IP addresses are filtered out and not used by other nodes to try connect (unless you use |
I'm by no mean an expert but I have a decent enough understanding of the networking stack that I find this odd that I do not understand your statement. How can other nodes think my node has IP addresses it does not have? Furthermore, how can those other node see an invalid IP address when I establish a TCP connection to them? The only way the connection can work is if they see my valid, publicly routable IP address. By no means do I want to distract this issue away from the initial comment, but this understanding seem to be a necessary building block so we are all on the same page. EDIT Again assuming it's just me not understanding what is going on with those private IP addresses, it's pretty clear most anyone outside of Parity would stumble on this as well if asked to explain this behavior. Maybe a section of the documentation should be dedicated to explaining all the things that are displayed in the log, at least the default log? |
The way a connection really happens, the vast majority of the time, is like that:
I'm by no mean an expert in NATs, but IP addresses can get rewritten by one or both of the gateways. We don't want to completely ignore private IP addresses, because it should still be possible to start a chain entirely on a local network, but we filter them out when it comes to the Kademlia discovery protocol, as Kademlia is global. |
That makes a lot of sense, but then, why do I see those private IP addresses that supposedly belong to me, while I am not under NAT, or PAT? There's just something odd about this. Furthermore, everything that is in the default log view is there because it is useful to the nodes admins, it enables them to quickly get an understanding of the node's state. As one such admin, what am I to do with those private addresses, how is that helping me understand the current state? Is all of this documented somewhere so I can attempt to wrap my head around what is going on here? Thanks @tomaka! |
The reason why this log line exists is so you can for example launch node 1, look at its logs, copy the external address that is printed, then launch node 2 passing the address of node 1 as parameter. This use case is very useful when actually debugging things, so there is a strong opinion bias coming from us devs here. In general note that it would be exaggerated to think that we have cleverly designed what is printed as default logs. It's mostly individual devs that printed what felt useful. |
I understand, thank you for clarifying. It's still unclear to me why those private IP addresses are showing up while they are not part of my system nor part of the routing to my node, which is not leveraging NAT, or PAT for that matter. Although I would like to understand, I don't want to make this about me. I raise this point in case it would be helpful to OP's issue. If not useful, then no problem we can move on. If useful, I'm happy to provide more details and logs on my end. |
If you log |
When start the node like this
Then
After the Discovered new external address, the gossip the Real IP
If using this flag
--listen-addr=/ip4/10.0.0.2/tcp/30333
when start why shows anothers IP or my real IP always after start.Also if the node or the server for any reason restart the node and for any reason, the IP is not available, I hoped that it would not connect while the IP assigned in the flag
--listen-addr=
was available or failed to find the IP and stopped but instead it is connected by another IP, Also the ports, if the ports are busy, no error Stop, simply say in the logo that IP is not available and will connect to another IP / ports.This can cause problems for the validators working with nodes in private connection for my understanding and test.
when checking the logs in the private node running reserves nodes 2 and listen address too.
after stop and start get 2 peers again ok.
Thank you
The text was updated successfully, but these errors were encountered: