This is an interesting solution and wouldn't mind using one of my existing servers as a gateway or proxy (?). Is there a way to be selective about what ports are exposed from the host to the target? The target could handle it but fine grained control is nice.
You could just set a default deny iptables policy for forwarding to that host, and then explicitly open the ports you want
Locally hosting an internet-connected server
21–30 of 183 posts
Re: Locally hosting an internet-connected server
#22you can also run a proxy on the vps instead of the nat.
Depends on the protocol. For web, sure - for ssh, nope, since the protocol doesn't indicate which machine it's trying to connect to and so you don't know where to proxy it to.
Certain UDP-based protocols may be hairier, though.
Re: Locally hosting an internet-connected server
#23Why not use a dynamic DNS service instead? I’ve been using dyn.com (now oci.dyn.com) for years and it has worked great. A bonus is many home routers have support built in.
Only works if you're not behind CGNAT, which has problems in and of itself. I pay my ISP an extra 29 DKK (about 4.50 USD at the moment) for a static address; my IPv4 connections and downloads in-general became way more stable after getting out from behind CGNAT.
Re: Locally hosting an internet-connected server
#24Then doing straight-forward iptables or L7, or reverse proxy via Caddy, Nginx, etc, directly to the routable IP address.
The outcome is the ~same, bonus is not having to handle the lower level component, negative is an extra "thing" to manage.
But this is how I do the same thing, and i'm quite happy with the result. I can also trivially add additional devices, and even use it for egress, giving me a good pool of exit-IP addresses.
(Note, I was going to add this as a comment on the blog, but it seems their captcha service is broken would not display - so it was blocked)
Re: Locally hosting an internet-connected server
#25Earlier quoted context omitted.
You can port forward SSH to other internal machines, just like nginx + web.
I can port forward port 22 to a single machine. I can't proxy port 22 in a way that directs the incoming connection to the correct machine, at least not without client configuration.
Re: Locally hosting an internet-connected server
#26Earlier quoted context omitted.
I can port forward port 22 to a single machine. I can't proxy port 22 in a way that directs the incoming connection to the correct machine, at least not without client configuration.
You only need one inbound machine as your bastion. Then hop from there to the rest using local address. Once you set up the proxy config in ssh it’s completely transparent.
Re: Locally hosting an internet-connected server
#27I think I've seen some scripts floating around to automate this process but can't remember where. There are lots of good related tools listed here: https://github.com/anderspitman/awesome-tunneling
Re: Locally hosting an internet-connected server
#28Re: Locally hosting an internet-connected server
#29One of the biggest ISPs in my country has been promising IPv6 since 2016. Another, smaller, competitor, advertised on "World IPv6 Day" in 2011 that it was way ahead of the competition on supplying IPv6; but in fact does not supply it today.
One of the answers I see given a lot over the years is: Yes, I know that I could do this simply with IPv6. But ISPs around here don't route IPv6, or even formally provide statically-assigned IPv4 to non-business customers. So I have had to build this Heath Robinson contraption instead.
Re: Locally hosting an internet-connected server
#30This and the comments highlight how bad many ISPs in North America and Western Europe are at IPv6, still , in 2025, and the lengths to which people will go to treat that as damage and literally route around it. One of the biggest ISPs in my country has been promising IPv6 since 2016. Another, smaller, competitor, advertised on "World IPv6 Day" in 2011 that it was way ahead of the competition on supplying IPv6; but in…