<p>At least for IPv4, you can't specify <code>0.0.0.0</code> for <code>rpcbind</code>. You'll get this error in bitcoind logs if you try:</p>
<blockquote>
<p>Binding RPC on address 0.0.0.0 port 18443 failed.</p>
</blockquote>
<p>Try <code>127.0.0.1</code> for IPv4, or <code>::1/128</code> for IPv6.</p>
<p><code>bitcoind -rpcbind=127.0.0.1</code></p>

CC BY-SA 4.0
2022-03-08T10:10:11.373Z
Thanks for the input. So I should I expose the RPC for outside communication?
Ron
CC BY-SA 4.0
2022-03-08T13:24:04.257Z
Your answer gave me the right direction, and the following answer provided me the further information i needed: https://askubuntu.com/a/1000779/1464279 (for future visitors).
Thank you.
Ron
CC BY-SA 4.0
2022-03-11T01:51:07.723Z
no, do NOT expose the RPC port to the internet, or any untrusted network. RPC is used to control the bitcoin node, it is not used to relay transactions or otherwise participate in the network. If you don't know you need it, you don't need it.
northben
CC BY-SA 4.0
2022-03-11T18:35:18.080Z
Its behind VPN as I wrote in my question. "If you don't know you need it" what? I didnt understand you point. Anyway I have a service that query the btc-node, and its uses the RPC to communicate.
Ron
CC BY-SA 4.0
2022-03-08T05:33:27.170Z
2022-03-08T05:33:27.170Z
northben
<p>I tried every different combination in bitcoin.conf to make my bitcoin node (hosted in AWS protected behind VPN) reachable but nothing seems to work...</p>
<p>Just to clear it out of the way, I opened the port 8332 on the machine.</p>
<p>Here is my bitcoin.conf:</p>
<pre><code>txindex=1
server=1
rest=1
# Auth Credentials For JSON-RPC server
rpcuser=your_username
rpcpassword=your_password

#chain=test
testnet=1

#rpcallowip=0.0.0.0/0

[test]
rest=1
rpcallowip=0.0.0.0/0
rpcallowip=::/0

rpcbind=0.0.0.0:8332

# Listen for JSON-RPC connections on this port
#rpcport=8332
</code></pre>
<p>Here is the netstat:</p>
<pre><code>ubuntu@blahblah:~$ sudo ss -ltpn
State                      Recv-Q                      Send-Q                                              Local Address:Port                                              Peer Address:Port                                                                                      
LISTEN                     0                           128                                                       0.0.0.0:18333                                                  0.0.0.0:*                          users:((&quot;bitcoind&quot;,pid=14485,fd=29))                           
LISTEN                     0                           128                                                       0.0.0.0:8332                                                   0.0.0.0:*                          users:((&quot;bitcoind&quot;,pid=14485,fd=9))                            
LISTEN                     0                           128                                                 127.0.0.53%lo:53                                                     0.0.0.0:*                          users:((&quot;systemd-resolve&quot;,pid=644,fd=13))                      
LISTEN                     0                           128                                                       0.0.0.0:22                                                     0.0.0.0:*                          users:((&quot;sshd&quot;,pid=760,fd=3))                                  
LISTEN                     0                           128                                                          [::]:18333                                                     [::]:*                          users:((&quot;bitcoind&quot;,pid=14485,fd=28))                           
LISTEN                     0                           128                                                          [::]:22                                                        [::]:*                          users:((&quot;sshd&quot;,pid=760,fd=4))                   
</code></pre>
<p>I cant reach my node with the following RPC call: (locally I can)</p>
<pre><code>curl --data-binary '{&quot;jsonrpc&quot;:&quot;1.0&quot;,&quot;id&quot;:&quot;curltext&quot;,&quot;method&quot;:&quot;getblockchaininfo&quot;,&quot;params&quot;:[]}' -H 'content-type:text/plain;' http://your_username:your_password@my_machine_ip:8332
</code></pre>
<p>I get timeout:</p>
<pre><code>curl: (28) Failed to connect to my_machine_ip port 8332: Connection timed out
</code></pre>
<p>But when I run:</p>
<pre><code>docker run --name mynginx1 -p 8332:80 -d nginx
</code></pre>
<p>I can curl to 8332 from my own computer and get a response.</p>
<p>my netstat with the docker running:</p>
<pre><code>ubuntu@blahblah:~$ sudo ss -ltpn
State              Recv-Q              Send-Q                            Local Address:Port                           Peer Address:Port
LISTEN             0                   4096                                    0.0.0.0:8332                                0.0.0.0:*                 users:((&quot;docker-proxy&quot;,pid=13131,fd=4))
LISTEN             0                   128                               127.0.0.53%lo:53                                  0.0.0.0:*                 users:((&quot;systemd-resolve&quot;,pid=644,fd=13))
LISTEN             0                   128                                     0.0.0.0:22                                  0.0.0.0:*                 users:((&quot;sshd&quot;,pid=760,fd=3))
LISTEN             0                   4096                                       [::]:8332                                   [::]:*                 users:((&quot;docker-proxy&quot;,pid=13139,fd=4))
LISTEN             0                   128                                        [::]:22                                     [::]:*                 users:((&quot;sshd&quot;,pid=760,fd=4))
</code></pre>
<p>What's lead me to the conclusion that my problem is that I dont have IPv6 rpc bind with the bitcoin node.</p>
<p>I went to the manual and read the following:</p>
<blockquote>
<p>-rpcbind=[:port]
Bind to given address to listen for JSON-RPC connections. Do not expose
the RPC server to untrusted networks such as the public internet!
This option is ignored unless -rpcallowip is also passed. Port is
optional and overrides -rpcport. Use [host]:port notation for
IPv6. This option can be specified multiple times (default:
127.0.0.1 and ::1 i.e., localhost)</p>
</blockquote>
<p>But every way I tried to specify the IPv6 in the rpcbind is not helping.</p>

<bitcoin-core><bitcoind><json-rpc><rpc-error-25>
Bitcoin RPC not reachable: Cant bind RPC server to IPV6
Ron
# Bitcoin RPC not reachable: Cant bind RPC server to IPV6

(Asked by: username_0 on 2022-03-07)

I tried every different combination in bitcoin.conf to make my bitcoin node (hosted in AWS protected behind VPN) reachable but nothing seems to work...

Just to clear it out of the way, I opened the port 8332 on the machine.

Here is my bitcoin.conf:

```
txindex=1
server=1
rest=1
# Auth Credentials For JSON-RPC server
rpcuser=your_username
rpcpassword=your_password

#chain=test
testnet=1

#rpcallowip=0.0.0.0/0

[test]
rest=1
rpcallowip=0.0.0.0/0
rpcallowip=::/0

rpcbind=0.0.0.0:8332

# Listen for JSON-RPC connections on this port
#rpcport=8332

```

Here is the netstat:

```
ubuntu@blahblah:~$ sudo ss -ltpn
State                      Recv-Q                      Send-Q                                              Local Address:Port                                              Peer Address:Port                                                                                      
LISTEN                     0                           128                                                       0.0.0.0:18333                                                  0.0.0.0:*                          users:(("bitcoind",pid=14485,fd=29))                           
LISTEN                     0                           128                                                       0.0.0.0:8332                                                   0.0.0.0:*                          users:(("bitcoind",pid=14485,fd=9))                            
LISTEN                     0                           128                                                 127.0.0.53%lo:53                                                     0.0.0.0:*                          users:(("systemd-resolve",pid=644,fd=13))                      
LISTEN                     0                           128                                                       0.0.0.0:22                                                     0.0.0.0:*                          users:(("sshd",pid=760,fd=3))                                  
LISTEN                     0                           128                                                          [::]:18333                                                     [::]:*                          users:(("bitcoind",pid=14485,fd=28))                           
LISTEN                     0                           128                                                          [::]:22                                                        [::]:*                          users:(("sshd",pid=760,fd=4))                   

```

I cant reach my node with the following RPC call: (locally I can)

```
curl --data-binary '{"jsonrpc":"1.0","id":"curltext","method":"getblockchaininfo","params":[]}' -H 'content-type:text/plain;' http://your_username:your_password@my_machine_ip:8332

```

I get timeout:

```
curl: (28) Failed to connect to my_machine_ip port 8332: Connection timed out

```

But when I run:

```
docker run --name mynginx1 -p 8332:80 -d nginx

```

I can curl to 8332 from my own computer and get a response.

my netstat with the docker running:

```
ubuntu@blahblah:~$ sudo ss -ltpn
State              Recv-Q              Send-Q                            Local Address:Port                           Peer Address:Port
LISTEN             0                   4096                                    0.0.0.0:8332                                0.0.0.0:*                 users:(("docker-proxy",pid=13131,fd=4))
LISTEN             0                   128                               127.0.0.53%lo:53                                  0.0.0.0:*                 users:(("systemd-resolve",pid=644,fd=13))
LISTEN             0                   128                                     0.0.0.0:22                                  0.0.0.0:*                 users:(("sshd",pid=760,fd=3))
LISTEN             0                   4096                                       [::]:8332                                   [::]:*                 users:(("docker-proxy",pid=13139,fd=4))
LISTEN             0                   128                                        [::]:22                                     [::]:*                 users:(("sshd",pid=760,fd=4))

```

What's lead me to the conclusion that my problem is that I dont have IPv6 rpc bind with the bitcoin node.

I went to the manual and read the following:

> -rpcbind=[:port]
> Bind to given address to listen for JSON-RPC connections. Do not expose
> the RPC server to untrusted networks such as the public internet!
> This option is ignored unless -rpcallowip is also passed. Port is
> optional and overrides -rpcport. Use [host]:port notation for
> IPv6. This option can be specified multiple times (default:
> 127.0.0.1 and ::1 i.e., localhost)

But every way I tried to specify the IPv6 in the rpcbind is not helping.

**Tags:** bitcoin-core, bitcoind, json-rpc, rpc-error-25


---

## 1 answers

### Answer by username_1 on 2022-03-08. Score: 3 | Accepted answer

At least for IPv4, you can't specify `0.0.0.0` for `rpcbind`. You'll get this error in bitcoind logs if you try:

> Binding RPC on address 0.0.0.0 port 18443 failed.

Try `127.0.0.1` for IPv4, or `::1/128` for IPv6.

`bitcoind -rpcbind=127.0.0.1`

> **Comments:**
> **username_0**: Thanks for the input. So I should I expose the RPC for outside communication?  
> **username_0**: Your answer gave me the right direction, and the following answer provided me the further information i needed: https://askubuntu.com/a/1000779/1464279 (for future visitors). Thank you.  
> **username_1**: no, do NOT expose the RPC port to the internet, or any untrusted network. RPC is used to control the bitcoin node, it is not used to relay transactions or otherwise participate in the network. If you don't know you need it, you don't need it.  
> **username_0**: Its behind VPN as I wrote in my question. "If you don't know you need it" what? I didnt understand you point. Anyway I have a service that query the btc-node, and its uses the RPC to communicate.  

---

