A lightweight, IPv6-only NAS with secure WireGuard VPN access. Built on Debian 12 (32-bit) for older hardware with public static IPv6. Samba is used for file sharing over the private VPN.
- Secure IPv6 NAS with no public IPv4
- WireGuard VPN to bridge IPv4-only clients
- Samba file sharing
- Full firewall and routing config
- Designed for low-spec machines (e.g. old laptops)
- Debian 12 (i386 / 32-bit) Server installed
- Public Static IPv6 address
- Internal-only IPv4
git clone https://github.com/PranavDarshan/NASguard-v6-Home-Server
cd NASguard-v6-Home-Serverchmod +x generate-key.sh
./generate-key.sh client1Keys will be saved in keys/ folder.
sudo bash iptables.sh
sudo bash ip6tables.sh
sudo netfilter-persistent saveTo persist firewall rules across reboots:
sudo apt update
sudo apt install iptables-persistentsudo iptables-save > /etc/iptables/rules.v4
sudo ip6tables-save > /etc/iptables/rules.v6These rules will automatically apply on boot.
Ensure wg0 forwards traffic properly (already configured in iptables.sh).
sudo cp start-wireguard.sh /etc/init.d/
sudo chmod +x /etc/init.d/start-wireguard.sh
sudo update-rc.d start-wireguard.sh defaultsTo stop manually:
sudo bash stop-wireguard.shcd samba
chmod +x samba-setup.sh
./samba-setup.shThis creates:
- User
smbuser - Share at
/srv/samba/secure
Once VPN is up from a client, access share using:
\\10.0.0.1\SecureShare
Use credentials created via samba-setup.sh
This section documents how to prevent your Debian 12 laptop from suspending when the lid is closed โ ensuring services like Wi-Fi, SSH, and background tasks continue to operate.
- Disable suspend on lid close
- Keep Wi-Fi and all services running
- Optional: Fully block all suspension paths (systemd targets)
Edit /etc/systemd/logind.conf:
HandleLidSwitch=ignore
HandleLidSwitchDocked=ignore
HandleLidSwitchExternalPower=ignoreThen apply changes:
sudo systemctl restart systemd-logindPrevent all suspend actions:
sudo systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.targetThis ensures no service or user session can suspend the system โ great for 24/7 headless or docked setups.
Check if any are active:
systemctl list-units --type=service | grep -E 'tlp|acpid|powerd|upower|sleep'Disable any unnecessary services:
sudo systemctl disable --now upower.serviceAs a non-root user, run:
gsettings set org.gnome.settings-daemon.plugins.power lid-close-ac-action 'nothing'
gsettings set org.gnome.settings-daemon.plugins.power lid-close-battery-action 'nothing'Verify with:
gsettings get org.gnome.settings-daemon.plugins.power lid-close-ac-action
gsettings get org.gnome.settings-daemon.plugins.power lid-close-battery-actionUnmask the targets:
sudo systemctl unmask sleep.target suspend.target hibernate.target hybrid-sleep.targetWith this setup, Debian will no longer suspend on lid close, and all network and system services will continue uninterrupted.
This section describes how to deploy and configure AdGuard Home using Docker on your Debian-based server, with support for LAN and VPN clients (via WireGuard).
AdGuard Home is deployed in Docker using the following command:
sudo docker run --name adguardhome -d \
-v /opt/adguardhome/work:/opt/adguardhome/work \
-v /opt/adguardhome/conf:/opt/adguardhome/conf \
-p 53:53/tcp -p 53:53/udp \
-p 3000:3000/tcp \
adguard/adguardhome- Port
53: Standard DNS service (UDP and TCP) - Port
3000: AdGuard Web UI - Data is persisted in
/opt/adguardhome/underwork/andconf/
Make sure your iptables and ip6tables rules allow traffic to AdGuard services:
IPv4 rules:
# Allow DNS from LAN
sudo iptables -A INPUT -p udp --dport 53 -s 192.168.29.0/24 -j ACCEPT
sudo iptables -A INPUT -p tcp --dport 53 -s 192.168.29.0/24 -j ACCEPT
# Allow DNS from WireGuard clients
sudo iptables -A INPUT -i wg0 -p udp --dport 53 -j ACCEPT
sudo iptables -A INPUT -i wg0 -p tcp --dport 53 -j ACCEPT
# Allow Web UI from LAN and WireGuard
sudo iptables -A INPUT -p tcp --dport 3000 -s 192.168.29.0/24 -j ACCEPT
IPv6 rules:
# Allow DNS from local ULA and WireGuard clients
sudo ip6tables -A INPUT -p udp --dport 53 -s fd00::/8 -j ACCEPT
sudo ip6tables -A INPUT -p tcp --dport 53 -s fd00::/8 -j ACCEPT
sudo ip6tables -A INPUT -i wg0 -p udp --dport 53 -j ACCEPT
sudo ip6tables -A INPUT -i wg0 -p tcp --dport 53 -j ACCEPT
# Allow Web UI
sudo ip6tables -A INPUT -p tcp --dport 3000 -s fd00::/8 -j ACCEPT
To ensure Docker restarts AdGuard on boot:
sudo docker update --restart unless-stopped adguardhome- Port 53 must be free. If
connmanorsystemd-resolvedis using it, disable them. - You can edit AdGuard config at
/opt/adguardhome/conf/AdGuardHome.yaml - Use
bind_host: 0.0.0.0to make the service available to all interfaces.
โ You now have AdGuard Home running with LAN + VPN access via Docker.
This section covers how to run and configure Netdata using Docker, with custom firewall rules and IPv6 handling.
To deploy Netdata in a Docker container with cloud features disabled:
docker run -d \
--name=netdata \
-p 19999:19999 \
--restart unless-stopped \
-v netdataconfig:/etc/netdata \
-v netdatalib:/var/lib/netdata \
-v netdatacache:/var/cache/netdata \
-v /etc/passwd:/host/etc/passwd:ro \
-v /etc/group:/host/etc/group:ro \
-v /proc:/host/proc:ro \
-v /sys:/host/sys:ro \
-v /etc/os-release:/host/etc/os-release:ro \
-e NETDATA_CLAIM_TOKEN=disable \
--cap-add SYS_PTRACE \
--security-opt apparmor=unconfined \
netdata/netdataThis setup disables cloud login and ensures data remains local.
You can restrict access to Netdata (port 19999) using iptables and ip6tables.
- Allow access only from LAN:
sudo iptables -A INPUT -p tcp --dport 19999 -s 192.168.29.0/24 -j ACCEPT- Block access from VPN clients (WireGuard):
sudo iptables -A INPUT -i wg0 -p tcp --dport 19999 -j REJECT- Block access from WireGuard on IPv6:
sudo ip6tables -A INPUT -i wg0 -p tcp --dport 19999 -j REJECT- Use
ping 10.0.0.1from client sudo wgon server to check VPN handshakessmbclient //10.0.0.1/SecureShare -U smbuserfor Samba test- Web UI:
http://192.168.29.4:3000or via VPN IP - DNS: Point clients to
192.168.29.4or its IPv6 address (fd00::...) - Configure DNS-over-HTTPS/DoT in AdGuard as needed
- All services are only accessible via VPN
- IPv6 traffic is isolated from the WAN
- Strong firewall rules included
- Note my home network is
192.168.29.0therefore I have used192.168.29.0/24in the IP tables. Change this IP to your home network IP192.168.x.0/24.
This setup was created due to lack of publicly available static IPv4, while IPv6 was available. It's an attempt to use old hardware effectively and securely for modern personal cloud storage.
Open a GitHub issue or pull request!



