P2P: Node with onlynet=ipv6 connects outgoing to Onion #13378

issue ghost opened this issue on June 3, 2018
  1. ghost commented at 1:09 PM on June 3, 2018: none

    Running bitcoind 0.16.1rc1 64-Bit binary release on Linux

    What I did

    I have now setup IPv6 connection for my node (but only outgoing, since my providers router does not allow incoming IPv6 traffic...) I have running also Tor on localhost with bitcoin (not really) "hidden" service, in parallel to IPv4.

    So I was curious and set onlynet=ipv6 in bitcoin.conf (before, "onlynet" was not set)

    Expected behavior

    Only IPv6 connections, both incoming and outgoing, no Tor traffic, no traffic to local Tor hidden service.

    Actual behavior

    Node connects to IPv6, IPv4 and Tor, see screenshot of GUI debug window connection tab.

    Also, there are error messages in the debug log that I had not before: ("Keine Berechtigung" means "No permission" in English)

    2018-06-03 12:41:46 Loaded 71277 addresses from peers.dat 324ms 2018-06-03 12:41:46 init message: Lade Sperrliste... 2018-06-03 12:41:46 init message: Starte Netzwerk-Threads... 2018-06-03 12:41:46 init message: Laden abgeschlossen 2018-06-03 12:41:46 opencon thread start 2018-06-03 12:41:46 net thread start 2018-06-03 12:41:46 dnsseed thread start 2018-06-03 12:41:46 addcon thread start 2018-06-03 12:41:46 msghand thread start 2018-06-03 12:41:46 GUI: Platform customization: "other" 2018-06-03 12:41:46 GUI: PaymentServer::LoadRootCAs: Loaded 159 root certificates 2018-06-03 12:41:55 Imported mempool transactions from disk: 2019 succeeded, 0 failed, 0 expired, 0 already there 2018-06-03 12:41:57 Loading addresses from DNS seeds (could take a while) 2018-06-03 12:41:57 219 addresses found from DNS seeds 2018-06-03 12:41:57 dnsseed thread exit 2018-06-03 12:42:07 New outbound peer connected: version: 70015, blocks=525773, peer=0 2018-06-03 12:44:06 GUI: QAccessibleTable::child: Invalid index at: 3 0 2018-06-03 12:44:06 GUI: Cannot creat accessible child interface for object: QTableView(0x55960b4b1040, name = "peerWidget") index: 29 2018-06-03 12:44:06 GUI: QAccessibleTable::child: Invalid index at: 3 0 2018-06-03 12:44:06 GUI: Cannot creat accessible child interface for object: QTableView(0x55960b4b1040, name = "peerWidget") index: 29 2018-06-03 12:44:06 GUI: QAccessibleTable::child: Invalid index at: 3 0 2018-06-03 12:44:06 GUI: Cannot creat accessible child interface for object: QTableView(0x55960b4b1040, name = "peerWidget") index: 29 2018-06-03 12:44:11 GUI: QAccessibleTable::child: Invalid index at: 2 0 2018-06-03 12:44:11 GUI: Cannot creat accessible child interface for object: QTableView(0x55960b4b1040, name = "peerWidget") index: 22 2018-06-03 12:44:11 GUI: QAccessibleTable::child: Invalid index at: 2 0 2018-06-03 12:44:11 GUI: Cannot creat accessible child interface for object: QTableView(0x55960b4b1040, name = "peerWidget") index: 22 2018-06-03 12:44:11 GUI: QAccessibleTable::child: Invalid index at: 2 0 2018-06-03 12:44:11 GUI: Cannot creat accessible child interface for object: QTableView(0x55960b4b1040, name = "peerWidget") index: 22 2018-06-03 12:44:51 connect() to [2601:98a:4203:6e9d:68b9:19cf:e683:6932]:8333 failed after select(): Keine Berechtigung (13) 2018-06-03 12:45:33 connect() to [2a00:c1a0:4888:a500:cc5b:3e64:8aba:d6b4]:8333 failed after select(): Keine Berechtigung (13) 2018-06-03 12:45:38 connect() to [2001:981:9cae:1:7c4b:8f56:ab7c:78f]:8333 failed after select(): Keine Berechtigung (13)

    bildschirmfoto

  2. fanquake added the label P2P on Jun 3, 2018
  3. ghost commented at 3:39 PM on June 7, 2018: none

    When setting onlynet=ipv4 there are outgoing connections to .onion addresses, too.

    The bitcoind man page says:

    -onlynet=<net> Only connect to nodes in network <net> (ipv4, ipv6 or onion)

    Additionally, I get incoming connections via Tor Hidden Service with both onlynet=ipv6 and onlynet=ipv4.

    If this should be not a bug, but a feature, the man page should explain this behaviour more detailed and precisely.

    I am wondering, that there is no feedback yet about this behavior. I think it is easy reproducable.

  4. sipa commented at 3:41 PM on June 7, 2018: member

    Onlynet only affects outgoing connections, not incoming.

  5. ghost commented at 6:29 PM on June 7, 2018: none

    Thanks for feedback. Following this, I would suggest to change the man page text to:

    onlynet=
    Actively connect to remote nodes exclusively in network <ipv4|ipv6|onion>.
    Passive, incoming connections are not affected by this parameter.
    
    

    But this statement for active connections to remote nodes does not seem to match the reality, currently. Or am I missing something?

  6. sipa commented at 6:31 PM on June 7, 2018: member

    Thanks for feedback. Following this, I would suggest to change the man page text to:

    Sounds good to me. Feel free to open a PR.

    But this statement for active connections to remote nodes does not seem to match the reality, currently. Or am I missing something?

    If that's the case, there is a bug, and we should keep this issue open to investigate. I was just commenting because the in/out distinction was a possible explanation for what you saw.

  7. unknown cross-referenced this on Jun 7, 2018 from issue More precise explanation of parameter onlynet by ghost
  8. unknown cross-referenced this on Jun 7, 2018 from issue Docs: More precise explanation of parameter onlynet by ghost
  9. kallewoof commented at 9:55 AM on June 11, 2018: member

    @sipa

    Onlynet only affects outgoing connections, not incoming.

    Huh. So a onlynet=tor user may end up getting non-tor incoming connections? That sounds potentially undesirable.

    Edit: off-topic; spin off in #13436, please respond there.

  10. kallewoof cross-referenced this on Jun 11, 2018 from issue Should `onlynet=onion` allow incoming non-tor connections? by kallewoof
  11. unknown renamed this:
    onlynet=ipv6 has no effect: Node connects to IPv6, IPv4 and Tor
    onlynet=ipv6 has no effect: Node connects outgoing to IPv6, IPv4 and Tor
    on Jun 16, 2018
  12. unknown renamed this:
    onlynet=ipv6 has no effect: Node connects outgoing to IPv6, IPv4 and Tor
    P2P: Node with onlynet=ipv6 connects outgoing to Onion
    on Jun 20, 2018
  13. ghost commented at 4:09 PM on June 20, 2018: none

    I got the node now running for 48h with onlynet=ipv6, and from looking at the connections tab from time to time, I only once saw a single outgoing connection via IPv6, so pretty seldomly. All of the other outgoing connections are to Onion addresses. I never saw an outgoing connection via IPv4.

  14. ghost commented at 5:32 PM on June 20, 2018: none

    netstat -np | grep tor shows only IPv4 connections, allthough Tor is configured with ClientUseIPv6 1, so it looks like this is not a "Onion via IPv6" phaenomen.

  15. sipa referenced this in commit 01f909828d on Jun 27, 2018
  16. unknown cross-referenced this on Oct 7, 2018 from issue Net: Do not re-enable Onion network when it was disabled via onlynet by ghost
  17. PastaPastaPasta referenced this in commit 65a0077ff0 on Jul 7, 2020
  18. PastaPastaPasta referenced this in commit 7d461a1a0d on Jul 7, 2020
  19. PastaPastaPasta referenced this in commit 12a0696ecd on Jul 8, 2020
  20. ghost commented at 10:28 AM on December 6, 2020: none

    Issue still exists with 0.21.0rc2, see screenshot of connection table running with onlynet=ipv6.

    bildschirmfoto

  21. ghost commented at 10:45 AM on December 6, 2020: none

    There are no outgoing onion connections when additionally to onlynet=ipv6 setting listenonion=0 (default: 1). See #14425 (closed by me) and the successor PR #19358

  22. unknown cross-referenced this on Dec 6, 2020 from issue [doc] Fix documentation of options onlynet and listenonion by ghost
  23. unknown cross-referenced this on Aug 7, 2021 from issue tor: respect non-onion -onlynet= for outgoing Tor connections by vasild
  24. ghost commented at 11:25 AM on August 9, 2021: none

    Check if this is solved by #22651.

  25. vasild referenced this in commit 7b821b9d4c on Aug 30, 2021
  26. vasild cross-referenced this on Aug 30, 2021 from issue net: respect -onlynet= when making outbound connections by vasild
  27. vasild referenced this in commit 0ea0de6438 on Sep 1, 2021
  28. vasild referenced this in commit 46a9a797f1 on Sep 3, 2021
  29. luke-jr referenced this in commit 93c87541f6 on Oct 10, 2021
  30. Kixunil cross-referenced this on Oct 20, 2021 from issue Updating to Electrs 0.9.1: crashes while reindexing "receiving on an empty and disconnected channel" by got3nks
  31. vasild referenced this in commit 8dea7fcf72 on Nov 8, 2021
  32. vasild referenced this in commit e53a8505db on Nov 24, 2021
  33. luke-jr referenced this in commit 06fc482a73 on Dec 14, 2021
  34. gades referenced this in commit 8151c6fc98 on Feb 10, 2022
  35. laanwj closed this on Mar 1, 2022

  36. laanwj referenced this in commit 848b11615b on Mar 1, 2022
  37. janus referenced this in commit 11617f9a40 on Jul 3, 2022
  38. backpacker69 referenced this in commit 3c6d35919d on Jan 18, 2023
  39. bitcoin locked this on Mar 1, 2023

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-05-20 06:55 UTC