Welcome to the Dash Forum!

Please sign up to discuss the most innovative cryptocurrency!

IPV6 addresses

Discussion in 'Masternode Questions and Help.' started by jimbit, Sep 3, 2015.

  1. jimbit

    jimbit Well-known Member
    Foundation Member

    Joined:
    May 23, 2014
    Messages:
    226
    Likes Received:
    103
    Trophy Points:
    203
    Is it possible to set up a MasterNode using and IPV6 address?

    this looks promising:

    dash-cli masternode status
    {
    "vin" : "CTxIn(COutPoint(a882fefaacf811142eca5650c4325e92361aedf36e3eaaf3325714e95581f629, 0), scriptSig=)",
    "service" : "[2001:470:b:73b:250:56ff:fe0c:3a3d]:19999",
    "pubKeyMasternode" : "y1gKw5sVPUbHowJmpCTWiGUQ8NjR8hRBD3",
    "status" : "Masternode successfully started"


    edit2:
    ipv6 is working, although no payment yet... and I am having a little trouble with 9999.. and dashninja has altered the site to handle it properly: Thank you Elbo!
     
    #1 jimbit, Sep 3, 2015
    Last edited by a moderator: Sep 6, 2015
  2. nmarley

    nmarley Administrator
    Dash Core Team Moderator

    Joined:
    Jun 28, 2014
    Messages:
    366
    Likes Received:
    424
    Trophy Points:
    133
    Did you have to do anything special on your MN host or did it automatically bind to port 9999 for your IPv6 range?

    If yes, did you just have to change your masternode.conf to an ipv6 instead of ipv4 address?
     
  3. nmarley

    nmarley Administrator
    Dash Core Team Moderator

    Joined:
    Jun 28, 2014
    Messages:
    366
    Likes Received:
    424
    Trophy Points:
    133
    Ok, answered my own question. Got it to work exactly as described above in testnet, just changed to IPv6 in masternode.conf.
     
  4. jimbit

    jimbit Well-known Member
    Foundation Member

    Joined:
    May 23, 2014
    Messages:
    226
    Likes Received:
    103
    Trophy Points:
    203
    Good.

    My IPV6 nodes have been running great since I migrated to my new hosting a couple of months ago.. payments look OK.
     
  5. Solarminer

    Solarminer Well-known Member

    Joined:
    Apr 4, 2015
    Messages:
    762
    Likes Received:
    921
    Trophy Points:
    163
    So this works! Is this all you need for your configs?
    Server
    bindip=xx:xx:xx:xx:xx:xx:xx
    externalip=xx:xx:xx:xx:xx:xx:xx:9999
    Wallet
    1 xx:xx:xx:xx:xx:xx:xx:9999 asdfasdfasdffasdf aasdfasdf 0

    Then you should be able to use 6tunnel to forward the IPv6 9999 port to a different port on ipv4. VPS hosts are getting picky about IPV4 addressees even requiring customer/website names.
     
  6. nmarley

    nmarley Administrator
    Dash Core Team Moderator

    Joined:
    Jun 28, 2014
    Messages:
    366
    Likes Received:
    424
    Trophy Points:
    133
    I don't understand forwarding IPv6 9999 port to an IPv4 port... what is this trying to accomplish?

    This is all I have in my mn config, and you can even leave out the rpc stuff:

    Code:
    listen=1
    daemon=1
    logtimestamps=1
    maxconnections=256
    server=1
    rpcuser=XXXXXXXXXXXX
    rpcpassword=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
    rpcallowip=127.0.0.1
    masternode=1
    masternodeprivkey=7XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
    Note that when I set up the IPv6 node, I didn't alter the MN server setup at all (IPv6 port 9999 is already open). All I did was changed the masternode.conf on my local hot wallet to be an IPv6 address instead of IPv4. The dashd binds to both IPv4 and IPv6, it looks like from the debug.conf....

    Code:
    2015-10-27 XX:XX:XX AddLocal(XXX.XXX.XXX.XXX:9999,1)
    2015-10-27 XX:XX:XX Discover: IPv4 eth0: XXX.XXX.XXX.XXX
    2015-10-27 XX:XX:XX AddLocal([X:X:X:X::X:X]:9999,1)
    2015-10-27 XX:XX:XX Discover: IPv6 eth0: X:X:X:X::X:X
     
  7. Solarminer

    Solarminer Well-known Member

    Joined:
    Apr 4, 2015
    Messages:
    762
    Likes Received:
    921
    Trophy Points:
    163
    Thanks for your config info.
    The reason for the bind ip, ports and the 6tunnel is if you want to run more than one node on a server. You can run 3 nodes on 1GB ram/1GB Swap, 7 nodes on 2GB/2GB. Typically, a VPS will give you only 1 or 2 ipv4 addresses and a bunch of ipv6. So you would have a main ip(probably the ipv4). You would forward all the 9999 and 9998 ports from the ipv6 addresses to a different port (like 9997/9996) for each node on the main ip. A little complicated. I bet if you put the bind ip on the server side you can force one node to use the ipv4 and another to use the ipv6 address(with a different port) effectively giving you two ips. That is why this is interesting!

    Of course, An ipv6 may also require a dedicated IPV4 to bind with like you indicated, but I will see if I can make this work without.
     
    • Like Like x 1
  8. nmarley

    nmarley Administrator
    Dash Core Team Moderator

    Joined:
    Jun 28, 2014
    Messages:
    366
    Likes Received:
    424
    Trophy Points:
    133
    I had no idea about the stats on how many MNs can be run based on amount of memory, etc, but was wondering about that, thank you!

    So, most of that tunnelling stuff doesn't make sense to me, but I don't think it's required.

    Lemme try & do this on testnet... and I'll get back real quick... I think it's as simple as binding to a different ipv6 address/port 9999 for each dashd process. Will get back w/you soon on this.
     
  9. nmarley

    nmarley Administrator
    Dash Core Team Moderator

    Joined:
    Jun 28, 2014
    Messages:
    366
    Likes Received:
    424
    Trophy Points:
    133
    Ok, correcting my own mistakes here...

    ... first, it's debug.log, not debug.conf, just caught that.

    Second, I don't think those AddLocal or Discover lines are the bind addresses. Grep for 'Bound' in debug.log to see what dashd actually binds to (addresses & ports).

    Code:
    2015-10-27 XX:XX:XX Bound to [::]:9999
    2015-10-27 XX:XX:XX Bound to 0.0.0.0:9999
    You can use telnet to test if it's bound, and telnet has a -6 option for IPv6.

    Add this line below in dash.conf to bind ONLY to that specific IPv6 port/address (obviously use the right port for mainnet/testnet).

    Code:
    bind=[X:X:X:X::X:X]:19999
     
  10. nmarley

    nmarley Administrator
    Dash Core Team Moderator

    Joined:
    Jun 28, 2014
    Messages:
    366
    Likes Received:
    424
    Trophy Points:
    133
    Yep! It works on testnet.

    So, in summary: IPv4 not required for anything really. No tunneling, none of that.

    1. Just have separate IPv6 addresses setup correctly on your host.
    2. Bind to a certain IPv6 address for each dashd process, e.g.:

    Code:
    bind=[address1]:9999
    ...and in a different config file for a different process:

    Code:
    bind=[address2]:9999
    ... and that's it. Set up your local masternode.conf correctly, ensure the port is open for IPv6 on your firewall and you should be good. At least, it worked for me on testnet.
     
  11. Solarminer

    Solarminer Well-known Member

    Joined:
    Apr 4, 2015
    Messages:
    762
    Likes Received:
    921
    Trophy Points:
    163
    Binding to an ipv6 then it looks like this should work. This is really good news since ipv4 addresses are running out. Thanks for investigating.

    If you want to run 2 or more nodes on the same server then you need to forward ports. For a VPS you can use iptables to move ports on ipv4 addresses. I have done this and it works well. If you you only have ipv6 ports, you should also be able to use iptables to forward ports.

    But when you forward ipv6 ports onto an ipv4 address you need a different program - I think 6tunnel would work. I will give it a try on the next change I make to my vps nodes when I one of my extra ipv4 addresses expire.
     
  12. nmarley

    nmarley Administrator
    Dash Core Team Moderator

    Joined:
    Jun 28, 2014
    Messages:
    366
    Likes Received:
    424
    Trophy Points:
    133
    Mm.... nope, what I'm trying to say in the posts above is that I just successfully started two masternodes on the same host without forwarding ports. So that's not the case at all.

    Each IP address (v4 or v6) has its own ports, so these below are the same exact machine, same port #, but different IPv6 addresses:

    Code:
    2604:a880:0:1010::4b:e000]:19999
    2604:a880:0:1010::4b:e002]:19999
    This is from masternodelist full on testnet:

    Code:
    {
    "104093976473e05c79e521ab9e1cda21c2e55d82757aacc323939102a85f1372-1" : " ENABLED 70103 y3BcSAaSz9vnnpCWHREtHADD3s5aKgwg6a [2604:a880:0:1010::4b:e000]:19999 1448058227 20102 1448052155",
    "4c1acd2ace309d3c1a237ee3cc9271e7c9ab10c2a689a1342f17c7cc08f97c50-1" : " ENABLED 70103 xxXx55Pbc1RcmcW9GC2skhziuheaBv4CWS [2604:a880:0:1010::4b:e002]:19999 1448058159 15630 1448055651"
    }
    Notice those IPv6 addresses? Same machine, no port forwarding. Only difference is the e000 and e002 address at the end -- I set up two alternate IPv6 addresses on the same eth0 device on my VPS.

    IPv4 has nothing to do with any of it.
     
  13. nmarley

    nmarley Administrator
    Dash Core Team Moderator

    Joined:
    Jun 28, 2014
    Messages:
    366
    Likes Received:
    424
    Trophy Points:
    133
    Or, maybe you meant for IPv4 addresses, in which case, yeah, maybe. IPv6 solves the problem.
     
  14. Solarminer

    Solarminer Well-known Member

    Joined:
    Apr 4, 2015
    Messages:
    762
    Likes Received:
    921
    Trophy Points:
    163
    I thought if you run nodes with listen=1 it won't let you run 2 nodes at the same time with the same port (9999). IPV6 may be different, don't know.
     
  15. nmarley

    nmarley Administrator
    Dash Core Team Moderator

    Joined:
    Jun 28, 2014
    Messages:
    366
    Likes Received:
    424
    Trophy Points:
    133
    How would it know that both IPv6 addresses are on the same host?

    edit: clarity
     
  16. nmarley

    nmarley Administrator
    Dash Core Team Moderator

    Joined:
    Jun 28, 2014
    Messages:
    366
    Likes Received:
    424
    Trophy Points:
    133
    It should work with IPv4 as well, providing you can get 2 or more IPv4 addresses for the same server. But VPS providers are making it harder these days & it costs. IPv6 addresses are plenty, so free. I get 16 IPv6 addresses per server with my VPS.
     
  17. Solarminer

    Solarminer Well-known Member

    Joined:
    Apr 4, 2015
    Messages:
    762
    Likes Received:
    921
    Trophy Points:
    163
    Try to run 2 wallets on windows. It will say wallet is already running when you start the second. If you change ports in one dash.conf both will be able to start.
     
  18. nmarley

    nmarley Administrator
    Dash Core Team Moderator

    Joined:
    Jun 28, 2014
    Messages:
    366
    Likes Received:
    424
    Trophy Points:
    133
    Which ports exactly? RPC or the dash server itself?

    Port 9999 on one IP address is not the same as port 9999 on a different IP address even if they're the same machine. Same for all ports. But if you're enabling RPC interface on 127.0.0.1, then yeah, it will need different ports for that.

    So if you add a specific bind directive for each IP address and disable JSON-RPC, then you should be able to do it using IPv4 without forwarding ports. If you want RPC you could bind to those external addresses also, but that's not secure. I guess you could firewall it.
     
  19. Solarminer

    Solarminer Well-known Member

    Joined:
    Apr 4, 2015
    Messages:
    762
    Likes Received:
    921
    Trophy Points:
    163
    Interesting.... So you can run a masternode without using the RPC stuff. I still need to use it for the Dashwhale notifier though.

    Not secure. Someone would need your user/password to to anything. And even then, what is the worst that could happen, they shutdown your masternode?
     
  20. nmarley

    nmarley Administrator
    Dash Core Team Moderator

    Joined:
    Jun 28, 2014
    Messages:
    366
    Likes Received:
    424
    Trophy Points:
    133
    They might be able to DOS/DDOS it. And if you're not serving it over https, someone could sniff your username/password.

    edit: add https note
     
  21. Solarminer

    Solarminer Well-known Member

    Joined:
    Apr 4, 2015
    Messages:
    762
    Likes Received:
    921
    Trophy Points:
    163
    FYI, I couldn't activate a masternode without the port 9998 forwarded. So I think you need the RPC and port forwarding to make it all work with more than one node on a server.

    I suppose it is possible that you could run a hot node without RPC, but that is risky.
     
  22. nmarley

    nmarley Administrator
    Dash Core Team Moderator

    Joined:
    Jun 28, 2014
    Messages:
    366
    Likes Received:
    424
    Trophy Points:
    133
    Just did it for a week on testnet. I specified a different port for RPC. Port forwarding is not required.
     
  23. weequ

    weequ New Member

    Joined:
    Feb 22, 2015
    Messages:
    10
    Likes Received:
    1
    Trophy Points:
    3
    Finally got it working after changing the rpc port on the second masternode.

    if you are getting this error:
    Code:
    Error: An error occurred while setting up the RPC address 0.0.0.0 port 9998 for listening: bind: Address already in use
    just add this to dash.conf:
    Code:
    rpcport=9997
    The masternode started successfully without even specifying the port anywhere locally. What is the rpc even used for?
     
  24. Solarminer

    Solarminer Well-known Member

    Joined:
    Apr 4, 2015
    Messages:
    762
    Likes Received:
    921
    Trophy Points:
    163
    I believe the rpcport is what dashd listens for when doing a remote start or remote mining to the wallet.

    Only one rpcport per server can be in use at the same time. So running two nodes requires the 2nd node to have a different rpcport.

    I think you can get around port forwarding by doing this. Change the rpcport to be different on each node. Then start one at a time to remote start. Once remote started individually, they can hot start if started again within 60 minutes.

    If you want to have them running at the same time and receive start commands you need to port forward the 9998 on each IP to different internal ports. iptables is what I use with remote servers with ipv4. ip6tables is used for ipv6 and only available in ubuntu 15 or similar latest versions.
     
  25. weequ

    weequ New Member

    Joined:
    Feb 22, 2015
    Messages:
    10
    Likes Received:
    1
    Trophy Points:
    3
    But i successfully started 2 nodes without port forwarding or having to specify the port on my local computer.
     
  26. nmarley

    nmarley Administrator
    Dash Core Team Moderator

    Joined:
    Jun 28, 2014
    Messages:
    366
    Likes Received:
    424
    Trophy Points:
    133
    That's the JSONRPC interface that listens for commands. It's what allows you to interface with dashd (and thus the Dash network) programmatically.

    Here's the initial Bitcoin JSON-RPC API reference if you want to know more.
     
  27. nmarley

    nmarley Administrator
    Dash Core Team Moderator

    Joined:
    Jun 28, 2014
    Messages:
    366
    Likes Received:
    424
    Trophy Points:
    133
    The remote-start of a masternode hot/cold wallet setup doesn't need the JSON-RPC interface at all. The remote-start command is sent to the masternode at the Dash protocol level through the dashd port (9999).

    The rpc interface is used for locally managing your MN instance, e.g. running "stop" or "getinfo", "mnbudget", things like that. Anything that you can do on the debug console, you can do with the JSON-RPC interface, and the dash-cli command just uses that. But it's not required for the daemon to run, nor for masternoding.
     
  28. weequ

    weequ New Member

    Joined:
    Feb 22, 2015
    Messages:
    10
    Likes Received:
    1
    Trophy Points:
    3
    Thank you for clarification about JSON-RPC.
     
  29. Solarminer

    Solarminer Well-known Member

    Joined:
    Apr 4, 2015
    Messages:
    762
    Likes Received:
    921
    Trophy Points:
    163
    So how do you disable the JSON-RPC? Do you just leave the rpc-port=9998 out of the config?
     
  30. nmarley

    nmarley Administrator
    Dash Core Team Moderator

    Joined:
    Jun 28, 2014
    Messages:
    366
    Likes Received:
    424
    Trophy Points:
    133
    No, set server=0 in the dash.conf