<p>Yes you can specify <code>-externalip</code> multiple times.</p>
<p>The config option <code>-externalip</code> allows you to specify your own public reachable address. This can also be an onion address.</p>
<p>From the Bitcoin Core Tor <a href="https://github.com/bitcoin/bitcoin/blob/master/doc/tor.md#3-manually-create-a-bitcoin-core-onion-service" rel="nofollow noreferrer">documentation</a>:</p>
<blockquote>
<p>The one that will be rumoured to a particular peer is the most compatible one and also using heuristics, e.g. the address with the most incoming connections, etc.</p>
</blockquote>
<p>Additional context from IRC: Bitcoin Core listens on ipv6, but as the ipv4 address space is embedded in ipv6, that means you can also accept ipv4 connections that way (they'll look like they come from the ipv4-embedded in-ipv6 address). That happens automatically unless you use <code>-nolisten</code> or specifically set a bind address with <code>-bind</code>. Advertizing addresses is completely independent from listening on them. Pre-BIP155 addr rumouring used a flat ipv6 namespace with ipv4 and Tor v2 addresses embedded in subranges of that space. Since BIP155 with addrv2 every address has an explicit network identifier.</p>

CC BY-SA 4.0
2021-06-14T18:30:04.920Z
2021-06-15T09:10:39.407Z
2021-06-15T09:10:39.407Z
Michael Folkson
<p>Can bitcoind listen on both ipv4 and ipv6? I know it can make outbound connections on both (onion and i2p) but can it also advertise multiple public hosts if available?</p>
<p>This question was asked by pinheadmz on IRC.</p>

<bitcoind><network><tor><p2p><peer-discovery>
Can bitcoind listen on both ipv4 and ipv6?
Michael Folkson
# Can bitcoind listen on both ipv4 and ipv6?

(Asked by: username_0 on 2021-06-14)

Can bitcoind listen on both ipv4 and ipv6? I know it can make outbound connections on both (onion and i2p) but can it also advertise multiple public hosts if available?

This question was asked by pinheadmz on IRC.

**Tags:** bitcoind, network, tor, p2p, peer-discovery


---

## 1 answers

### Answer by username_0 on 2021-06-14. Score: 2 | Accepted answer

Yes you can specify `-externalip` multiple times.

The config option `-externalip` allows you to specify your own public reachable address. This can also be an onion address.

From the Bitcoin Core Tor [documentation](https://github.com/bitcoin/bitcoin/blob/master/doc/tor.md#3-manually-create-a-bitcoin-core-onion-service):

> The one that will be rumoured to a particular peer is the most compatible one and also using heuristics, e.g. the address with the most incoming connections, etc.

Additional context from IRC: Bitcoin Core listens on ipv6, but as the ipv4 address space is embedded in ipv6, that means you can also accept ipv4 connections that way (they'll look like they come from the ipv4-embedded in-ipv6 address). That happens automatically unless you use `-nolisten` or specifically set a bind address with `-bind`. Advertizing addresses is completely independent from listening on them. Pre-BIP155 addr rumouring used a flat ipv6 namespace with ipv4 and Tor v2 addresses embedded in subranges of that space. Since BIP155 with addrv2 every address has an explicit network identifier.


---

