How to add custom static route

Hi everyone!

We have WD MyCloud EX2 Ultra installed. Everything is ok, but we need some static route. GUI didn’t have static route settings. Via SSH I can add - its works, but dissappear after reboot.

I’d try to add route command to /etc/rc.d/rc.init.sh or /etc/rc.sh files, but changes not saved, after reboot I don’t see my added lines in this files.

How I can resolve this problem? Thanks.

@UnSigned What type of router do you have? Are you able to reserve the address for your My Cloud EX2 with your router?

For more help with the EX2 see this sub-forum.
https://community.wd.com/c/network-attached-storage/wd-my-cloud-ex2

We need static route directly on my device. Network, where device is connected, has two gateways. It is a DMZ network. One gateway - to internet, second - to corporate office network. Default route for MyCloud device - internet, but I need route some networks to internal gateway.

I can manually add

route add -net x.x.x.x netmask 255.255.255.0 gw y.y.y.y

where x.x.x.x - required net
y.y.y.y - internal gateway address

but after restart device manually added routes all lost.