IDK anything about "routing" but I don't think it can solve this problem without additional services.
If my laptop is A and I want all outbound connections to go through server B then B needs to be running some kind of service whether it's merely a NAT router or VPN or proxy.
In this case OP actually want's B's outbound connections to go through A but it's the same problem.
Love that you put it in quotes as if to be sarcastic. Hilarious.
This is basically how the entire Internet works, but you know that from your post. Surely you also know that traffic gets "routed" from place A to B all the time without SSH as well.
So if you want to "route" a remote instance back to another place, you:
Set routing rules on the intended origin
Set default route on the remote client
Set restricted firewall rules so both the origin and client are allowed to talk to each other
Traffic is routed
Another alternative is using Tailscale and setting an exit node on your network, which is essentially the same thing.
But you already knew that, and that's why you chimed in with your comment. Stupid me.
I've been playing around with networks for decades. I'll happily admit that my understanding is rudimentary at best, but configuring routing rules with IP tables or whatever so your device will act as a NAT seems a few levels beyond "basic networking".
that's why you chimed in with your comment. Stupid me.
The honest to god reason I chimed in was because your response seemed derisive, and I thought I might be able to soften a bit by either showing my own ineptitude or challenging your solution.