I’m a beginner, and I’d like to ask a question. I have a NAS PC using ZimaOS, which has multiple Ethernet ports. The topology is Router > NAS PC with ZimaOS > Personal PC. The NAS PC’s eth1 is connected to the router, and eth0 is connected to the Personal PC. Now, in the ZimaOS UI, there is no option for NAT Bridge Network. How can I achieve this using an SSH command?
Finally Fixed
Network Bridge in ZimaOS:
I have a topology: Router > NAS PC ZimaOS > Personal PC. My goal is to make the NAS PC a network bridge.
-
First Step: Ensure the Network Settings on Zima OS DHCP are enabled for both eth0 and eth1 ports.
-
Second Step: Ensure you have another drive partition (in my case, I have the sda1 partition as an additional hard drive).
-
Third Step: Create a script on the sda1 partition with the name
bridge-setup.sh
. I manually created this script and copied it to the sda1 partition (you can use the SMB protocol for file transfer). The script content is as follows:
#!/bin/bash
systemctl stop NetworkManager 2>/dev/null
ip addr flush dev eth1
brctl addbr br0
brctl addif br0 eth0
brctl addif br0 eth1
ip route add default via 192.168.1.1 dev br0
ip link set dev eth0 up
ip link set dev eth1 up
ip link set dev br0 up
ip route add default via 192.168.1.1 dev br0
ip addr add 192.168.1.102/24 dev br0
ip route add default via 192.168.1.1
- Fourth Step: Open the terminal on ZimaOS by navigating to Settings > General > Developer Mode > View > Enable SSH Access > Open Web-Based Terminal. Login with your username and password, then execute the following commands:
sudo chmod +x /media/sda1/bridge-setup.sh
sudo sh /media/sda1/bridge-setup.sh
sudo ip route add default via 192.168.1.1 dev br0
Wait a few minutes (around 5), and voila! ZimaOS can now act as a Network Bridge for my Personal PC.
Disclaimer:
- I configured my NAS PC so that its IP remains consistent at 192.168.1.102 through DHCP Binding on my router, ensuring it doesn’t change. The configuration above also sets the ZimaOS Bridge Network IP as 192.168.1.102 on the NAS PC (you can adjust it to suit your needs).
- If the NAS PC restarts, the commands need to be manually re-executed through the Web-Based Terminal using
sudo sh /media/sda1/bridge-setup.sh
andsudo ip route add default via 192.168.1.1 dev br0
, as I have yet to find a way for the.sh
script to autorun during boot. - Hopefully, future ZimaOS updates will include a built-in network bridge feature.
Since ZimaOS doesn’t have a autorun startup built-in Bridge feature, I’ve devised a workaround using my personal Windows PC, which is connected to the same WiFi router as my NAS. When powered on, the PC runs a script to activate the ZimaOS bridge via SSH.
Steps to Set Up:
-
Create a folder anywhere on your Windows system (I placed mine at
D:\ZimaOS-Bridge
). -
Inside that folder, create a file named
run.cmd
(you can use Notepad, select Save As, set file type to All Files, and name itrun.cmd
). Edit the.cmd
file to include the following:@echo off REM // ============================================== REM // 1. Run Plink to execute the bridge script REM // ============================================== start /min plink.exe -batch -ssh yourusername@192.168.1.102 -pw "yoursshpassword" "echo 'yoursudopassword' | sudo -S sh /media/sda1/bridge-setup.sh" REM // ============================================== REM // 2. Wait 3 seconds, then close all CMD instances except this one REM // ============================================== timeout /t 3 /nobreak > nul taskkill /f /im plink.exe >nul 2>&1 taskkill /f /fi "WINDOWTITLE eq Administrator: Command Prompt*" /im cmd.exe taskkill /f /fi "WINDOWTITLE eq Administrator: run.cmd*" /im cmd.exe
-
Download
plink.exe
from putty.org and place it in the same folder asrun.cmd
(in my case,D:\ZimaOS-Bridge
, which now containsplink.exe
andrun.cmd
). -
To execute the Bridge Network script, simply run
run.cmd
. If you want it to launch automatically whenever your Personal PC boots up, create a shortcut forrun.cmd
by:- Right-clicking
run.cmd
- Selecting Send To > Desktop (create shortcut)
- Moving the shortcut to
"C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp"
- Right-clicking
Notes:
- If
bridge-network.sh
has already been executed and the NAS remains powered on, rerunningbridge-setup.sh
isn’t necessary. However, since I frequently turn my NAS on and off, automation ensures that whenever both my NAS and Personal PC are powered on, the bridge activates seamlessly without manual input. - If a personal PC running Windows has never paired SSH with the NAS PC before, pairing is required to generate the fingerprint first. To do this, open PowerShell and type
"ssh username@192.168.102"
. After that, a fingerprint will appear—type"yes"
and press Enter.
Fixing Network Speed Detection in ZimaOS: Avoid Bottlenecks in File Transfers & Internet Connectivity
ZimaOS sometimes detects network speeds inaccurately, especially in mixed-speed topologies. For example, consider this setup:
Router > eth1 (1GbE) > PC NAS > eth0 (10GbE) > Personal PC
ZimaOS often defaults to recognizing the lowest available speed—in this case, 1GbE. As a result, when bridging the network, local file transfers between the Personal PC and PC NAS suffer from bottlenecks.
Solution
To ensure proper speed detection and network performance, add the following line at the beginning of your script, right after #!/bin/bash
:
ethtool -s eth0 speed 10000 duplex full
This command forces eth0
to run at 10GbE full duplex, ensuring that both the PC NAS and Personal PC are properly bridged. With this fix in place:
- The internet connection works seamlessly.
- Local file transfers happen at full speed, without bottlenecks.