Why satoshi client's UPnP part maps to a fixed external port (8333 by default)? If there are multiple clients behind the NAT router, won't there be a conflict?

  • Doesn't a router route to specific ip addresses? So multiple clients behind a router won't be a problem unless they have conflicting ip addresses. – John T Feb 12 '14 at 6:08
  • They have different internal IP, but may have the same external IP. – updogliu Feb 12 '14 at 6:16
  • A router runs connection tracking software to make sure all connected in the network get differentiated. – John T Feb 12 '14 at 6:23
  • I don't understand. If a peer from outside want to connect (external_ip, 8333), how can the router tell which internal ip should it forward to? – updogliu Feb 12 '14 at 6:31
  • It's a long Wikipedia article on how exactly it's done but it's done in the same way you can browse (port 80) on the internet on two computer without loading pages another computer loads. – John T Feb 12 '14 at 6:54

A fixed external port is used so that other clients on the internet can connect to your client by knowing only your IP address. They will use the fixed port number to connect.

If you have multiple clients behind a NAT device, then only one client will be able to negotiate with the NAT device to listen on port 8333 (and have incoming connections translated to its client address).

Note that the above assumes the clients actually are behind a NAT devices (which is very common, especially in home networking setups). If instead the router is really just a router and not a NAT device, then each client behind the router will have its own public IP address, and there won't be any conflict between more than one of them listening at the same time on port 8333.

  • Is there a viable solution for having multiple clients behind the same NAT? Can the satoshi client peer advertise itself with another port if required? – LordOfThePigs Feb 12 '14 at 12:47
  • 1
    @LordOfThePigs Yes, you can change the listen port. Specify 'port=nnnnn' in bitcoin.conf to use another port. – ScripterRon Feb 12 '14 at 15:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.