πŸ“‚ How to Make a Shared Drive in OpenWRT – Full Guide for Office & Home Networks

Want a centralized, secure, and always-on file sharing solution for your office or home without keeping your PC running 24/7? In this guide, we’ll walk you through how to set up a shared network drive using OpenWRT.


βœ… Why Use OpenWRT for Shared Drive Instead of a Personal PC?

Using your office PC to host a shared folder comes with limitations:

  • ❌ Power-hungry and must stay on
  • ❌ Risk of data loss when the PC crashes or updates
  • ❌ Not always accessible remotely

By contrast, using OpenWRT on your router with a USB drive or external HDD allows:

  • ⚑ Low power consumption – routers run 24/7 anyway!
  • πŸ” Centralized and secured access for all users
  • πŸ“± Cross-platform access (Windows, Android, macOS)
  • πŸ”„ Ideal for small offices, remote teams, or NAS replacement

πŸ› οΈ Step-by-Step: Install Samba4 on OpenWRT

Samba4 allows Windows-compatible file sharing via the SMB protocol. We will install it via both terminal (SSH) and the LuCI Web Interface.

1. SSH into your OpenWRT router

Use a terminal or SSH tool like PuTTY:

2. Update package lists

opkg update

3. Install required packages

opkg install samba4-server luci-app-samba4

This installs both the Samba4 server backend and the LuCI GUI module for web-based configuration.

βš™οΈ Configure Samba Share Using LuCI Web Interface

  1. Visit http://192.168.10.1 (replace with your router’s IP).
  2. Navigate to: Services β†’ Network Shares
  3. Click on Enable Samba4, then Save & Apply
  4. Under Shared Directories, click Add
    • Name: SharedFiles (or anything meaningful)
    • Path: /mnt/sda1/shared (your mounted USB/HDD path)
    • Allow guests: Optional
    • Read-only: Uncheck for read-write access
  5. Click Save & Apply
  1. Apply

πŸ‘€ Add Samba Users in OpenWRT

To create user access control:

  1. Create a new system user:
bashCopyEditadduser newuser
  1. Set the password for the user:
bashCopyEditpasswd newuser
  1. Enable the user for Samba:
bashCopyEditsmbpasswd -a newuser

Now, this user can authenticate when connecting to the share.


🌐 Accessing the Shared Drive

πŸ’» On Windows:

  1. Press Win + R, type: CopyEdit\\192.168.1.1\SharedFiles
  2. Enter the Samba username and password.
  3. You can map it as a drive:
    • Right-click on “This PC” β†’ Map Network Drive

πŸ“± On Android:

Use file manager apps like:

Steps:

  • Tap Network β†’ LAN
  • Enter the router IP and credentials

🍎 On macOS:

  1. In Finder, press Cmd + K
  2. Enter: smb://192.168.1.1/SharedFiles
  3. Click Connect, enter credentials

πŸ” Bonus Tips

  • Use a powered USB hub if connecting HDDs with high power draw
  • Set up automount for USB using block-mount
  • Secure access using strong passwords or disable guest access

πŸ“Œ Summary

TaskCommand or Path
Install Samba4 Serveropkg install samba4-server
Install LuCI Web Configopkg install luci-app-samba4
Add user to Sambasmbpasswd -a username
Access from Windows\\192.168.1.1\ShareName
Access from Android/macOSUse smb:// protocol with login

βœ… Final Thoughts

Setting up a shared drive using OpenWRT is a smart and cost-effective alternative to a full NAS or keeping your computer always on. It’s ideal for collaborative teams, home users, and small offices who want centralized storage without spending big.


πŸ”— External Useful Links:

Leave a Reply

Your email address will not be published. Required fields are marked *.

*
*
You may use these <abbr title="HyperText Markup Language">HTML</abbr> tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>