5654 questions

6864 answers

11066 comments

6947 members

0 votes
137 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 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