I'm connected via a 4G modem. Got this setup about 3 years ago. In the beginning it was enough to look for the public IP (what's my IP). The modem showed some sort of private ip in the ui. I'm running stuff at home (Homeassistant, Gitea,) and bought a domain and pointed it to my home IP via Cloudflare. After some time I've noticed my modem shows the public IP also internally. For about 2 years now it ran flawlessly, the IP changed from time to time, but not really more than once in several weeks.
For about a week all stopped working and the modem shows IP 100.xxxx and outside 85.something
I guess I'm behind NAT now.
Normal port forwarding on the modem is useless now.
Is it possible to open the ports via UPNP? I've tried via miniupnp from my Ubuntu server, but it just throws an error.
You're already using cloudflare, so check out cloudflare tunnels. You install their software on your server which makes an outbound connection, bypassing the need for open ports or a public IP. Note this only does http traffic.
Another option is tail scale, which won't make your site public but will let you access it remotely on devices you have their software/app on.
A solid workaround is an ssh reverse tunnel with gateway ports enabled. You can do it for pennies with a cheap VPS.
With this option you open an ssh tunnel outbound and then you can connect back through it from the other side for whatever local services you want to run.
Just remember to enable gateway ports in the VPS side sshd.conf and disable or adjust any firewall on the VPS so the internet can come in through the VPS ip address and tunnel back to your local system.
Have you reached out to your ISP to see if they can give you a dynamic public IP? I recently swapped to a new ISP that was using CGNAT but after contacting their support team with my use case, they were happy to set me up with a public IP so I could continue my self-hosting.
Buy a cheap VPS, setup a Wireguard or OpenVPN server (wg-easy is quite nice). Then something like Nginx Proxy Manager or plain nginx and expose your services over that.
Edit: if you need help, hit me up, love sharing my knowledge
I use a VPN that I setup on an Oracle free tier VPS when I need to access my stuff over IPv4. I also have IPv6, so I can connect directly when using 5G on my phone.