windowspowershellwindows-subsystem-for-linuxportforwardingsmb

How to mount a smb network share with different port on windows


I tried to mount a smb network share on Windows over the internet, but I have encountered several problems. First of all my setup was a raspberry pi running samba in my local network and everything has worked fine. So I decided to create another user for public file sharing between me and an association of musicans.

My first try was to forward port 445 to my pi and try to connect over the internet with the help of a dynamic dns service, but the most ISP block this port.

My next idea was to use a different port over 1000 an after forwarding the tcp of that to my pi I could successfully test the connection in Windows ps with a command like the following for my setup e.g. port.

Test-NetConnection mysubdomain.dns.army -Port 1999

Now there was still a problem Windows was not able to connect to an share that use a different port then 445.

So how can I solve this problem by using more or less native Windows tools and scripts?


Solution

  • As I found out that my workaround solution has a very unstable connection, I have written a small application, that solves this problem for me:

    SMBrowser1.0.zip