Bitcoin: Default behavior of binding to all interfaces for RPC server not working

Created on 4 Dec 2016  ·  3Comments  ·  Source: bitcoin/bitcoin

Describe the issue

The --help for rpcbind suggests that the default behavior is to bind to all interfaces. However, in Core 0.13.1, I noticed that if rpcbind is left out of the config, the RPC server is either only bound to the loopback interface or only bound to the IPv6 port.

Can you reliably reproduce the issue?

Yes. It fails differently, depending on whether or not you've supplied rpcallowip

Reproduction Scenario 1

Fails silently, only binds to loopback interface.

server=1
rpcuser=something
rpcpassword=somethingelse
  • Binds to 127.0.0.1:8332
  • Binds to [fe80::1%lo0]:8332

Reproduction Scenario 2

Error message in log, only binds to all interfaces for IPv6.

server=1
rpcuser=something
rpcpassword=somethingelse
rpcallowip=0.0.0.0/0
rpcallowip=::/0
  • Binding RPC on address 0.0.0.0 port 8332 failed. reported in _debug.log_.
  • Binds to [::]:8332

What version of bitcoin-core are you using?

0.13.1

Machine specs:

  • OS: Apple OS X 10.11.6 (15G1108)
  • CPU: 2.7 GHz 12-Core Intel Xeon E5
  • RAM: 64 GB 1866 MHz DDR3 ECC
  • Disk size: 1TB
  • Disk Type (HD/SDD): SSD
RPRESZMQ

Most helpful comment

I've just faced the same problem. Maybe it's worth noting this behavior in bitcoind help?

Because although the behavior has always been such, the option is unambiguously described that it binds to all interfaces by default:

  -rpcbind=<addr>
       Bind to given address to listen for JSON-RPC connections. Use
       [host]:port notation for IPv6. This option can be specified
       multiple times (default: bind to all interfaces)

I had to google some more time to find out an answer.

All 3 comments

Are you sure this is really the case?

That message:

Binding RPC on address 0.0.0.0 port 8332 failed. reported in debug.log.

Means that it can't bind on 0.0.0.0 - which usually means that the IPv6 any address works as 'catchall' for both incoming IPv4 and IPv6 connections. This is the case on some OSes, making it unnecessary to have two binds.

Have you tried connecting to the port?

BTW: the default behavior is, and always has been, to bind on all interfaces if -rpcallowip is set. If not bind on localhost only [both given no explicit binds]. This is a security feature.

I've just faced the same problem. Maybe it's worth noting this behavior in bitcoind help?

Because although the behavior has always been such, the option is unambiguously described that it binds to all interfaces by default:

  -rpcbind=<addr>
       Bind to given address to listen for JSON-RPC connections. Use
       [host]:port notation for IPv6. This option can be specified
       multiple times (default: bind to all interfaces)

I had to google some more time to find out an answer.

Was this page helpful?
0 / 5 - 0 ratings