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
212 views 0 comments
by anonymous

Hello,

From NETWORK->VLAN->VLANS on SWITCH0 it is possible to set a port to off then back on manually.

But is there a way to do that with a script ? I have a device connected to LAN 1 which goes dark for unknown reasons and doing an off/on revives it, I would like to have cron job to perform the operation when a ping fails.

Version: RUTX_R_00.02.03.3.

Regards,

RUTX_R_00.02.03.3
RUTX_R_00.02.03.3
RUTX_R_00.02.03.3

1 Answer

+1 vote
by anonymous

Hello,

These UCI commands should perform action you are asking for. To set VLAN off on LAN1 port:

uci set network.@switch_vlan[0].ports='0 3 4'

uci commit network

luci-reload

To set it back:

uci set network.@switch_vlan[0].ports='0 2 3 4'

uci commit network

luci-reload

Or you can simply restart network interface:

/etc/init.d/network restart

 

BR.

Best answer