Is it possible to restrict all connections to an IPV6 address?

I've set


But it seems that nodes are still attempting to connect to an IPV4 address (in addition to the IPV6 address). Is there any way to prevent this? I am seeing discover and addlocal both being set to the IPV6 address on startup.


1 Answer 1


onlynet only affects outbound connections.

If you only want inbound IPv4 connections (why?), you'll need to either:

  • Patch Bitcoin Core to bind to IPv6 addresses in IPV6_V6ONLY mode (see CConnman::BindListenPort in src/net.cpp)
  • Use some firewall rule on your system to prevent incoming IPv4 connections to it
  • Make sure you only have a publicly-reachable IPv6 address
  • 1
    I am only looking for IPv6 connections. I don't really want my IPv4 address being leaked.
    – Dave
    Jan 10, 2021 at 18:25
  • 1
    Is this still true and we need to patch Bitcoin Core for using this option?
    – user103136
    Sep 1, 2021 at 0:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.