Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default behavior of binding to all interfaces for RPC server not working #9272

Closed
JustinTArthur opened this issue Dec 4, 2016 · 3 comments · Fixed by #16634
Closed

Default behavior of binding to all interfaces for RPC server not working #9272

JustinTArthur opened this issue Dec 4, 2016 · 3 comments · Fixed by #16634

Comments

@JustinTArthur
Copy link
Contributor

JustinTArthur commented Dec 4, 2016

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
@laanwj
Copy link
Member

laanwj commented Dec 5, 2016

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?

@laanwj
Copy link
Member

laanwj commented Dec 5, 2016

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.

@tiabc
Copy link

tiabc commented May 29, 2017

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.

blob42 added a commit to blob42/bitcoin that referenced this issue Nov 18, 2018
@laanwj laanwj closed this as completed in 91ed1b3 Aug 19, 2019
sidhujag pushed a commit to syscoin/syscoin that referenced this issue Aug 19, 2019
fa0119a doc: Refer in rpcbind doc to the manpage (MarcoFalke)

Pull request description:

  The help was outdated, so refer to the updated manpage instead.

  * closes bitcoin#14740
  * closes bitcoin#9272

ACKs for top commit:
  emilengler:
    Concept ACK fa0119a
  laanwj:
    ACK fa0119a
  fanquake:
    ACK fa0119a

Tree-SHA512: 9836e4f31ece7acae334b47e3104b4595d0d1c1977af386a9463faf49aea9de3ab1c1dc3de248d0ee09e3b13693eaf6902dc82d277062e1bb1980b1117236fbb
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this issue Jun 27, 2021
fa0119a doc: Refer in rpcbind doc to the manpage (MarcoFalke)

Pull request description:

  The help was outdated, so refer to the updated manpage instead.

  * closes bitcoin#14740
  * closes bitcoin#9272

ACKs for top commit:
  emilengler:
    Concept ACK fa0119a
  laanwj:
    ACK fa0119a
  fanquake:
    ACK fa0119a

Tree-SHA512: 9836e4f31ece7acae334b47e3104b4595d0d1c1977af386a9463faf49aea9de3ab1c1dc3de248d0ee09e3b13693eaf6902dc82d277062e1bb1980b1117236fbb
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this issue Jun 28, 2021
fa0119a doc: Refer in rpcbind doc to the manpage (MarcoFalke)

Pull request description:

  The help was outdated, so refer to the updated manpage instead.

  * closes bitcoin#14740
  * closes bitcoin#9272

ACKs for top commit:
  emilengler:
    Concept ACK fa0119a
  laanwj:
    ACK fa0119a
  fanquake:
    ACK fa0119a

Tree-SHA512: 9836e4f31ece7acae334b47e3104b4595d0d1c1977af386a9463faf49aea9de3ab1c1dc3de248d0ee09e3b13693eaf6902dc82d277062e1bb1980b1117236fbb
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this issue Jun 29, 2021
fa0119a doc: Refer in rpcbind doc to the manpage (MarcoFalke)

Pull request description:

  The help was outdated, so refer to the updated manpage instead.

  * closes bitcoin#14740
  * closes bitcoin#9272

ACKs for top commit:
  emilengler:
    Concept ACK fa0119a
  laanwj:
    ACK fa0119a
  fanquake:
    ACK fa0119a

Tree-SHA512: 9836e4f31ece7acae334b47e3104b4595d0d1c1977af386a9463faf49aea9de3ab1c1dc3de248d0ee09e3b13693eaf6902dc82d277062e1bb1980b1117236fbb
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this issue Jul 1, 2021
fa0119a doc: Refer in rpcbind doc to the manpage (MarcoFalke)

Pull request description:

  The help was outdated, so refer to the updated manpage instead.

  * closes bitcoin#14740
  * closes bitcoin#9272

ACKs for top commit:
  emilengler:
    Concept ACK fa0119a
  laanwj:
    ACK fa0119a
  fanquake:
    ACK fa0119a

Tree-SHA512: 9836e4f31ece7acae334b47e3104b4595d0d1c1977af386a9463faf49aea9de3ab1c1dc3de248d0ee09e3b13693eaf6902dc82d277062e1bb1980b1117236fbb
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this issue Jul 1, 2021
fa0119a doc: Refer in rpcbind doc to the manpage (MarcoFalke)

Pull request description:

  The help was outdated, so refer to the updated manpage instead.

  * closes bitcoin#14740
  * closes bitcoin#9272

ACKs for top commit:
  emilengler:
    Concept ACK fa0119a
  laanwj:
    ACK fa0119a
  fanquake:
    ACK fa0119a

Tree-SHA512: 9836e4f31ece7acae334b47e3104b4595d0d1c1977af386a9463faf49aea9de3ab1c1dc3de248d0ee09e3b13693eaf6902dc82d277062e1bb1980b1117236fbb
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this issue Jul 12, 2021
fa0119a doc: Refer in rpcbind doc to the manpage (MarcoFalke)

Pull request description:

  The help was outdated, so refer to the updated manpage instead.

  * closes bitcoin#14740
  * closes bitcoin#9272

ACKs for top commit:
  emilengler:
    Concept ACK fa0119a
  laanwj:
    ACK fa0119a
  fanquake:
    ACK fa0119a

Tree-SHA512: 9836e4f31ece7acae334b47e3104b4595d0d1c1977af386a9463faf49aea9de3ab1c1dc3de248d0ee09e3b13693eaf6902dc82d277062e1bb1980b1117236fbb
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Dec 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
4 participants