FOR TIPS, gUIDES & TUTORIALS

subscribe to our Youtube

GO TO YOUTUBE

14455 questions

17168 answers

28195 comments

0 members

We are migrating to our new platform at https://community.teltonika.lt. Moving forward, you can continue discussions on this new platform. This current platform will be temporarily maintained for reference purposes.
0 votes
1,409 views 3 comments
by anonymous

Hello I have been trying to work this out for some time with no luck.

We have a lot of TRB 140's we are trying to deploy and we have  number of static routes to add to each device, we are having no luck being able to do this from the CLI so we can automate the process. 

When using a CLI command  previously suggested  I keep getting an error. 
Example:
root@Teltonika-TRB140:~# ip route add 172.17.0.0/16 via 172.17.249.254 dev br-lan
RTNETLINK answers: File exists

root@Teltonika-TRB140:~# ip route list
172.17.0.0/16 via 172.17.249.254 dev br-lan
it exists in the CLI but does not show via the web interface.
also after a reboot the above route is gone, how do you commit this and also make it show in the gui

If I try using UCI commands it completely fails as well 

root@Teltonika-TRB140:~# uci set network.@route[0]=route

root@Teltonika-TRB140:~# uci set network.@route[0].table='254'

uci: Invalid argument

root@Teltonika-TRB140:~# uci set network.@route[0].interface='lan'

uci: Invalid argument

root@Teltonika-TRB140:~# uci set network.@route[0].target='172.17.0.0'

uci: Invalid argument

root@Teltonika-TRB140:~# uci set network.@route[0].netmask='255.255.0.0'

uci: Invalid argument

root@Teltonika-TRB140:~# uci set network.@route[0].gateway='192.168.2.1'

uci: Invalid argument

root@Teltonika-TRB140:~# uci set network.@route[0].metric='0'

uci: Invalid argument

root@Teltonika-TRB140:~# uci set network.@route[0].mtu='1500'

uci: Invalid argument

I need to add 6 static routes to 70 devices so a cli entry of the config is the easiest way forward IF we can work a way of doing this as it willt ake some time on each device and the GUI

by anonymous

I can add routes via the add route command and they take

As an example

root@Teltonika-TRB140:~# ip route add 192.168.3.0/24 via 172.17.17.1 dev br-lan

root@Teltonika-TRB140:~# ip route add 192.168.4.0/24 via 172.17.17.1 dev br-lan

show in "ip route list" but not in the GUI and a cleared after a reboot, uci commit network & luci-reload does not make the routes stick. 

Also if the ip address of the device is 

1 Answer

0 votes
by anonymous

Hello,

Good day.

May be it could be with the firmware if you are using any older firmware .

Its recommended to upgrade to the latest firmware and try if the routes you defined exists/sticks after the reboot. 

If upgrading doesn't helps kindly try to add the custom scripts to the router . So, that whenever router reboots it will itself execute/apply these routes to the router's configurations.  

I hope it helps.

Thanks .

Regards,

Ahmed

by anonymous
Hello Ahmed thank you for your reply,

We are using the latest firmware 2.06.1.

Adding the routes to a custom script would work, but to be honest it's not the best solution over 100+ deviecs.

I would rather the routes just take, also show in the GUI so support staff can easily see them.

Starting to question our choice in selecting these devices.
by anonymous
Hello,

There is another way you can add the static routes in webui manually and download backup file from the configured device then upload it to the other devices.