A while ago I asked a general question on how to save my photos while on holidays to my server due to the restricted free storage space on my phone. My phone has maybe 100 GB of free space while my server has TBs. After considering the replies to my earlier post I decided on setting up a WAN so my Android could talk directly to my server and upload all the photos and videos there. My situation was one where I had an existing Samba server that was used exclusively on a LAN.
I had previously set up OPENVPN but rarely used it as it was so slow. After an upgrade to KUbuntu at some point it broke and it was just to much trouble to fix so I worried that reinstating it for Android access would be a real PITA. After some research I decided on connecting my Android to my Samba server using Wireguard. To say that this was simplicity plus to do is an understatement.
Here are the steps to get it going:
1. Install Wireguard server. Some guy, hwdsl2 has created a brilliant install script for setting up your server. Download the below Wireguard link and follow the instructions, no need to separately download Wireguard for your server.
2. Install Wireguard on your Android from the Google Play Store (works on rooted phones). The script above also generates a QR code (in your server's terminal) which you scan from the Android Wireguard app to complete a working connection.
3. Setup your router's port forwarding or virtual server functions to allow port 51820 (default) to be piped to your Samba server. (Make sure you enable UFW)
4. Install an app on your Android to talk to your samba server, in my case I used CIFS Document Provider -
https://play.google.com/store/search...rovider&c=apps (I know the picture is in Chinese but it works in English on your phone.)
To use this app turn on your Wireguard connection first and it is simply a matter of pressing the connection button followed by the browse button to find your Samba share. The browse button will only display those shares you have setup for this connection in samba.conf.
In terms of time getting Wireguard and CIFS Document Provider installed and talking to each other is really only about 5 minutes. Setting your UFW rules maybe 30 minutes (need to identify ports numbers and protocols), for example KDE connect needs a UFW allow rule plus a few more depending on what connects to your server. Setting your router's forwarding is about 5 minutes and samba can be relied upon to take a long time. I tried being fancy and wasted 6 hours before I decided on a separate share for the Android connection. In total, excluding Samba.conf the whole shebang in less than an hour.
I had previously set up OPENVPN but rarely used it as it was so slow. After an upgrade to KUbuntu at some point it broke and it was just to much trouble to fix so I worried that reinstating it for Android access would be a real PITA. After some research I decided on connecting my Android to my Samba server using Wireguard. To say that this was simplicity plus to do is an understatement.
Here are the steps to get it going:
1. Install Wireguard server. Some guy, hwdsl2 has created a brilliant install script for setting up your server. Download the below Wireguard link and follow the instructions, no need to separately download Wireguard for your server.
2. Install Wireguard on your Android from the Google Play Store (works on rooted phones). The script above also generates a QR code (in your server's terminal) which you scan from the Android Wireguard app to complete a working connection.
3. Setup your router's port forwarding or virtual server functions to allow port 51820 (default) to be piped to your Samba server. (Make sure you enable UFW)
4. Install an app on your Android to talk to your samba server, in my case I used CIFS Document Provider -
https://play.google.com/store/search...rovider&c=apps (I know the picture is in Chinese but it works in English on your phone.)
To use this app turn on your Wireguard connection first and it is simply a matter of pressing the connection button followed by the browse button to find your Samba share. The browse button will only display those shares you have setup for this connection in samba.conf.
In terms of time getting Wireguard and CIFS Document Provider installed and talking to each other is really only about 5 minutes. Setting your UFW rules maybe 30 minutes (need to identify ports numbers and protocols), for example KDE connect needs a UFW allow rule plus a few more depending on what connects to your server. Setting your router's forwarding is about 5 minutes and samba can be relied upon to take a long time. I tried being fancy and wasted 6 hours before I decided on a separate share for the Android connection. In total, excluding Samba.conf the whole shebang in less than an hour.
Comment