Edit: Solution

Yeah, thanks to u/postnataldrip@lemmy.world I contacted my ISP and found out that in fact they were blocking my port forwarding capabilities. I gave them a call and I had to pay for a public IP address plan and now it’s just a matter of testing again. Thank you very much to everyone involved. I love you. It was Megacable by the way. If anyone from my country ever encounters the same problem I hope this post is useful to you.

Here’s the original post:

Hey!

Ok, so I’m trying to figure this internet thing out. I may be stupid, but I want to learn.

So, what I’m essentially doing is trying to host my own raw html website on my own hardware and get it out to the internet for everyone to see (temporarily of course, I don’t want to get in trouble with hackers and bots) I just want to cross that out of my bucket list.

What I’ve done so far:

  • I set up a qemu/kvm virtual machine with debian as my server
  • I configured a bridge so that it’s available to my local network
  • I got my raw html document
  • I’m serving it locally with nginx
  • I tried to set up port forwarding (I get stuck here)

Right now everyone in my home can see my ugly website if they go to 192.168.1.114:8080 (since I’m serving it through port 8080).

However, I want to be able to go outside (I’m testing it with my mobile network using mobile data) to see my website.

I’ve configured port forwarding on my ZTE router (ISP-issued) with the following parameters:

But now, if I search for my public IP address on my phone I don’t get anything. Even if I go to my.public.ip.address:8080 (did you think I was gon-give you my public ip?)

I don’t get anything. I’ve tried ping and curl. ping doesn´t even transmit the packages, curl says “Could not connect to server”.

So, If you guys would be so kind as to point me in the right direction, I pose the following questions :

  • How do I even diagnose this?
  • What am I missing?
  • Am I being too stupid?
  • What do I do now?

(Here’s a preview of my ugly website)

I also own a domain (with cloudflare) so, next step is getting that set-up with a DNS or something.

Thank youuuuuuu <3

  • alphakenny1@lemmy.world
    link
    fedilink
    English
    arrow-up
    3
    ·
    17 days ago

    2 potentials

    ISP blocking Web hosting ports/traffic - often opt Out or flat out blocked for residential connections.

    ISP using CGNAT so your “public ip” isn’t really public? But you got this far so i would guess you already know that.

    For reference, the cgnat “public ip range” should be 100.64.0.0 to 100.127.255.255

    If you do have cgnat i think maybe cloudflare tunnels, tailscale or a vps are your solutions.

    • KazuchijouNo@lemy.lolOP
      link
      fedilink
      English
      arrow-up
      3
      ·
      17 days ago

      Yes, it was the ISP, I gave them a call and now I have a public ip address.

      I, however, would like to learn more about cloudflare tunnels, tailscale, and vps for security reasons. Once I set my first foot on the internet, I would like to find a more permanent solution so that my ugly website may be suffered by many.

      If you have any resources on VPNs (I’m considering wireguard) or Cloudflare tunnels, I’d appreciate it.

      • Technikus5@feddit.org
        link
        fedilink
        English
        arrow-up
        4
        ·
        17 days ago

        I was in your shoes a few years ago, so I think I can give at least some insights: Regarding VPNs, Tailscale is based on Wireguard, but makes configuration a whole lot easier, especially if you have devices with changing addresses. You do still need an account with them, but from there you simply install tailscale on every device you want to access via your VPN, and they should automatically get assigned IP addresses (100.x.x.x). Entering this assigned IP from any other device connected to your Tailscale network will give you a direct connection between the two. With a bit of fiddling you can also enable subnet forwarding, allowing you to for example connect to devices on your home network that don’t support installing software on them, but at least for your current setup I don’t think that’s necessary. It is fun to play around with though, and opens up a whole new world of possibilities. I use it to remotely manage my parent’s Router for example, since merlin-wrt and many managed switches don’t easily support additional software.

        Cloudflare Tunnels are Kind of similar to a VPN, only that you don’t connect your own devices with eachother, but instead connect your server(s) directly to cloudflare, who then take over the task of actually getting your data on the internet. The advantage of this is that you technically don’t even need a public IP address, since any requests and answers will be forwarded through the “VPN”, and only cloudflare needs to be publically accessible. This does require you to buy a Domain though, since that is what the forwarding will be based on. In the same vein, but if you want to do things “more manually”, I’d also recommend you look into Reverse proxying, if you haven’t already. That’s basically what turns “site1.example.com” and “site2.example.com” into different requests, usually to different IPs and/or Ports on your private network, allowing you to have multiple things running under one domain. Personally I use the “Nginx Proxy Manager” running in a Docker Container for this, mainly because it’s nice and easy to get your head around, but there are several newer Options like Traefik or Caddy that I also want to look into at some point.

        After this wall of text, I hope you have fun playing around with all of this stuff, I know I had, and I really learned a lot about networks and the internet in general. Oh, and don’t be too stubborn to completely start from scratch occasionally, sometimes it’s just the easiest solution…

        • KazuchijouNo@lemy.lolOP
          link
          fedilink
          English
          arrow-up
          2
          ·
          16 days ago

          Thank you so much! This has been the most illustrative wall of text.

          And you’re right, I might be a bit stubborn on wanting to learn things from scratch. I’ll be looking into Tailscale and Cloudflare tunnels. I was trying to mess around with wireguard, but I’m a bit lost and I don’t know how to configure iptables. I followed a video on youtube but so far managed to create a vpn within my local network (which I can’t access outside).

          I’m also interested in nginx reverse proxy, but I don’t know where to start, I know I need docker, but I haven’t had a burning passion to learn docker yet (I may be a silly goose).

          There are a lot of possibilities, but I’d like a starting point. Something that will teach me the most, but that won’t be holding my hand too much.

          I really appreciate your comment, I shall keep thy wisdom for my future endeavors.

      • sem@lemmy.blahaj.zone
        link
        fedilink
        English
        arrow-up
        2
        ·
        16 days ago

        If you are looking for a vps to host your website, may I recommend Google cloud platform free tier? You have to give a credit card, and occasionally it messes up and charges $0.01 a month, but it’s pretty good.