I use the exact same command, one use 127.0.0.1, and the other use 192.168.3.126, only the first one could succeed. Anyone here has met a similar issue before?
curl --user root --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getblockchaininfo", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/
Enter host password for user 'root':
{"result":{"chain":"main","blocks":205269,"headers":571040,"bestblockhash":"0000000000000508cceb43c817c744e04c557e34799391d5768cbf081cd0e7f2","difficulty":3072321.732020756,"mediantime":1351359250,"verificationprogress":0.02469030455221953,"chainwork":"00000000000000000000000000000000000000000000001e6f6192f0e1ddb53e","pruned":false,"softforks":[{"id":"bip34","version":2,"reject":{"status":false}},{"id":"bip66","version":3,"reject":{"status":false}},{"id":"bip65","version":4,"reject":{"status":false}}],"bip9_softforks":{"csv":{"status":"defined","startTime":1462060800,"timeout":1493596800,"since":0}}},"error":null,"id":"curltest"}
curl --user root --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getblockchaininfo", "params": [] }' -H 'content-type: text/plain;' http://192.168.3.126:8332/
Enter host password for user 'root':
curl: (7) Failed to connect to 192.168.3.126 port 8332: Connection refused
This is my bitcoin.conf
# location to store blockchain and other data.
datadir=/mnt/hgfs/vmware/data
dbcache=4000
# Must set txindex=1 so Bitcoin keeps the full index
txindex=1
# [rpc]
# Accept command line and JSON-RPC commands.
server=1
# Default Username and Password for JSON-RPC connections
rpcuser=root
rpcpassword=bitcoin
# If you want to allow remote JSON-RPC access
rpcallowip=0.0.0.0/0
# [wallet]
disablewallet=1
# [ZeroMQ]
# ZeroMQ messages power the realtime Planaria crawler
# so it's important to set the endpoint
zmqpubhashtx=tcp://192.168.3.126:28332
zmqpubhashblock=tcp://192.168.3.126:28332
# BitDB makes heavy use of JSON-RPC so it's set to a higher number
# But you can tweak this number as you want
rpcworkqueue=512
This is my ip address setup
ifconfig -a
br-76ed1d5730c4: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
inet 172.18.0.1 netmask 255.255.0.0 broadcast 172.18.255.255
inet6 fe80::42:5fff:feb2:2046 prefixlen 64 scopeid 0x20<link>
ether 02:42:5f:b2:20:46 txqueuelen 0 (Ethernet)
RX packets 2628 bytes 1531664 (1.5 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 2732 bytes 3293621 (3.2 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
br-f5226cc26810: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
inet 172.19.0.1 netmask 255.255.0.0 broadcast 172.19.255.255
inet6 fe80::42:58ff:fe87:853c prefixlen 64 scopeid 0x20<link>
ether 02:42:58:87:85:3c txqueuelen 0 (Ethernet)
RX packets 1267140 bytes 83830921 (83.8 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 1262839 bytes 2246455481 (2.2 GB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
docker0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
inet 172.17.0.1 netmask 255.255.0.0 broadcast 172.17.255.255
ether 02:42:9c:ed:2f:9c txqueuelen 0 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.3.126 netmask 255.255.255.0 broadcast 192.168.3.255
inet6 fe80::e064:468a:3938:cd2b prefixlen 64 scopeid 0x20<link>
ether 00:0c:29:66:2e:d9 txqueuelen 1000 (Ethernet)
RX packets 30775030 bytes 45032478812 (45.0 GB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 8445739 bytes 637881701 (637.8 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 3321 bytes 292466 (292.4 KB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 3321 bytes 292466 (292.4 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0