NAS542 static route


I have a nas542 device. It has 2 ethernet ports. One port (LAN1) is connected to the Internet. This is the default, so I can access the device remotely. The other port (LAN2) is on the LAN. The IP address of the LAN-side interface, e.g. The device is accessible from this LAN. However, we have additional LAN networks, such as the following:,, etc. up to

The request from these networks presumably arrives at the NAS, but it cannot respond because these are unknown networks and in such cases the traffic will be directed to the default route. And that is the internet interface. If I set the interface on the LAN side to default, the Internet will not work.

I added the following routes manually from the terminal via an ssh connection:
ip route add dev egiga1
ip route add dev egiga1
ip route add dev egiga1

So everything works perfectly.
Until the device restarts, because then these manually added routes will disappear.

What if I made a bash script that would add the necessary networks and set it in a crontab or somehow schedule it every time it starts to restore these routes? Can it work like this?

The other thing I thought of is to change the netmask to on the "egiga1" (LAN2) interface on the web interface. I haven't tried this yet because I don't want to lose the network connection to the device.

After all, the LAN1 internet interface is in dhcp client mode and since it is the default, so if incorrect settings were saved on LAN2, then maybe if I connect LAN1 to the local network, I can access the device in the same way to restore the configuration.

Is there any other way to add static routes to the non-default network interface, e.g. on the web interface, which the device remembers?

Accepted Solution

  • Mijzelf
    Mijzelf Posts: 2,398
    250 Answers 1000 Comments Friend Collector Fifth Anniversary
     Guru Member
    Answer ✓
    The other thing I thought of is to change the netmask to on the "egiga1" (LAN2) interface

    That won't work. When the NAS tries to send data to one of the other subnet's, it should send it to it's gateway. By changing the netmask the NAS will assume the target device is in the same subnet, and try an ARP request to get it's MAC address. If that fails (and it will) there is no route.

    There are several ways to get your script executed at boot, but none of them is supported by ZyXEL. The Tweaks package has a way to add a cronjob, including an @startup timestamp. The RandomTools package offers you a directory where you can put your own scripts which will be executed at bootup and shutdown.

    If you don't want to use 3th party software, you can use the /i-data/.system/zy-pkgs/USRPKG_DEPS_START file, as described here, and onwards.

Consumer Product Help Center