I was trying to do the same thing, but so far didn't realize what I was doing wrong. There reason it took me so long to figure it out was that I didn't find the errors here on Stack Exchange, at least not in the context of using a LAN node. Therefore, I'll post them in my answer, to hopefully help other people searching for them. My LAN set-up:
- Server, where
monerod
is running, with an up-to-date blockchain.
- Laptop, where I also have the Monero (CLI) software installed.
On the server, I could obviously use monero-wallet-cli
without passing any special options.
However, from the laptop, using the --daemon-host
option didn't work. I always got these wallet failed to connect to daemon
errors:
$ monero-wallet-cli --daemon-host 192.168.0.100 --wallet-file monero.wallet
Monero 'Wolfram Warptangent' (v0.10.1.0-release)
…
**********************************************************************
Use "help" command to see the list of available commands.
**********************************************************************
Error: wallet failed to connect to daemon: http://192.168.0.100:18081. Daemon either is not started or wrong port was passed. Please make sure daemon is running or restart the wallet with the correct daemon address.
Error: wallet failed to connect to daemon: http://192.168.0.100:18081. Daemon either is not started or wrong port was passed. Please make sure daemon is running or restart the wallet with the correct daemon address.
When using exactly the same command as above on the server, that didn't work either, a bit to my surprise … Only when I changed the actual IP address (192.168.0.100
) to the loopback IP (127.0.0.1
or localhost
), it would work:
$ monero-wallet-cli --daemon-host 127.0.0.1 --wallet-file monero.wallet
I then realized I had to tell monerod
to actually bind to the external IP address rather that the loopback address:
$ monerod exit
$ monerod --rpc-bind-ip 192.168.0.100 --detach
Then, in the ~/.bitmonero/bitmonero.log
file, you'll see the IP address it binds to:
2016-Dec-23 02:05:06.996460 P2p server initialized OK
2016-Dec-23 02:05:06.996663 Initializing core rpc server...
2016-Dec-23 02:05:06.996968 Binding on 192.168.0.100:18081
2016-Dec-23 02:05:06.997666 Core rpc server initialized OK on port: 18081
With the server properly configured, I could now finally use the server's daemon remotely from the laptop, without any errors:
$ monero-wallet-cli --daemon-host 192.168.0.100 --wallet-file monero.wallet
In hindsight, this looks very trivial, but I didn't get it at first.