user138350: I've followed all these steps
How can I setup Bitcoin to be anonymous with Tor?
I've added onlynet line in my conf file, but all my peers come with ipv4 connection. When I run getnetworkinfo I get ipv4, ipv6 and onion all as reachable. Only unreachable is i2p. How do I force my node to use tor and not ipv4 and ipv6.
UPDATE
After deleting peers.dat file, ipv4 and ipv6 would become unreachable under getnetworkinfo. However after some time, not sure if caused by reboot or smth else, it would turn back to reachable and in peerinfo half of the peers would be through ipv4.
Conf file
datadir=/mnt/blockchain/.bitcoin/
txindex=1
server=1
daemon=1
rpcport=8332
rpcbind=0.0.0.0
rpcallowip=127.0.0.1
rpcallowip=10.0.0.0/8
rpcallowip=172.0.0.0/8
rpcallowip=192.0.0.0/8
zmqpubrawblock=tcp://0.0.0.0:28332
zmqpubrawtx=tcp://0.0.0.0:28333
zmqpubhashblock=tcp://0.0.0.0:28334
whitelist=127.0.0.1
rpcauth=bitcoin:#########hashed_out_for_security_reasons##########
proxy=127.0.0.1:9050
listen=1
bind=127.0.0.1
onlynet=onion


user131606: There have been recently some improvements to make sure onlynet is respected, most importantly https://github.com/bitcoin/bitcoin/pull/22834 which has been part of bitcoin core since v23.1.
It has been reported before that older versions of Bitcoin Core would in some situations not respect -onlynet=onion, see e.g. the discussion in https://github.com/bitcoin/bitcoin/issues/22647.
Another issue, that sometimes during initial peer bootstrap (empty peers.dat) DNS seeds would be queried violating the -onlynet option, was fixed in https://github.com/bitcoin/bitcoin/pull/25678 (which will be contained in v 24.x).

138350: <p>I've followed all these steps
<a href="https://bitcoin.stackexchange.com/questions/70069/how-can-i-setup-bitcoin-to-be-anonymous-with-tor">How can I setup Bitcoin to be anonymous with Tor?</a></p>
<p>I've added <code>onlynet</code> line in my conf file, but all my peers come with ipv4 connection. When I run <code>getnetworkinfo</code> I get ipv4, ipv6 and onion all as reachable. Only unreachable is i2p. How do I force my node to use tor and not ipv4 and ipv6.</p>
<p>UPDATE
After deleting peers.dat file, ipv4 and ipv6 would become unreachable under <code>getnetworkinfo</code>. However after some time, not sure if caused by reboot or smth else, it would turn back to reachable and in <code>peerinfo</code> half of the peers would be through ipv4.</p>
<p><strong>Conf file</strong></p>
<pre><code>datadir=/mnt/blockchain/.bitcoin/
txindex=1
server=1
daemon=1
rpcport=8332
rpcbind=0.0.0.0
rpcallowip=127.0.0.1
rpcallowip=10.0.0.0/8
rpcallowip=172.0.0.0/8
rpcallowip=192.0.0.0/8
zmqpubrawblock=tcp://0.0.0.0:28332
zmqpubrawtx=tcp://0.0.0.0:28333
zmqpubhashblock=tcp://0.0.0.0:28334
whitelist=127.0.0.1
rpcauth=bitcoin:#########hashed_out_for_security_reasons##########
proxy=127.0.0.1:9050
listen=1
bind=127.0.0.1
onlynet=onion
</code></pre>
 131606: <p>There have been recently some improvements to make sure <code>onlynet</code> is respected, most importantly <a href="https://github.com/bitcoin/bitcoin/pull/22834" rel="nofollow noreferrer">https://github.com/bitcoin/bitcoin/pull/22834</a> which has been part of bitcoin core since v23.1.</p>
<p>It has been reported before that older versions of Bitcoin Core would in some situations not respect <code>-onlynet=onion</code>, see e.g. the discussion in <a href="https://github.com/bitcoin/bitcoin/issues/22647" rel="nofollow noreferrer">https://github.com/bitcoin/bitcoin/issues/22647</a>.</p>
<p>Another issue, that sometimes during initial peer bootstrap (empty peers.dat) DNS seeds would be queried violating the -onlynet option, was fixed in <a href="https://github.com/bitcoin/bitcoin/pull/25678" rel="nofollow noreferrer">https://github.com/bitcoin/bitcoin/pull/25678</a> (which will be contained in v 24.x).</p>
