Setting up a Bitcoin node on a different port

4 replies 334 views
Posts: 18 · Reputation: 163
#1Feb 21, 2025, 05:59 AM
I’m looking to set up a full Bitcoin node and really want to contribute by sharing blocks and transactions with others. I’m not just interested in downloading data from other nodes. The issue is I need my node to be accessible to others, but since I'm behind a NAT, I can’t do port forwarding. I could use a VPN, but it would only let me use non-standard ports. With other P2P networks, I can just tweak the port settings and still be reachable by all nodes. If I set up my Bitcoin node to run on a non-standard port, will it still be reachable by other nodes? I’ve seen some info here that suggests it might work, but I’d like to hear from some experts about it.
4 Reply Quote Share
humbleledgerLegendary
Posts: 1027 · Reputation: 6554
#2Feb 21, 2025, 10:29 AM
As far as I know, this should work. Bitcoin Core doesn't just scan random IP-addresses with the default port, so I assume it gets your node information from other nodes you're connected to. It wouldn't make sense to not include your port with that. As an alternative, you can run your own VPN on a VPS. That gives you your own IP address and all the ports you want.
3 Reply Quote Share
im_apeHero Member
Posts: 629 · Reputation: 3824
#3Feb 21, 2025, 04:06 PM
On Bitcoin's P2P network only when you dig the DNS seeds during the first time you connect to the network, you get IP addresses alone and connect to them using the default port, since that's the port they all use. But after the initial connection, each peer would advertise itself using the addr message which will contain both their IP address and the port they are listening to and that's what others would use to connect to them. So if you use a different port than the default and you have an open socket listening for incoming connections, your node will advertise itself using that exact port.
5 Reply Quote Share
hash_bossLegendary
Posts: 1166 · Reputation: 5261
#4Feb 21, 2025, 10:07 PM
For additional information, your node still share (as in upload) block and TX data even if your node unable to accept incoming connection. Although in such case, usually you'd share/upload less data. That's unusual, people and software usually consider port 1023 and lower as standard or well-known ports.
2 Reply Quote Share
paul2017Senior Member
Posts: 218 · Reputation: 1426
#5Feb 22, 2025, 09:05 PM
There is nothing special about the default port except that it is the default. In order for other nodes to find your node, your node connects to other nodes and broadcasts its address and port. I run several nodes on the same local network for development purposes, so I am forced to use non-default ports and external nodes are able to connect to them.
4 Reply Quote Share

Related topics