Hey, thanks for all the replies.
Tor is an alternative and quite a good one for running a lightning service (some wallets enforce its use). I don't think it matters too much if you're running a node connected via a hidden service or one on clearnet - you don't need as much firewall configurations to use tor in my experience anyway.
I am using Tor now and it took some time, but I have inbound connections now. I also have been running i2p for a while but I think I never had any connection using I2P ever. I guess not many nodes run on I2P? Or I need a seed node?
But there is no workaround for clearnet?
One possible workaround is using VPN which offer port forwarding feature.
Ah, I guess that's where services like
https://tunnelsats.com/ come into play? I guess I could create my own VPN with my VPS using WireGuard?
Running a Bitcoin node on a home network with a dynamic IP address can be challenging, as the IP address of the node will change over time. This can disrupt inbound connections to the node, making it difficult for other nodes on the network to connect to it.
One solution to this problem is to use a Dynamic DNS service, which allows you to use a hostname (e.g. "mynode.dyndns.org") to refer to your node's IP address, even if the IP address changes over time. The hostname can then be used in the externalip setting in your Bitcoin configuration file, so that other nodes on the network can connect to your node using the hostname.
Another solution is to use a Virtual Private Server (VPS) with a static IP address as a proxy for your home node. In this setup, you can use ssh tunnels to forward traffic between your home node and the VPS. This allows other nodes on the network to connect to your home node via the VPS, using the static IP address of the VPS.
Running Bitcoin over the Tor network is another option that could allow for uninterrupted inbound connections to your node. In this setup, your node would be accessible via a hidden service on the Tor network, which would provide a stable address that other nodes can use to connect to your node.
Overall, there are several solutions to the problem of running a Bitcoin node with a dynamic IP address. Each solution has its own advantages and disadvantages, and the best option for you will depend on your specific situation and requirements.
TBH, that sounds like a ChatGPT response, haha. Interesting times we live in.
Regarding Dynamic DNS: I already tried that and as others pointed out, a node advertises IP addresses, not hostnames. So this doesn't work.
Regarding VPS: I tried this but I couldn't get inbound connections to work. Do you have a guide for that? I used `ssh -D` for outbound connections and `ssh -R` for inbound connections but that didn't work as described in my initial post:
Then I thought I could use my virtual private server as a proxy since it has a static IP. I thought this could work using `ssh -D 8330 vps` for outbound connections and `ssh -R 8333:localhost:8330 vps` for inbound connections.
But no inbound connections are made.
I cannot find it now, but I remember some time ago there was a quite similar question, OP had problems with shared IP.
The problem was that his IP provider had a very limited pool of IP addresses and several customers where using the same IP, therefore there was no way to use port forwarding. You should check if it is not the case in your situation.
My port forwarding works since I do get inbound connections when I restart my node. Only when my public IP changes, the inbound connections are lost and for some reason, no inbound connections appear again until I restart my node. Shouldn't I at least get new inbound connections after some time?
Does your IP address change during the day, or only when you reset your modem?
Either way: have you tested it? I'm pretty sure the network can handle it if your IP goes offline, nodes will just continue with their other connections and eventually find your new IP again.
Yes, I tested it. I have been monitoring my public IP using a custom script and after every public IP change, all inbound connections were dropped. However, my IP was never found again.
I think I waited for at least a day once but nothing. I also thought my new IP should be eventually found but this does not seem to be the case. Maybe I have to dig into the code to understand this better. Wanted to do this anyway sometime, haha
One solution to this problem is to use a Dynamic DNS service, which allows you to use a hostname (e.g. "mynode.dyndns.org") to refer to your node's IP address, even if the IP address changes over time. The hostname can then be used in the externalip setting in your Bitcoin configuration file, so that other nodes on the network can connect to your node using the hostname.
Last time I tried it (in v21), Bitcoin Code did not support using hostnames for node addresses. And there is no DNS code in Bitcoin Core at all, all of that is actually in a separate, independent program called dnsseed. So how is this possible?
The simple answer is that it is not possible
The right way to fix your issue is with NO-IP
https://www.noip.com/Remember to configure your PC in the modem as DMZ, that way you will allow any call from WAN, that's the right way to do it, but you should have in mind that now anyone can try to access your server, so, before opening it to the WAN you should learn about some secure ways to protect your server.
Isn't NO-IP the same as a DynDNS service? So this will not work since bitcoin does not advertise hostnames?
So I think my only viable solution here is to (also) continue using Tor or look into a VPN solution.