I'm currently running one Samba server open to the internet (yes I know, bad idea but using encryption, SMB3 etc) behind a dynamic DNS (let's call it myhomesmb.net). I'm looking at starting a second Samba server on a different machine but I'd like to be able to access it externally without the use of a VPN so using the same route as the 1st samba server.
Is there any way to do this? Like a reverse samba proxy? Basically like to smb://myhomesmb.net/server1 for server 1 and smb://myhomesmb.net/server2 for server 2.
Yes I know it's pretty stupid and there are much better ways to do this but I'd like to give it a shot before setting up something proper when I get the time.
Running Ubuntu 20.04, SMB3 on both servers, on the same NAT, behind the same router gateway with ports 445 and 139 open to a dynamic DNS address.
Thanks!
for name in {server1,external{1,2}} ; do wg genkey > ${name}.priv ; wg pubkey < ${name}.priv > ${name}.pub; doneto generate private and public keys for your server1 and two external clients (you'll guess how you can make more!), and write a really minimal wireguard config in /etc/wireguard/, which allows the two external public keys, gives them addresses fromEndpointwith the server1.pub asPublicKey. And tada, now you have a private network in which all your servers and external clients are, no further setup needed, no proxying, no security danger; you can at that point close the port forwarding on your NAT router. It's honestly easier than taming samba :)