1 - Connect via ssh to your device
2 - Mount the QNAP Configuration
The name of the actual device to mount depends on your model number. In general for x86-based systems this should be /dev/sdx6. For Marvell ARM based models it should be /dev/mtdblock5 or /dev/mtdblock4.
[~] # mount -t ext2 /dev/sdx6 /tmp/config2 - Create or adapt autorun.sh
A shell script called “autorun.sh” will be executed by your QNAP storage system on every startup. It might be possible that file currently does not exist so just go ahead and create it with your favorite text editor, or the whatever is installed.
#!/bin/sh3 - Make sure that autorun.sh is executable
route add -net <subnet> netmask <mask> gw <gw_ip_addr>
In order to be executable during startup, we will have to set the executable flag for “autorun.sh”:
[~] # ls -al /tmp/config/autorun.sh4 - Unmount the config
-rw-r--r-- 1 admin administ 60 May 11 17:43 /tmp/config/autorun.sh*
[~] #
[~] # chmod +x /tmp/config/autorun.sh
[~] #
[~] # ls -al /tmp/config/autorun.sh
-rwxr-xr-x 1 admin administ 60 May 11 17:43 /tmp/config/autorun.sh*
[~] #
[~]# Unmount /tmp/config