<p>This is mentioned in the Bitcoin Core 0.17 (which introduced network sections) release notes: <a href="https://github.com/bitcoin/bitcoin/blob/master/doc/release-notes/release-notes-0.17.0.md#configuration-sections-for-testnet-and-regtest" rel="nofollow noreferrer">https://github.com/bitcoin/bitcoin/blob/master/doc/release-notes/release-notes-0.17.0.md#configuration-sections-for-testnet-and-regtest</a>.</p>

<p>Certain options must be prefixed with a network, or they'll only apply to mainnet (addnode, connect, port, bind, rpcport, rpcbind, wallet), because they don't make sense to be shared across multiple networks.</p>

CC BY-SA 4.0
2019-06-29T18:16:44.560Z
2019-06-29T18:16:44.560Z
Pieter Wuille
<p>I still have no idea as to WHY this is happening. But changing config to this:</p>

<pre><code>[main]
# Allow JSON-RPC connections from, by default only localhost are allowed
rpcbind=127.0.0.1
rpcbind=10.18.0.1
rpcallowip=127.0.0.1
rpcallowip=10.18.0.0/24

[test]
# Use the test chain
testnet=1

rpcbind=127.0.0.1
rpcbind=10.18.0.1
rpcallowip=127.0.0.1
rpcallowip=10.18.0.0/24
</code></pre>

<p>Solved the issue</p>

<pre><code>admin@az-bitcoind:~$ sudo netstat -natp | grep 8332
tcp        0      0 10.18.0.1:8332          0.0.0.0:*               LISTEN      566/bitcoind        
tcp        0      0 127.0.0.1:8332          0.0.0.0:*               LISTEN      566/bitcoind        
tcp        0      0 10.18.0.1:18332         0.0.0.0:*               LISTEN      567/bitcoind        
tcp        0      0 127.0.0.1:18332         0.0.0.0:*               LISTEN      567/bitcoind     
</code></pre>

<p>No idea why I have to duplicate this settings. I assumed that as long as <code>[main]</code> or <code>[test]</code> are not specified, all config options apply in general</p>

CC BY-SA 4.0
2019-06-29T15:58:45.013Z
2019-06-29T15:58:45.013Z
michnovka
<p>For some reason testnet does not respect bitcoin.conf RPC configuration:</p>

<pre><code>admin@az-bitcoind:~$ sudo netstat -natp | grep 8332
tcp        0      0 10.18.0.1:8332          0.0.0.0:*               LISTEN      582/bitcoind        
tcp        0      0 127.0.0.1:8332          0.0.0.0:*               LISTEN      582/bitcoind        
tcp        0      0 127.0.0.1:18332         0.0.0.0:*               LISTEN      581/bitcoind        
tcp6       0      0 ::1:18332               :::*                    LISTEN      581/bitcoind        
</code></pre>

<p>Expected: bitcoind bound to 10.18.0.1:8332 and 10.18.0.1:18332 and 127.0.0.1:8332 and 127.0.0.1:18332</p>

<p>Reality: bitcoind bound to 10.18.0.1:8332 and 127.0.0.1:8332 and 127.0.0.1:18332 and ::1:18332. NOT 10.18.0.1:18332</p>

<p>Here is my bitcoin.conf</p>

<pre><code># Accept command line and JSON-RPC commands
server=1

# Set database cache size in megabytes (4 to 16384, default: 450)
dbcache=1536

# Set the number of script verification threads (-6 to 16, 0 = auto, &lt;0 = leave that many cores free, default: 0)
par=1

# Set to blocksonly mode, sends and receives no lose transactions, instead handles only complete blocks
blocksonly=0
maxmempool=256

# Tries to keep outbound traffic under the given target (in MiB per 24h), 0 = no limit (default: 0)
maxuploadtarget=256

# Maintain at most &lt;n&gt; connections to peers (default: 125)
maxconnections=32

# Username for JSON-RPC connections
rpcuser=bitcoinrpc

# Password for JSON-RPC connections
rpcpassword=b956a61a2b6b8d30a744165384e3b61e

# Allow JSON-RPC connections from, by default only localhost are allowed
rpcbind=127.0.0.1
rpcbind=10.18.0.1
rpcallowip=127.0.0.1
rpcallowip=10.18.0.0/24

# Maintain a full transaction index, used by the getrawtransaction rpc call (default: 0)
txindex=1

# Make the wallet broadcast transactions (default: 1)
walletbroadcast=1
</code></pre>

<p>Am I doing something wrong?</p>

<bitcoind>
Why bitcoind does not respect rpcbind for testnet?
michnovka
# Why bitcoind does not respect rpcbind for testnet?

(Asked by: username_0 on 2019-06-29)

For some reason testnet does not respect bitcoin.conf RPC configuration:

```
admin@az-bitcoind:~$ sudo netstat -natp | grep 8332
tcp        0      0 10.18.0.1:8332          0.0.0.0:*               LISTEN      582/bitcoind        
tcp        0      0 127.0.0.1:8332          0.0.0.0:*               LISTEN      582/bitcoind        
tcp        0      0 127.0.0.1:18332         0.0.0.0:*               LISTEN      581/bitcoind        
tcp6       0      0 ::1:18332               :::*                    LISTEN      581/bitcoind        

```

Expected: bitcoind bound to 10.18.0.1:8332 and 10.18.0.1:18332 and 127.0.0.1:8332 and 127.0.0.1:18332

Reality: bitcoind bound to 10.18.0.1:8332 and 127.0.0.1:8332 and 127.0.0.1:18332 and ::1:18332. NOT 10.18.0.1:18332

Here is my bitcoin.conf

```
# Accept command line and JSON-RPC commands
server=1

# Set database cache size in megabytes (4 to 16384, default: 450)
dbcache=1536

# Set the number of script verification threads (-6 to 16, 0 = auto, <0 = leave that many cores free, default: 0)
par=1

# Set to blocksonly mode, sends and receives no lose transactions, instead handles only complete blocks
blocksonly=0
maxmempool=256

# Tries to keep outbound traffic under the given target (in MiB per 24h), 0 = no limit (default: 0)
maxuploadtarget=256

# Maintain at most <n> connections to peers (default: 125)
maxconnections=32

# Username for JSON-RPC connections
rpcuser=bitcoinrpc

# Password for JSON-RPC connections
rpcpassword=b956a61a2b6b8d30a744165384e3b61e

# Allow JSON-RPC connections from, by default only localhost are allowed
rpcbind=127.0.0.1
rpcbind=10.18.0.1
rpcallowip=127.0.0.1
rpcallowip=10.18.0.0/24

# Maintain a full transaction index, used by the getrawtransaction rpc call (default: 0)
txindex=1

# Make the wallet broadcast transactions (default: 1)
walletbroadcast=1

```

Am I doing something wrong?

**Tags:** bitcoind


---

## 2 answers

### Answer by username_0 on 2019-06-29. Score: 5 | Accepted answer

I still have no idea as to WHY this is happening. But changing config to this:

```
[main]
# Allow JSON-RPC connections from, by default only localhost are allowed
rpcbind=127.0.0.1
rpcbind=10.18.0.1
rpcallowip=127.0.0.1
rpcallowip=10.18.0.0/24

[test]
# Use the test chain
testnet=1

rpcbind=127.0.0.1
rpcbind=10.18.0.1
rpcallowip=127.0.0.1
rpcallowip=10.18.0.0/24

```

Solved the issue

```
admin@az-bitcoind:~$ sudo netstat -natp | grep 8332
tcp        0      0 10.18.0.1:8332          0.0.0.0:*               LISTEN      566/bitcoind        
tcp        0      0 127.0.0.1:8332          0.0.0.0:*               LISTEN      566/bitcoind        
tcp        0      0 10.18.0.1:18332         0.0.0.0:*               LISTEN      567/bitcoind        
tcp        0      0 127.0.0.1:18332         0.0.0.0:*               LISTEN      567/bitcoind     

```

No idea why I have to duplicate this settings. I assumed that as long as `[main]` or `[test]` are not specified, all config options apply in general


---

### Answer by username_1 on 2019-06-29. Score: 2

This is mentioned in the Bitcoin Core 0.17 (which introduced network sections) release notes: <https://github.com/bitcoin/bitcoin/blob/master/doc/release-notes/release-notes-0.17.0.md#configuration-sections-for-testnet-and-regtest>.

Certain options must be prefixed with a network, or they'll only apply to mainnet (addnode, connect, port, bind, rpcport, rpcbind, wallet), because they don't make sense to be shared across multiple networks.


---

