How to handle IP change of a peer #5463
-
In my project, written in Rust, I have a network composed by multiple peers that shares the same code. Each peer has this behavior: #[derive(NetworkBehaviour)]
pub struct Behaviour {
pub autonat: autonat::Behaviour,
pub gossipsub: gossipsub::Behaviour,
pub identify: identify::Behaviour,
pub kademlia: kad::Behaviour<MemoryStore>,
pub reqres: request_response::Behaviour<ExtComm>,
} One of the group's peer is in a private networks, it correctly connects to the bootstrap peer and it behaves correctly. Once in a while it logs multiple It seems like its router changes the public IP and the other peers can't connect to it anymore. Do you have any suggestions to help me on this? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Are you using an unspecified address (eg |
Beta Was this translation helpful? Give feedback.
From previous testing, yes, however as I reread your OP, I am not sure if libp2p deals with dynamic IP. Assuming it is reported to the interface it should, but this might require some configuring of the dhcp client on your end. Regardless, if it can be picked up by if-watch (which is what
libp2p-{tcp,mdns,quic}
use) then i can assume it will be handled internally, although for the connections, i would have to check to see howAddressChange
is emitted under the existing connection.