Alternative solution for a Home Media Server
Hi…
About a week ago I got the idea of sharing my media across all my devices, well you might think that the idea is pretty old because nowadays most of the people do this with various kind of solutions, some have their own home media severs such as PLEX, CODI, some use solutions like Spotify and etc. They are all good, they have really good features but there are some serious drawbacks to them that made me ignore them. Take PLEX as an example, it is a really good solution for one who wants to set up a media server, but the biggest drawback I found was it is not free. You have to pay for it and also it is a better solution for ones who are having their own equipment such as a spare pc or dedicated hardware for it. But as I have only one PC and it is not possible for me to buy dedicated PC parts for this kind of scenario, I have to find a reliable solution for this. So I keep searching for various kinds of solutions and decide to go with my current solution.
Here is my use case
I want to share my media with my family members, which means they should be able to access the media stored in my PC by connecting to an access point (Wi-Fi router) in the house. For convenience, I will call this Wi-Fi router as router B. Another thing is this router should not share my internet connection by any means. The only way I could connect Router B to my PC is the Ethernet port on my PC. I have a separate Router to connect my PC to the internet. For convenience, I name this router A. As this router A is also a Wi-Fi router, I use a Wi-Fi dongle attached to my PC to connect it to router A and get internet to my PC. My phone also connects to router A to get internet.
Step 1 — Setting up the network
Take a look at my network
Configuration in PC
The PC connects to router A using a Wi-Fi dongle attached to the PC. I set the IP address of the Wi-Fi dongle as 192.168.8.101, In the Ethernet adaptor of the PC, I set the IP address as 192.168.8.100 (router B connects to the PC using the Ethernet adaptor in PC)
and in the Router A settings, I set a static IP for PC as 192.168.8.101 (please note that I had to give the MAC address of the Wi-Fi dongle when setting up the static IP for PC in router A)
Ethernet adaptor IPv4 settings
Wi-Fi adaptor IPv4 settings
Configuration in router A
In router A, I enabled the built-in MAC filter to limit the devices connecting to it. As it is the router I used to connect to the internet, I put the MAC address of my phone and the MAC address of the PC (Wi-Fi dongle) to the MAC table. The router only allows the devices to connect with it only if the MAC address of that particular device exists in its MAC table. I also fixed static routes for the PC (Wi-Fi dongle) and My phone in the router. Setting static routes helped me to set up the SMB protocol on other devices without any surprises (more about this will be discussed in a later part of the article). The biggest advantage of setting static IPs is; it stops the router from assigning a random IP address to the devices connected to it.
You can avoid setting up the static IP address for the phone because the phone doesn’t need to be identified specifically in the network. But you must set up a static IP for PC (Wi-Fi dongle) because if not it is not possible to set the SMB protocol correctly. Another thing I need to mention is you don’t need to disable DHCP on the router because DHCP doesn’t affect the functionality of our use case.
Router A DHCP settings
Configuration in router B
I did only two configurations in Router B. first one is changing the default IP address of the router to a different one. The main reason to do this is as both routers I use for this scenario are identical and both use the same (192.168.8.1) IP address to get into the router interface. Therefore, to avoid conflicts I changed the IP address of router B to 192.168.8.2. This router B connects with my PC using a LAN cable. The other configuration I did was to assign a static IP (192.168.8.100) address to my PC. This makes it easy for other devices to identify my PC in the network and avoid the router from assigning random IPs to the PC.
Router B DHCP settings
Summary of my network
Both my phone and my PC connect with router A wirelessly. My PC connects with router B through the Ethernet adaptor and other devices that want to access media in my PC connects with router B wirelessly.
Step 2 — Sharing the Media
Once set up the networking is done, the next thing I had to do was sharing the media on my PC. In my case, those media files include films, videos, songs and etc. those media were contained in separate folders. In order to access them outside my PC, I need to share them.
Sharing files/folder or drives over a network in Windows 10
In order to share a folder in windows 10 open the File Explorer on Windows 10.
Navigate to the folder you want to share
Right-click the item, and select the Properties option
Click on the Sharing tab
Click on Advanced sharing button
Tick the Share this folder option
If you want to give a different name to your shared folder in the network, you can do it by changing the share name option. You can also limit the number of users accessing the folder at the same time by setting the Limit the number of simultaneous uses to your preferred number.
Click permissions button.
Here in order to give access to our folder, we need to specify users or user groups that allowed to access this folder. You can add users or user groups by hitting the Add button.
Click Add button
Here you can choose the users and groups that you want to share the files. All you need to do is type the name of the user or group in the Enter the object names to select section. Here I type Everyone because that allows all the users to access files within this folder.
Then you need to click Check Names. This will add the object name to users or groups list that has permission to view the content.
Click Check Names
Then you can click OK and you will be able to see the user name or group that you just selected has been added to the authorized list.
Then you need to select that user name or group you just added to the list and choose what kind of permissions you need to allow by checking the relevant checkboxes in the Permissions for Everyone section. Here I checked the Read box in the allow section and that all the permission I gave because I don’t want to grant any other permissions such as Change or Full Control. After that, you can click apply and exit from the section.
That is pretty much about sharing a folder in window 10. Now we need to do some configurations in windows Advanced Sharing Settings in order to give access to outsiders (I mean the users in my local network).
Configuring Advanced Sharing Settings
The easiest way to get into the Advanced Sharing Settings is to type Advanced Sharing Settings in the windows search bar and and you will see Manage Advanced Sharing Settings in results or you can get into the Advanced Sharing Settings by
Control Panel -> Network and Sharing Center -> Change
Now you need to choose Private (current profile). Select Turn on file and printer sharing
If your pc has multiple accounts or guest accounts and you also want them to access files, you have to enable the same setting in the Guest or Public section.
Then go to the All Networks section.
here in the Public folder sharing section choose Turn on sharing so anyone with network access can read or write files in public folders option. This will allow users on your network to access publicly shared folders. In the File sharing, connections section keep Use 128-bit encryption to help protect file sharing connections(recommended) as it is. In the Password protected sharing section choose to Turn off password protected sharing. This will allow other users or devices to access the folders shared without the use of any credentials. After all, that you need to hit the Save changes button at the end.
So now we are done with setting up the PC and all we have to do is setting up the devices connecting to the network.
Step 3 — Accessing the Media
All the devices that want to access the media in my PC connect to my network wirelessly. Currently, all those devices run different versions of android starting from android 6 (Mash Mellow) to android 10. In order to access the files on my PC, I need a proper application that supports file sharing protocols such as SMB. Therefore, after some research, I decided to go with File Manger by Xiaomi Inc. to access the files and to listen to music and I decided to go with MX player by MX media. Both these apps have excellent features and do what I need to be done. You can download both apps from the Google Play Store. Installing and setting up these apps is quite easy and you can set up these apps the same as you install a typical android app.
Once you have done setting up the apps, you need to connect your devices (phones or tablets) to the correct Wi-Fi router. In my scenario, I connect the devices except for my phone to router 2. This is because I do need to access the Internet and router 1 is the only one that has an internet connection of its own. I hope this makes sense and if you are confused take a look at the previous network diagram.
Setting up the File Manager
Open the File Manger app.
Click on the side pane
Choose Remote option
Click Add remote device
Choose LAN option
Click EDIT
Enter the IP address of the PC.
Please note that if you are connecting a device none other than your phone or a device that doesn’t need to access your internet connection on router 1, you need to connect it to router 2. In my scenario, I assigned the IP address of my PC as 192.168.8.100 in router 2. If I am connecting through router 1, I need to give 192.168.8.101 as the PC IP address as it is the one I set. You also need to tick the Anonymous option in order to log in without any credentials. Then click OK and you will see the files/folders you shared earlier.
That is pretty much it and you can start accessing the media remotely from your devices.
Setting up the MX Player
Open the MX Player app and click on Side Pane
Choose Local Network
Hit plus icon
Enter relevant IP address along with the protocol
Please note that by the time I am doing this I am trying to connect my phone to the network. That is why I’m entering the IP address assigned by router 1 for my PC. If I want to allow another user (which I don’t want to share my internet connection) I will connect him to router 2 which gave the IP address of my PC as 192.168.8.100. You also can give a name to your new server and need to put a tick to that Connect Anonymously option. You don’t need to specify the shared path as Windows will automatically allow only the shared folders/files to access.
Click Connect to establish the connection and you will see the shared folder in a second.
At this point, we are almost done. You can start accessing the media through your devices and all. But some of you might face a serious problem. That is, you can’t access the internet from your PC. When this problem happened to me, I temporarily disabled the Ethernet adaptor (which is connected to my Router 2 through a LAN cable) and the internet works just fine. When I turn back on the adaptor again I can’t access the internet. This is happening because of the priority miss configurations in the order of network adaptors. In windows, this is called an interface metric. Simply it is how windows priorities the network adaptors according to the speed, hop count and time delay. If you can remember my network, my PC has two connections. (Wi-Fi connection from router 1 & Ethernet connection from router 2). As you all know Ethernet interfaces provide a much stable and high bandwidth connection than most Wi-Fi interfaces.
Let’s take a look at each adaptor
Here Ethernet adaptor provides a link speed of 1.0Gbs while the Wi-Fi adaptor provides a 144.4Mbps. So when a PC gets those two connections as the available connections, the PC gives priority to the connection with higher speed. But this scenario makes a problem in our case as my PC connects to the internet through this low-speed Wi-Fi connection. In order to fix this, we need to prioritize interfaces manually.
Step 4 — Solving interface conflicts
Setting up interface metric
In order to set up interface metrics manually, you need to go to the Advanced TCP/IP Settings of each adaptor.
Follow the following steps to open the Advanced TCP/IP Settings
Control Panel -> Network and Sharing Center -> Change adaptor settings -> choose the adaptor (Ethernet / Wi-Fi) -> right click for properties -> chose Internet Protocol Version 4 (TCP/IPv4) and click properties -> click Advanced… on the bottom of the Internet Protocol Version 4 (TCP/Ipv4) Properties -> choose interface metric at the bottom of Advanced TCP/IP Settings
The following Advanced TCP/IP Settings are for the Ethernet Adaptor
The following Advanced TCP/IP Settings are for the Wi-Fi Adaptor
I gave Wi-Fi adaptor a lower interface metric number because I want it to give priority when windows search for the interface to connect itself with the internet. If you want to learn more about how to interface metric work and how windows prioritize interfaces, you can take a look at this following article by Microsoft.
basically, when you give a lower number to an interface, windows give higher priority to that one.
So that is it and you can start enjoying your content.
Final verdict
The solution I explained here is ideal for a home or small office environment. The major advantage of this method is you don’t need to purchase dedicated hardware for this and can prepare this from the hardware you already have.
Upgrades
If you are planning on connecting more devices and playing high-quality media over this, you should consider upgrading your router as most of the home routers provide a limited throughput of about 54Mbps — 300Mbps which is sufficient for 3 -10 users to watch videos at 1080p (Full HD) resolution. You can also increase the overall responsiveness of the system by putting the media on an SSD or any other drive with higher read/write speeds.
Security
Currently, this system has limited security features but it sufficient because I made this run on a home or small office-like environment. But if you want to scale this up, I highly encourage using a firewall that provides great security features rather than the typical features we found on home router firewalls. Enabling MAC filters and providing stating IPs rather than dynamic IPs generated from the DHCP also ensures privacy to some extinct.