Hi all!
Newbie question!
I need to add a static route to my interface: I did this via the LuCI interface, but I need to create a shell that get as arguments Ip,Sub, and Gateway and add the static route to the interface:
From /etc/config/network is see this:
config route
option interface 'wan'
option target 'xxx.xxx.xxx.xxx'
option netmask 'aaa.aaa.aaa.aaa'
option gateway 'bbb.bbb.bbb.bbb'
As I said I would like to do this via a shell script.
I found this:
# uci add network route
# uci set network.@route[-1].interface=wan
# uci set network.@route[-1].target=xxx.xxx.xxx.xxx
# uci set network.@route[-1].netmask=aaa.aaa.aaa.aaa
# uci set network.@route[-1].gateway=bbb.bbb.bbb.bbb
# uci commit network
Not sure if it is correct before trying it
Also what's @route[-1] stands for?
Thanks