As we all know, IPv4 address space is already exhausted, many ISPs have deployed carrier grade NAT (CGN). So how could an LN node living behind NAT deal with NAT transversal problem? How could two NATed LN nodes communicate with each other?


IPv6 is still growing, so the problem described should be temporary - as in solved within 50 years. In the meantime, how about a portforwarding arrangment like this: Bob's LN node connects to his (ipv4) webserver on port 9736; Alice connects to Bob's webserver on port 9735; Bob's webserver sends inbound traffic on 9735 out 9736 and vice versa.


first of all if your lightning node sits behind a NAT it can still connect to other lightning nodes and also open channels with them. once you have channels you don't need a public IP address but your node id is enough. your channel partner and nat will solve the rest.

The problem is that your node behind a NAT does not have a public IP address. therefor you need to configure port forwarding in your NAT.

edit: Also you can run your lightning node behind a toronion to have a static address.

  • To my understanding, port forwarding configuration is not available for CGN users.
    – Chris Chen
    Feb 7 '19 at 1:19
  • There's another problem: on-chain funds are linked to IP address.
    – Chris Chen
    Feb 7 '19 at 1:21
  • No, on chain funds are not linked to ip addresses. No ip Address stored in the blockchain Feb 7 '19 at 10:05
  • But IP address and funding txid are published across the LN, isn't it?
    – Chris Chen
    Feb 8 '19 at 0:54
  • Only the funding txid and the nodeid but not the iPad dress of the node. The ip Adress is published at a different part of the protocol. That is why it is easy for the node to change its ip address for example if moved to a different server Feb 8 '19 at 9:11

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.