ssh to the device.
then add your route to this file:
echo "route add -net x.x.x.x gw y.y.y.y" >> /etc/persistent/rc.poststart
try running the script manually to see if it works:
./etc/persistent/rc.poststart reboot; cfgmtd -w -p /etc/
By: Mehdi Sadighian
Contact: mehdi.sadighian@hotmail.com
TAG: ubnt,ubiquiti,route,persistent route,static route