Make a portproxy on Windows with a virtual adapter (loopback) to redirect port
View step-by-step (in pt-BR but with images by step)
https://apolonioserafim.blogspot.com/2021/05/acessar-servidor-samba-em-porta.html
Transposed:
ACCESS SAMBA SERVER IN CUSTOM PORT / REDIRECT PORT - IPV4 PROXY PORT WITH NETSH
If you need to access SMB 445 with a custom port
Run the wizard to add Hardware (Windows + R) hdwwiz.exe
Select "Install the hardware manually from a list (advanced)" then click Next to continue
In the list select "Network adapters" then click Next to continue
In the list on the left side select Microsoft
In the list on the right hand side select Microsoft Loopback Adapter then click Next to continue
At the end click Next and the interface will be installed
To rename, go in settings and select Internet Protocol Version 4 (TCP/IPv4) Then click Properties
Set any IP, just not the same IP range as your current network to avoid any IP conflict (in this example, used 10.10.10.1)
Open PowerShell or CMD as administrator and enter the command below
netsh interface portproxy add v4tov4 listenaddress=10.10.10.1 listenport=445 connectaddress=smb.example.com connectport=44518
Where:
listenaddress - is the address defined in the previous steps, in this example 10.10.10.1
listenport - the original samba port (445, 137, 138, 139) usually just 445 will solve connectaddress - the remote address that will be made the proxy, can be a DNS name or an IPv4 address n.n.n.n
connectport - the customized service port, in the example, 44518
Reboot computer
This should now allow local connections to 10.10.10.1 port 445 to be directed to smb.example.com port 44518