From 8688a98e4f7c4209a67729497f683d78a91818bc Mon Sep 17 00:00:00 2001 From: Noobvie <85051719+noobvie@users.noreply.github.com> Date: Wed, 27 May 2026 15:34:48 -0400 Subject: [PATCH] Change default IP address for P2PConfig to IPv6 (#3843) * Change default IP address for P2PConfig to IPv6 Feature request: Change default P2P listen host from 0.0.0.0 to :: for dual-stack IPv4+IPv6 support. As tested on several windows/linux machines and not found issue. Worked with ipv4 or ipv6 or dual ipv4+ipv6. * docs+config add p2p listen host options --------- Co-authored-by: Joerg --- config/src/comments.rs | 7 +++++-- p2p/src/types.rs | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/config/src/comments.rs b/config/src/comments.rs index be3a5863..3b93ac6e 100644 --- a/config/src/comments.rs +++ b/config/src/comments.rs @@ -262,8 +262,11 @@ fn comments() -> HashMap { "host".to_string(), " #The interface on which to listen. -#0.0.0.0 will listen on all interfaces, allowing others to interact -#127.0.0.1 will listen on the local machine only +#:: will listen on all IPv6 interfaces and may also accept IPv4 depending on OS socket settings +#0.0.0.0 will listen on all IPv4 interfaces, allowing others to interact +#Set host to 0.0.0.0 if only IPv4 listening is desired +#127.0.0.1 will listen on the local machine only over IPv4 +#::1 will listen on the local machine only over IPv6 " .to_string(), ); diff --git a/p2p/src/types.rs b/p2p/src/types.rs index 76cc3fe7..8d0bdd1a 100644 --- a/p2p/src/types.rs +++ b/p2p/src/types.rs @@ -293,7 +293,7 @@ pub struct P2PConfig { /// Default address for peer-to-peer connections. impl Default for P2PConfig { fn default() -> P2PConfig { - let ipaddr = "0.0.0.0".parse().unwrap(); + let ipaddr = "::".parse().unwrap(); P2PConfig { host: ipaddr, port: 3414,