从外部IP连接Google Compute Engine上的Bitcoin Core失败求助
Let's break down the potential issues and actionable fixes for your two connection problems:
1. First, Rule Out Google Cloud VPC Firewall Restrictions
Even if you disabled the Windows Server local firewall, Google Compute Engine has a separate VPC-level firewall that blocks incoming traffic by default—this is the most common overlooked step here:
- Go to your GCE Console, navigate to VPC Network > Firewall.
- Create a new ingress rule (or edit an existing one) with these settings:
- Targets: Select your specific VM instance
- Source IP ranges: Either
192.185.35.200/32(to allow only your Hostgator server) or0.0.0.0/0(if you need to allow all external IPs) - Protocols and ports: Check tcp and enter
8332
- Save the rule and wait 1-2 minutes for it to propagate.
2. Fix Bitcoin Core Configuration File Issues
Your current config has syntax gaps and missing settings that could block external connections:
Correct Syntax Errors
The rpcallowip entry should not contain spaces around the equals sign. Update your bitcoin.conf to:
deprecatedrpc=1 dbcache=1000 txindex=1 server=1 rpcuser=myusername rpcpassword=mypassword rpcport=8332 rpcallowip=192.185.35.200 # No spaces before/after =
Add rpcbind to Allow External Connections
By default, Bitcoin Core only binds the RPC server to 127.0.0.1 (localhost), so it won't accept connections from external IPs even if ports are open. Add this line to your config:
rpcbind=0.0.0.0 # Binds to all network interfaces on the VM
Restart Bitcoin Core
After making these changes, fully shut down and restart Bitcoin Core—config updates won't take effect until the service is restarted.
3. Verify Connectivity with Diagnostic Tools
On your Hostgator server, run these commands to test if the port is reachable:
For Windows Hostgator Servers (PowerShell)
Test-NetConnection 35.195.0.35 -Port 8332
Look for TcpTestSucceeded : True in the output. If this is False, the issue is still network-related (double-check your GCE firewall rules).
For Linux Hostgator Servers
telnet 35.195.0.35 8332
A blank screen means the port is open; a "connection refused" message confirms the port is still blocked at the network level.
4. Check Bitcoin Core Logs for Detailed Errors
Open the debug.log file in your Bitcoin Core data directory (usually %APPDATA%\Bitcoin\debug.log on Windows) and look for these common error entries:
RPC connection from 192.185.35.200 rejected→ Indicatesrpcallowipis misconfiguredRPC authentication failed→ Double-check that yourrpcuserandrpcpasswordmatch what you're using in your connection requestBinding RPC on address 0.0.0.0 port 8332 failed→ Port 8332 might be used by another service on your Windows VM
5. Final Checks
- Confirm your GCE VM's external IP is static (not ephemeral)—if it changed, your connection target will be invalid.
- On Windows Server, ensure no third-party security software (like advanced antivirus tools) is blocking port 8332.
内容的提问来源于stack exchange,提问作者Ola Fashade Samson

