[c-lightning] possible to run lightning behind NAT

Yubin Ruan ablacktshirt at gmail.com
Mon Apr 2 20:50:59 AEST 2018


On Mon, Apr 02, 2018 at 03:38:55AM -0400, ZmnSCPxj wrote:
> Good morning Yubin,
> 
> C-lightning attempts to find a way to get the port forwarded behind NAT, but
> this does not always work.  Making this work may vary depending on how your
> local network is set up, and also, how your ISP provides internet access; in
> some third-world countries, ISPs charge extra for the privilege of getting a
> public IP address, and, might deliberately, specifically not support IPv6
> which should have made it possible for everybody to get a public IP address
> cheaply.
> 
> We have a pull request pending review that adds support for contacting and
> being a TOR onion service.  TOR onion services can automatically forward
> from behind NAT (i.e. TOR has NAT punch-through due to how it is
> constructed), at the price of increased latency for communications (i.e.
> slower hops to/from you).  You could try helping review the pull request
> https://github.com/ElementsProject/lightning/pull/1175 if running a TOR
> onion service is feasible for you.
> 
> (NAT punch-through requires a turn-around server outside the NAT; TOR relay
> nodes automatically serve as turn-around servers for TOR onion services,
> letting TOR punch through NATs. Duplicating that service is duplicating that
> work, especially since the Lightning protocol itself deliberately supports
> TOR addresses to provide privacy and NAT punch-through, so we might as well
> wait for TOR onion service support to get into c-lightning)

I used testnet to test the functionality of C-lightning. I generated an
address by 

    $ lightning-cli newaddr 
    
and transfered some bitcoin to that address by

    $ bitcoin-cli -testnet sendtoaddress <address> <amount_in_bitcoins>

After this I could see in my bitcoin-qt client that this transaction had been
confirmed (by 10+ confirmation). However when I used

    $ lightning-cli listfunds

to list the funds I still see no fund. Will that be caused by the NAT issue?
(and FYI, lightningd keep syncing after I did

    $ lightningd --network=testnet --log-level=debug

now it has reached "Adding block 64500+...".

Yubin


More information about the c-lightning mailing list