[Question]how can i use ip:host not localhost:port in RPC? #22477

issue lpf763827726 opened this issue on July 17, 2021
  1. lpf763827726 commented at 4:36 AM on July 17, 2021: none

    I want to use ip(LAN IP) in RPC, not 127.0.0.1 or localhost, but i try to change the configuration of conf with this , but it didn't work

    I have been try to close firewall, still not work, and try to add more rpcallowip one by one

    my system is ubuntu 20.04

    my conf now is:

    server=1
    testnet=1
    rpcuser=test
    rpcpassword=123456
    rpcallowip=0.0.0.0
    rpcallowip=127.0.0.1
    rpcallowip=192.168.2.36
    rpcallowip=192.168.2.36/255.255.255.0
    

    command report:

    2021/07/17 12:33:23 Post "http://192.168.2.36:18332": dial tcp 192.168.2.36:18332: connect: connection refused
    

    (it work in localhost and 127.0.0.1) what should i do?

  2. i5hi commented at 6:10 AM on July 17, 2021: none

    Try a conf like this:

    server=1
    testnet=1
    [test]
    rpcuser=test
    rpcpassword=123456
    rpcport=18333
    rpcallowip=127.0.0.1
    rpcallowip=192.168.2.36
    rpcallowip=192.168.2.36/255.255.255.0
    
  3. lpf763827726 commented at 6:40 AM on July 17, 2021: none

    Try a conf like this:

    server=1
    testnet=1
    [test]
    rpcuser=test
    rpcpassword=123456
    rpcport=18333
    rpcallowip=127.0.0.1
    rpcallowip=192.168.2.36
    rpcallowip=192.168.2.36/255.255.255.0
    

    thanks for answer, but still not work,i try to connect :18332 and :18333,still no good

  4. i5hi commented at 7:38 AM on July 17, 2021: none
  5. lpf763827726 commented at 7:57 AM on July 17, 2021: none

    I try to add rpcbind=0.0.0.0 in conf, it work, if i want it use in mainnet, is it only delete [test] and change the port?

  6. i5hi commented at 8:39 PM on July 17, 2021: none

    or add [main] with different port and other settings

  7. fanquake added the label Questions and Help on Jul 18, 2021
  8. lpf763827726 commented at 2:12 AM on July 19, 2021: none

    ok, thank you so much, i will try it when i finish in testnet

  9. lpf763827726 closed this on Jul 19, 2021

  10. DrahtBot locked this on Aug 18, 2022

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-26 06:14 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me