Setting up hybrid-mode - my experiences

To set up hybrid-mode I started following this guide:

https://github.com/blckbx/lnd-hybrid-mode

This guide is well written and should be easy enough to follow. Nonetheless it took me quite a while to make hybrid-mode work. The hardest part for me was to get Dynamic DNS working because I had difficulties to understand the concept. Port forwarding was also quite time consuming. That’s why I decided to summarize the detailed steps that worked for me. Maybe it is helpful for other plebs.

1. Firewall ufw install and activate

Here is an easy-to-follow guide:

https://raspibolt.org/guide/raspberry-pi/security.html#enabling-the-uncomplicated-firewall

Note : it is important to allow SSH before you enable ufw! On my first attempt following this guide I managed to block myself and I had to reflash my SD-card to get access to my node via SSH again.

With user “admin”, configure and enable the firewall rules:

sudo apt install ufw
sudo ufw default deny incoming
sudo ufw default allow outgoing
sudo ufw allow SSH
sudo ufw logging off
sudo ufw enable
sudo ufw status

Make sure that the UFW is started automatically on boot

$ sudo systemctl enable ufw

image

Note : I got an error here but later I recognized that ufw starts automatically anyway.

Check Existing App Rules

To see a list of the applications where the firewall has rules, use:

sudo ufw app list

You can check for the ports that are open for those rules with.

sudo ufw app info SSH

image

Lnd needs port 9735 open, so we put it to the list:

sudo ufw allow 9735
sudo ufw enable
umbrel@umbrel:~ $ sudo ufw status
Status: active

To Action From
-- ------ ----
SSH ALLOW Anywhere
9735 ALLOW Anywhere
SSH (v6) ALLOW Anywhere (v6)
9735 (v6) ALLOW Anywhere (v6)

2. create a router forwarding rule for port 9735

Here is a German guide I followed:

the video: https://www.youtube.com/watch?v=BCVCYR1wJpc

and here is an English guide:

https://www.edpnet.be/en/support/installation-and-usage/internet/manage-fritz!box/how-to-set-up-a-port-forwarding-on-a-fritzbox.html

These the setting that finally worked with my Technicolor Router:

Gateway > Advanced > Forwarding > Create IPv4:

Portfreigabe9735

Note : it took me some time to figure out what to put in the external IP Address field. Obviously, it is not the own external IP Address but all incoming (0.0.0.0)

Check if port 9735 is open using a service:

https://ping.eu/ or https://portchecker.co/

3. configure Dynamic DNS (DDNS)

Dynamic DNS (DDNS) is a method of automatically updating a name server in the Domain Name System (DNS), often in real time, with the active DDNS configuration of its configured hostnames, addresses or other information. (src)

(A nice description but unfortunately zero understandable for all non-IT professionals)

Since my router offers several managed DDNS providers I decided to go that way and chose https://www.duckdns.org/

Router > Gateway > Network > DDNS:

duckdns.org

It took me a while to grasp the concept of dynamic DNS e.g. how the service provider keeps knowing my IP address once I left the web site? What I finally understood is this:

When you register with duckdns.org (or services alike) you get either a token or username/password and you can now register a sub domain. Once your router is properly configured with a DDNS service the router actively informs the DDNS service provider when the IP address changes.

By adding the line externalhosts:9735=xxxxx.duckdns.org to your lnd.conf the lightning node now gets the IP address from the service provider. Remember to replace xxxxx.duckdns.org with the registered host name and the service of your choice.

Please comment if this explanation is not correct or incomplete.

Last step is to update lnd.conf accordingly

First things first → back up your lnd.conf before making any changes!

[Application Options]
...
# set the registered DDNS domain
externalhosts=xxxxx.duckdns.org:9735

[tor]
tor.active=true
tor.v3=true
# deactivate streamisolation for hybrid-mode
tor.streamisolation=false
# activate hybrid connectivity
tor.skip-proxy-for-clearnet-targets=true

After restarting LND, it is now offering two addresses (URIs). These can be verified either by calling lncli getinfo:

"uris": [
"<my-pubkey>@<my-onion-address>.onion:9735",
"<my-pubkey>@93.18x.xxx.xxx:9735"
],

You can also check with amboss.space whether the new Address is shown besides the Tor Address: https://amboss.space/node/

amboss.space_address

The new address here does not mean that it is working. We still need to check the functionality.

Check functionality

I am sure the lightning experts know a lot of ways to check the functionality of a Clearnet IP-address. You can ask a fellow pleb to run lncli connect from his or her node.

This is the response when the connection was successful:

*$ lncli connect <my pubkey>@93.18x.xxx.xxx:9735*
*{*

*}*

And this is the response when the connection failed:

*$ lncli connect <my pubkey>@93.18x.xxx.xxx:9735*

*[lncli] rpc error: code = Unknown desc = dial proxy failed: dial tcp 93.18x.xxx.xxx:9735: i/o timeout*

In case it fails on first attempt don’t worry and doublecheck all the steps again :blush:

1 Like

@thool thanks for this great primer – two questions…

  1. can you clarify the convention using “externalhosts=” ? The text says one thing (externalhosts:9735=xxxxx.duckdns.org) and the sample code is different (externalhosts:9735=xxxxx.duckdns.org).

  2. if my new DNS is abc.org, to I just use abc.org:9735

Thanks!! S.