Wrong implementation - Bitcoind does not use externalip for outgoing connection #7474

issue anto opened this issue on February 6, 2016
  1. anto commented at 9:37 AM on February 6, 2016: none

    I have 4 IPv6 addresses on the eth0 interface of my VPS. I have set routings of all those IPv6 addresses using "ip -6 rule", "ip -6 route" and their corresponding fwmark label on ip6tables. I want all bitcoind packets for both outgoing and incoming connections to use one specific IPv6 address which is not the default outgoing IPv6 address. I set the externalip to that specific IPv6 address and the discover=0.

    However, bitcoind keeps using the default IPv6 address for outgoing connection. I can force the outgoing packets from bitcoind to go out to its specific IPv6 address using ip6tables SNAT. But that is an ugly workaround. So I have no choice than to set the IPv6 address of bitcoind as the default outgoing IPv6 address.

    What is the point to provide the possibility to set the external IP address, i.e. externalip parameter, if it is not being used for the outgoing connection? It does not really make sense if the externalip parameter is only being used for the incoming connection, because all peers only know how to connect to my full node base on the IP address that my full node uses for the outgoing connection. So if my full node is connecting to all peers with different IP address than the one it is expecting to receive the incoming connection, my full node will never have peers that can connect to it as the port 8333 is only opened on its specific IP address.

  2. laanwj added the label P2P on Feb 8, 2016
  3. laanwj commented at 9:30 AM on February 8, 2016: member

    This is based on a confusion: -externalip does not set the bind address - neither for incoming nor outgoing addresses - what is does is change what address is advertised to other nodes. This is useful when the software cannot determine the outside connection address itself, e.g. to advertise an onion hidden service address.

    It is possible to set the bind address for the listening port using -bind. Hardly any software allows choosing the bind address for outgoing connections, neither does bitcoind. There is a feature request for that open: #6476.

  4. anto commented at 11:29 PM on February 10, 2016: none

    Thanks for your response to this request.

    I have indeed set the -bind address for incoming connection. I assumed the -externalip is for outgoing connection so that when I set it the same as -bind address, both incoming and outgoing packets will be using the same address. I guess -externalip is only useful for NAT-ed address which is only relevant for IPv4 addresses.

    I will wait for the implementation of the feature request #6476.

  5. laanwj commented at 8:55 AM on February 11, 2016: member

    I guess -externalip is only useful for NAT-ed address which is only relevant for IPv4 addresses.

    It is useful for any kind of forwarding/tunneling as well. Every case in which bitcoind cannot determine what your external-facing address is.

    Closing this, as the other mentioned issues should cover it.

  6. laanwj closed this on Feb 11, 2016

  7. MarcoFalke locked this on Sep 8, 2021
Contributors
Labels

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-02 12:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me