Bitcoin Forum
December 14, 2024, 05:11:25 AM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: can't make bitcoin-qt to listen at 18332 for outside IPs  (Read 1885 times)
CryptoPanda (OP)
Sr. Member
****
Offline Offline

Activity: 910
Merit: 302


View Profile
September 12, 2014, 03:22:50 PM
Last edit: September 14, 2014, 10:29:49 AM by CryptoPanda
Merited by DaNNy001 (5), Wiwo (2), GiftedMAN (2)
 #1

It should be listening at 
"tcp       0      0 0.0.0.0:18332" but it's only listening at

Code:
 sudo netstat -tulpn | grep 833
tcp        0      0 0.0.0.0:18333           0.0.0.0:*               LISTEN      1641/bitcoin-qt
tcp6       0      0 :::18332                :::*                    LISTEN      1641/bitcoin-qt
tcp6       0      0 :::18333                :::*                    LISTEN     

This is the conf file
Code:
rpcuser=REMOVED

rpcpassword=REMOVED

rpcallowip=192.168.0.3 #this is the miner IP which is in the LAN and is accessible from my PC just fine
#gen=1     #tested with both that commented out and not, not sure if it's needed
server=1
testnet=1



If I comment rpcallowip, it would listen only to localhost connections

Code:
 sudo netstat -tulpn | grep 833
tcp        0      0 127.0.0.1:18332         0.0.0.0:*               LISTEN      1709/bitcoin-qt
tcp        0      0 0.0.0.0:18333           0.0.0.0:*               LISTEN      1709/bitcoin-qt
tcp6       0      0 ::1:18332               :::*                    LISTEN      1709/bitcoin-qt
tcp6       0      0 :::18333                :::*                    LISTEN 

as soon as I set rpcallowip to allow the LAN IP, it stops listening at all at this port (only at Ipv6)

really weird, right?
CryptoPanda (OP)
Sr. Member
****
Offline Offline

Activity: 910
Merit: 302


View Profile
September 13, 2014, 08:15:04 AM
 #2

tough one, isn't it? Smiley
CryptoPanda (OP)
Sr. Member
****
Offline Offline

Activity: 910
Merit: 302


View Profile
September 14, 2014, 10:30:30 AM
 #3

original post edited for clarity on the issue
CryptoPanda (OP)
Sr. Member
****
Offline Offline

Activity: 910
Merit: 302


View Profile
September 15, 2014, 10:52:32 AM
 #4

No one had this problem I suppose?
chill1
Newbie
*
Offline Offline

Activity: 8
Merit: 0


View Profile WWW
September 15, 2014, 12:33:32 PM
 #5

Code:
sudo netstat -tulpn | grep 833

Correct me if I am wrong, but wouldn't the above command filter out any result that did *not* include 833? What results do you get when you try the following?

Code:
sudo netstat -lpn | grep bitcoind
CryptoPanda (OP)
Sr. Member
****
Offline Offline

Activity: 910
Merit: 302


View Profile
September 15, 2014, 12:36:35 PM
 #6

i'm getting all that listen to port having *833* in it

in the meantime i found that for bitcoind to allow connections outside of localhost, rpcssl=1 should be enabled and the proper certs generated and so on, but even after doing that, i still can't make it listen to the outside.
chill1
Newbie
*
Offline Offline

Activity: 8
Merit: 0


View Profile WWW
September 15, 2014, 12:39:50 PM
 #7

.. i still can't make it listen to the outside.

You can't access the RPC port you mean? Or bitcoind is failing to establish any connections and is failing to download any blocks as a result? Is there anything interesting in the debug.log file? This file should be located in the testnet3 directory.
CryptoPanda (OP)
Sr. Member
****
Offline Offline

Activity: 910
Merit: 302


View Profile
September 15, 2014, 12:49:01 PM
 #8

I can't make it listen for outside connection at the RPC port, and can't connect to it from the outside.
everything else is fine

nothing really interesting in debug.log Sad
chill1
Newbie
*
Offline Offline

Activity: 8
Merit: 0


View Profile WWW
September 15, 2014, 01:03:16 PM
 #9

I would suggest not using the rpcallowip at all. Here's how I currently have a bitcoind setup with remote RPC access:

* Add firewall settings to the bitcoind server that allow 127.0.0.1 to access the RPC port (18332 for testnet, 8332 for mainnet).
* Create a new linux user on the bitcoind server for the sole purpose of providing port forwarding via SSH for the RPC port.
* Setup SSH tunnel access from the machine(s) that require remote RPC access to the bitcoind server. The SSH tunnel should use the new linux user for the SSH session. I like to use public/private RSA keys to setup passwordless SSH between machines. Lastly, for security, when you are adding a public key to the list of authorized keys for the new linux user, you'll want to prevent command execution and restrict port forwarding to only the required RPC port.

Here's a snippet that let's you lock down an SSH session in the manner I just described:
Code:
no-pty,no-X11-forwarding,permitopen="localhost:18332",command="/bin/echo do-not-send-commands" THE_PUBLIC_KEY_GOES_HERE

This setup allows remote RPC access via an SSH tunnel without having to expose bitcoind ports to the net (only to the local machine).

If you have never setup passwordless SSH before, I wrote an article a while back that I posted on my site:
https://degreesofzero.com/article/passwordless-ssh-on-linux.html


-------- EDIT --------

You know it just occurs to me. You're referencing port 18333 everywhere. That's not the testnet RPC port. Port 18332 is the testnet RPC port that you should be attempting to connect to when using RPC.
CryptoPanda (OP)
Sr. Member
****
Offline Offline

Activity: 910
Merit: 302


View Profile
September 15, 2014, 01:06:37 PM
 #10

that's really smart trick, but in this particular case the machine that needs to connect is bitcoin miner so no option to set ssh access from there.
chill1
Newbie
*
Offline Offline

Activity: 8
Merit: 0


View Profile WWW
September 15, 2014, 01:11:03 PM
 #11

Try leaving out the rpcallowip directive anyways. What have you done to be sure that the miner is not able to connect via RPC?
chill1
Newbie
*
Offline Offline

Activity: 8
Merit: 0


View Profile WWW
September 15, 2014, 01:26:23 PM
 #12

Quote
when I comment out rpcallowip it listens at 127.0.0.1:18332,  as soon as i set this line active, it stops listening to both localhost and outside
well i've set the url, port, user and password for the miner to connect to but it can't

That's not much to go on. What kind of debugging tools are available for you with the miner? Does it have a screen? Can you access it via SSH from your computer? What operating system is it running?

--- EDIT ---

Also, just a shot in the dark.. Is there a testnet option that you might have to set in the miner's configuration? It might be necessary to explicitly set such a flag, beyond setting the RPC port to 18332.
CryptoPanda (OP)
Sr. Member
****
Offline Offline

Activity: 910
Merit: 302


View Profile
September 15, 2014, 01:30:30 PM
 #13

Well, i haven't really tried to troubleshoot the miner, since netstat clearly shows that the bitcoin machine doesn't even listen at this port for a connection. So I'm focusing on trying to make bitcoin work properly.
When it works if you just put the IP:port in the browser it asks for json password anyway, that's an easy way to test if it works from the outside. Well it doesn't Sad
chill1
Newbie
*
Offline Offline

Activity: 8
Merit: 0


View Profile WWW
September 15, 2014, 01:34:55 PM
 #14

I don't have any more ideas. Sorry I couldn't help you fix your problem Sad

Best of luck!
btchris
Hero Member
*****
Offline Offline

Activity: 672
Merit: 504

a.k.a. gurnec on GitHub


View Profile WWW
September 15, 2014, 06:31:45 PM
 #15

Well, i haven't really tried to troubleshoot the miner, since netstat clearly shows that the bitcoin machine doesn't even listen at this port for a connection.

It should be listening at  
"tcp       0      0 0.0.0.0:18332" but it's only listening at

Code:
 sudo netstat -tulpn | grep 833
tcp        0      0 0.0.0.0:18333           0.0.0.0:*               LISTEN      1641/bitcoin-qt
tcp6       0      0 :::18332                :::*                    LISTEN      1641/bitcoin-qt
tcp6       0      0 :::18333                :::*                    LISTEN      
Quote
If I comment rpcallowip, it would listen only to localhost connections

Code:
 sudo netstat -tulpn | grep 833
tcp        0      0 127.0.0.1:18332         0.0.0.0:*               LISTEN      1709/bitcoin-qt
tcp        0      0 0.0.0.0:18333           0.0.0.0:*               LISTEN      1709/bitcoin-qt
tcp6       0      0 ::1:18332               :::*                    LISTEN      1709/bitcoin-qt
tcp6       0      0 :::18333                :::*                    LISTEN  

as soon as I set rpcallowip to allow the LAN IP, it stops listening at all at this port (only at Ipv6)

really weird, right?

This is normal behavior even though it is a bit confusing.

Without rpcallowip, Bitcoin creates two separate listening sockets for RPC, one for each localhost address.

When you create a listening socket with IPv6 that's not bound to a specific IP, you have the option to allow the socket to listen on IPv4 at the same time. With an rcpallowip option, Bitcoin does just that: it creates a single socket, not bound to a specific address, that is listening to both IPv4 and IPv6. Such a socket will only be listed once by netstat, which definitely is confusing, but it's just the way things are.

In other words, you should be troubleshooting under the assumption that Bitcoin is listening to both IPv4 and IPv6. (Bitcoin Core 0.9.3 will have a way to specify which IPs to bind to, which if used will disable this behavior.)

I don't know where the problem does lie, but it's not where you're looking right now....
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!