8413 questions

9899 answers

15703 comments

14199 members

0 votes
127 views 1 comments
by

Hello, we are about to deply 80+ TRB140s used as backup service for clients. 

The will have a pretty simply config on each device, they just needs to act as a 2nd gateway for outgoing traffic. 

The devices sim cards are carrier MVNO with a customer apn etc and as such will not have internet access for be able to dial into the RMS. 

-install latest firmware updates.

-Reset to factory configuration (I have noticed that there are 3 network interfaces when the device comes out of the box) 

I have then created a script to run in shell, this applies config we require  (shown below), issues I have with it is

  • The static route does not apply (as the interface does not exist?) worked fine on the dev unit but not applying to other TRB140's any way to resolve this ?

Is there a better way of doing this ?

#SET NTP CLIENT
uci set ntpclient.@ntpserver[0].hostname='Custom server address'
uci set ntpclient.@ntpclient[0].zoneName='Australia/Hobart'
uci commit ntpclient
uci set ntpserver.general.enabled='0'
uci commit ntpserver
#SET ADVANCED MENU
uci set luci.main.advanced='1'
uci commit luci
#REMOVE SMS UTILS
uci set sms_utils.@rule[0].enabled='0'
uci set sms_utils.@rule[1].enabled='0'
uci set sms_utils.@rule[2].enabled='0'
uci set sms_utils.@rule[3].enabled='0'
uci set sms_utils.@rule[4].enabled='0'
uci set sms_utils.@rule[5].enabled='0'
uci set sms_utils.@rule[6].enabled='0'
uci set sms_utils.@rule[7].enabled='0'
uci set sms_utils.@rule[8].enabled='0'
uci set sms_utils.@rule[9].enabled='0'
uci set sms_utils.@rule[10].enabled='0'
uci set sms_utils.@rule[11].enabled='0'
uci set sms_utils.@rule[12].enabled='0'
uci set sms_utils.@rule[13].enabled='0'
uci set sms_utils.@rule[14].enabled='0'
uci set sms_utils.@rule[15].enabled='0'
uci set sms_utils.@rule[16].enabled='0'
uci set sms_utils.@rule[17].enabled='0'
uci set sms_utils.@rule[22].enabled='0'
uci set sms_utils.@rule[23].enabled='0'
uci set sms_utils.@rule[24].enabled='0'
uci set sms_utils.@rule[25].enabled='0'
uci set sms_utils.@rule[26].enabled='0'
uci set sms_utils.@rule[27].enabled='0'
uci set sms_utils.@rule[28].enabled='0'
uci set sms_utils.@rule[29].enabled='0'
uci commit sms_utils
#SETUP SNMP COMMUNITY
uci set snmpd.general.remoteAccess='0'
uci set snmpd.general.proto='udp'
uci set snmpd.public.community='smnp community string'
uci set snmpd.public.ipaddr='private address range'
uci set snmpd.public.netmask='16'
uci set snmpd.private.community='snmp community string'
uci set snmpd.private.ipaddr='private address range'
uci set snmpd.private.netmask='16'
uci set snmpd.@system[0].sysLocation='Customer_SITE_Name'
uci set snmpd.@system[0].sysContact='XXXX@tasmanet.com.au'
uci set snmpd.@system[0].sysName='TRB140'
uci set snmpd.general.v1mode='0'
uci commit snmpd
#SET TIMEZONE
uci set system.system.zoneName='Australia/Hobart'
uci set system.system.timezone='AEST-10AEDT,M10.1.0,M4.1.0/3'
#SET SYSTEM AND HOSTNAMES
uci set system.system.routername='NAME OF CLIENT'
uci set system.system.hostname='TMN-TRB140-BACKUP'
uci commit system
uci set uhttpd.main.redirect_https='0'
uci set uhttpd.main._httpsWanAccess='0'
uci commit uhttpd
#TURN OFF DHCP SERVER
uci set dhcp.lan.ignore='1'
uci set dhcp.lan.relay_enabled='0'
#SET STATTIC IPV4 ADDRESS
uci set network.lan.proto='static'
uci set network.lan.netmask='255.255.255.0'
uci set network.lan.ipaddr='192.168.1.2'
#SET STATTIC IPV4 ROUTE
uci set network.@route[0]=route
uci set network.@route[0].table='254'
uci set network.@route[0].interface='lan'
uci set network.@route[0].target='172.17.0.0'
uci set network.@route[0].netmask='255.255.0.0'
uci set network.@route[0].gateway='192.168.1.1'
uci set network.@route[0].metric='0'
uci set network.@route[0].mtu='1500'
uci commit network
uci commit dhcp
luci-reload

1 Answer

0 votes
by

Hello,

I suggest inserting another uci commit network line after #SET STATIC IPV4 ADDRESS   actions and test again. 

Another suggestion is to simplify your static route commands to a single one. For example, you could test on your development device:

ip route add 170.170.0.0/16 via 192.168.1.1 dev br-lan

br-lan is your desired network interface name.

Best regards.

dsdaa

Best answer
by
Thank you for the feedback,

When using the command you 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

edit

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.

edit -2

also after a reboot the above route is gone, how do you commit this and also make it show in the gui