<p><code>onlynet</code> only affects outbound connections.</p>
<p>If you only want inbound IPv4 connections (why?), you'll need to either:</p>
<ul>
<li>Patch Bitcoin Core to bind to IPv6 addresses in IPV6_V6ONLY mode (see <code>CConnman::BindListenPort</code> in src/net.cpp)</li>
<li>Use some firewall rule on your system to prevent incoming IPv4 connections to it</li>
<li>Make sure you only have a publicly-reachable IPv6 address</li>
</ul>

CC BY-SA 4.0
2021-01-10T18:25:34.703Z
I am only looking for IPv6 connections.  I don't really want my IPv4 address being leaked.
Dave
CC BY-SA 4.0
2021-01-09T20:10:47.127Z
2021-01-09T20:10:47.127Z
Pieter Wuille
<p>Is it possible to restrict all connections to an IPV6 address?</p>
<p>I've set</p>
<pre><code>onlynet=ipv6
bind=::
</code></pre>
<p>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.</p>
<p>Thanks!</p>

<bitcoind><network>
Force Inbound Connections to IPV6 only
Dave
# Force Inbound Connections to IPV6 only

(Asked by: username_0 on 2021-01-09)

Is it possible to restrict all connections to an IPV6 address?
I've set
onlynet=ipv6
bind=::

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.
Thanks!

**Tags:** bitcoind, network


---

## 1 answers

### Answer by username_1 on 2021-01-09. Score: 2

`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

> **Comments:**
> **username_0**: I am only looking for IPv6 connections.  I don't really want my IPv4 address being leaked.  

---

