익명 03:42

Bitcoin Core JSONRPC only accept requests with 0.0.0.0 in configs

Bitcoin Core JSONRPC only accept requests with 0.0.0.0 in configs

I've lunched a Bitcoin Core server, and trying to connect to it via JSON-RPC. This is my configuration settings:

server=1  
rpcuser=admin  
rpcpassword=password
rpcport=1234
rpcallowip=94.183.32.151

But all cURL connections to this server via the IP 94.183.32.151 has the same error result as:

cURL error 7: Failed to connect to 94.183.32.151 port 1234: Connection refused

I tried adding this option too, but it did not solve the problem:
rpcbind:94.183.32.151

Only when I put 0.0.0.0 as a bined RPC IP, Bitcoin core returns true response. I've checked many pages but did not find any other appropriate way to allow some certain IPs to Bitcoind. May you help me please?

Note: IP, Port number, username and password are changed from real values.



Top Answer/Comment:

If your server is behind a NAT or otherwise does not have 94.183.32.151 as the IP address for one of the network interfaces, then rpcbind=94.183.32.151 won't work. You can check what IP addresses your node actually has using ifconfig and then rpcbind=<ip> for one of those.

For example, because my node is behind my router's NAT, I have to do rpcbind=192.168.1.2 instead of binding to my external IP of 12.34.56.78.

상단 광고의 [X] 버튼을 누르면 내용이 보입니다