How to enable/disable wan I/F via SSH on RUT950 V6

Hi
can you please let me know which command I have to issue to RUT950 v6.x router to enable/disable WAN port eth1?
Need to troubleshoot some problems I’m facing and this will help a lot

Thanks
Matteo

Hello,

The easiest way will be to use the commands:

ifconfig eth1 down #disable the interface
ifconfig eth1 up #enable the interface

These commands will only apply until the device is rebooted. If you’d like them to apply even after the reboot, you can use

uci set network.wan.enable='0' #disable the interface
uci commit network #commit the changes
/etc/init.d/network restart #restart the network service

And these for enabling the interface:

uci set network.wan.enable='1' #enable the interface
uci commit network #commit the changes
/etc/init.d/network restart #restart the network service

Hope this helps!

Best regards,

Hello Daumantas,

thanks

Is there commands like ifconfig ethx to check the interface status in real time?

Thanks

Matteo

Hello,

The ifconfig eth1 command could be used to check if the WAN interface has received and IP address from the upstream device. For example, here is the output when no DHCP lease is aquired:
image
And here is an example with the interface running:


Just to clarify, you are not able to update to the latest firmware due to hardware limitations?

Best regards,

Yes I can’t update the router otherwise with Version 7 GUI I could check it more simply
Or do you have different commands with latest firmware?

Thanks for now

Matteo

Hi,

With the latest firmware, I’d suggest to use ubus commands for checking the status, and enabling/disabling the interface, but that would simply be more convenient for you to script, the end result is the same.

Best regrads,

Hi,
do you have a list of ubus command or a link to provide?

Thanks
Matteo

Hello,

They would be:

ubus call network.interface.wan down #disable the WAN interface
ubus call network.interface.wan up #enable the WAN interface

And to check the status:

ubus call network.interface.wan status

jsonfilter can be used to parse only the relevant part:

ubus call network.interface.wan status | jsonfilter -e '@.up'

This will return true if the interface is up, and false if the interface is down.

Best regards,

This topic was automatically closed after 15 days. New replies are no longer allowed.