Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: plogank on September 22, 2015, 12:56:27 AM



Title: Two Full Nodes, Same Router
Post by: plogank on September 22, 2015, 12:56:27 AM
It appears that in order to run a full node port 8333 must be forwarded to that computer.  However, I have two computer on the same router and I would like to run two full nodes. My router won't allow me to forward 8333 to the second computer. What must I do to get that second node up?

I'm running Bitcoin Core version v0.11.0 (64-bit).

Thanks.


Title: Re: Two Full Nodes, Same Router
Post by: achow101 on September 22, 2015, 01:20:02 AM
It appears that in order to run a full node port 8333 must be forwarded to that computer.  However, I have two computer on the same router and I would like to run two full nodes. My router won't allow me to forward 8333 to the second computer. What must I do to get that second node up?

I'm running Bitcoin Core version v0.11.0 (64-bit).

Thanks.

Run it with a different port. You can either set your node to use a different port in the bitcoin.conf file and have the router forward that new port or you can keep the same 8333 port on that computer and set up your router to forward a different port number on the router to port 8333 on the computer.


Title: Re: Two Full Nodes, Same Router
Post by: gmaxwell on September 22, 2015, 01:20:49 AM
It appears that in order to run a full node port 8333 must be forwarded to that computer.
Not so.

Wouldn't it be nice if all problems were this easily solved. :)


Title: Re: Two Full Nodes, Same Router
Post by: TierNolan on September 22, 2015, 09:02:04 AM
.... or you can keep the same 8333 port on that computer and set up your router to forward a different port number on the router to port 8333 on the computer.

I am not sure that would work.  A full node broadcasts the port it uses, so the node needs to know its global internet port.  Having the router remap the port will mean that nobody will be able to connect to the 2nd node, since it will claim to use port 8333.


Title: Re: Two Full Nodes, Same Router
Post by: spin on September 22, 2015, 09:58:00 AM
If you want both available to the internet:
Why not change the default port configured in bitcoin.conf on the second node to something else.  Say 9333.  Then on your router fw 8333 to the existing node and 9333 to the second node.  That way the second node will "know" its port is 9333 and also advertise it correctly.  

Personally I'd just keep one node available on internet and set the second node to -connect or -addnode (also in bitcoin.conf) to the existing node.  Should save some bandwidth and resources.  With this the second node will download off the existing node exclusively or mainly (depending on connect/add respectively).



Title: Re: Two Full Nodes, Same Router
Post by: achow101 on September 22, 2015, 11:43:48 AM
.... or you can keep the same 8333 port on that computer and set up your router to forward a different port number on the router to port 8333 on the computer.

I am not sure that would work.  A full node broadcasts the port it uses, so the node needs to know its global internet port.  Having the router remap the port will mean that nobody will be able to connect to the 2nd node, since it will claim to use port 8333.
Wouldn't it just not accept incoming connections?


Title: Re: Two Full Nodes, Same Router
Post by: shorena on September 22, 2015, 11:48:59 AM
.... or you can keep the same 8333 port on that computer and set up your router to forward a different port number on the router to port 8333 on the computer.

I am not sure that would work.  A full node broadcasts the port it uses, so the node needs to know its global internet port.  Having the router remap the port will mean that nobody will be able to connect to the 2nd node, since it will claim to use port 8333.

Besides these rules are usually 1st match, thus everything that comes in on port 8333 would be handled the same, regardless of a different later rule.

It appears that in order to run a full node port 8333 must be forwarded to that computer.
Not so.

Wouldn't it be nice if all problems were this easily solved. :)


To expand a little on this. You dont need to allow outside connections to run a full node. A full node that only uses the 8 outgoing connections that you get when you dont open and forward the port is still a full node.

The question I come up with is, why?

If node #1 is connected well to the internet, just let node #2 connect to node #1 locally. What is the benefit of you offering a service twice on the same IP? The nodes would compete for the bandwidth and unless the machines are very old would not max out alone anyway.

.... or you can keep the same 8333 port on that computer and set up your router to forward a different port number on the router to port 8333 on the computer.

I am not sure that would work.  A full node broadcasts the port it uses, so the node needs to know its global internet port.  Having the router remap the port will mean that nobody will be able to connect to the 2nd node, since it will claim to use port 8333.
Wouldn't it just not accept incoming connections?

If thats the result, why bother with a complex setup at all?


Title: Re: Two Full Nodes, Same Router
Post by: David Rabahy on September 25, 2015, 05:30:18 PM
If/when one node is down then the other can remain available.


Title: Re: Two Full Nodes, Same Router
Post by: mookid on September 25, 2015, 10:04:01 PM
It would also help if set your two nodes on separate public IPs. If you are behind a router, it would NAT your external IP and your two nodes would use the same public IP address.