FOR TIPS, gUIDES & TUTORIALS

subscribe to our Youtube

GO TO YOUTUBE

14141 questions

16795 answers

27601 comments

53999 members

0 votes
193 views 0 comments
by

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

Hello,

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

uci set [email protected]_vlan[0].ports='0 3 4'

uci commit network

luci-reload

To set it back:

uci set [email protected]_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