I’m pretty new to selfhosting and homelabs, and I would appreciate a simple-worded explanation here. Details are always welcome!

So, I have a home network with a dynamic external IP address. I already have my Synology NAS exposed to the Internet with DDNS - this was done using the interface, so didn’t require much technical knowledge.

Now, I would like to add another server (currently testing with Raspberry Pi) in the same LAN that would also be externally reachable, either through a subdomain (preferable), or through specific ports. How do I go about it?

P.S. Apparently, what I’ve tried on the router does work, it’s just that my NAS was sitting in the DMZ. Now it works!

  • towerful@programming.dev
    link
    fedilink
    English
    arrow-up
    8
    ·
    13 hours ago

    Who is externally reaching these servers?
    Joe public? Or just you and people you trust?

    If it’s Joe public, I wouldn’t have the entry point on my home network (I might VPS tunnel, or just VPS host it).

    If it’s just me and people I trust, I would use VPN for access, as opposed to exposing all these services publicly

    • AlleroOP
      link
      fedilink
      English
      arrow-up
      3
      ·
      13 hours ago

      Just me and the people I trust, but there are certain inconveniences around using VPN for access.

      First, I live in the jurisdiction that is heavily restrictive, so VPN is commonly in use to bypass censorship

      Second, I sometimes access my data from computers I trust but can’t install VPN clients on

      Third, I share my NAS resources with my family, and getting my mom to use a VPN every time she syncs her photos is near impossible

      So, fully recognizing the risks, I feel like I have to expose a lot of my services.

      • somewa@suppo.fi
        link
        fedilink
        English
        arrow-up
        2
        arrow-down
        1
        ·
        6 hours ago

        Remember that with services facing public internet it’s not about if you get hacked but when you get hacked. It’s personal photos on someone elses hands then.

        • AlleroOP
          link
          fedilink
          English
          arrow-up
          1
          ·
          4 hours ago

          I do remember that and take quite a few precautions. Also, nothing that can be serioisly used against me is in there.

          • hietsu@sopuli.xyz
            link
            fedilink
            English
            arrow-up
            1
            ·
            16 minutes ago

            I have wrestled with the same thing as you and I think nginx reverse proxy and subdomains are reasonably good solution:

            • nothing answers from www.mydomain.com or mydomain.com or ip:port.
            • I have subdomains like service.mydomain.com and letsencrypt gives them certs.
            • some services even use a dir, so only service.mydomain.com/something will get you there but nothing else.
            • keep the services updated and using good passwords & non-default usernames.
            • Planned: instant IP ban to anything that touches port 80/443 without using proper subdomain (whitelisting letsencrypt ofc), same with ssh port and other commonly scanner ones. Using fail2ban reading nginx logs for example.
            • Planned: geofencing some ip ranges, auto-updating from public botnet lists.
            • Planned: wildcard TLS cert (*.mydomain.com) so that the subdomains are not listed anywhere maybe even Cloudflare tunnel with this.

            Only fault I’ve discovered are some public ledgers of TLS certs, where the certs given by letsencrypt spill out those semi-secret subdomains to the world. I seem to get very little to no bots knocking my services though so maybe those are not being scraped that much.

        • thermal_shock@lemmy.world
          link
          fedilink
          English
          arrow-up
          1
          ·
          5 hours ago

          Not sure why you’re downvote, you’re absolutely right. People scan for open ports all day long and will eventually find your shit and try to break in. In my work environment, I see thousands of login attempts daily on brand new accounts, just because something discovered they exist and want to check it out.

    • Justin@lemmy.jlh.name
      link
      fedilink
      English
      arrow-up
      2
      ·
      12 hours ago

      Your stuff is more likely to get scanned sitting in a VPS with no firewall than behind a firewall on a home network