I have a simple question, but don't know if the answer is
I'm using a WRT3200ACM with the latest firmware (19.07.4) and LuCi (19.07)
The connection l.e.d. can be amber or white.
I'm using the router as a VPN Client (ExpressVPN)
Is it possible to change the white led to amber when my VPN connection is down? So I can see on the hardware that the VPN connection is down. The ExpressVPN firmware has this as default, so technical it must be possible, but I'm clueless on this one.. (and most other things according to my wife)
I have the wps led (not used) on (amber) when my VPN is up and off when down. with the following added to /etc/config/system
config led
option dev 'tun0'
option sysfs 'pca963x:rango:amber:wps'
option default '0'
option trigger 'netdev'
list mode 'link'
list mode 'tx'
list mode 'rx'
option name 'VPN UP'
It works, but still curious how to get the connection led change color, when the VPN is up or down.
you need to use hotplug for led change on interface up/down, i use it for my 4g backup status on r7800. adjust for your needs (tun0 should be your interface and pca963x:rango:amber:wan pca963x:rango:white:wan or pca963x:rango:amber:wps pca963x:rango:white:wps)
config led
option default '0'
option trigger 'netdev'
option sysfs 'pca963x:rango:amber:wan'
option name 'wan_amber'
list mode 'link'
list mode 'tx'
list mode 'rx'
option dev 'tun0'
config led
option default '0'
option sysfs 'pca963x:rango:white:wan'
option name 'wan_white'
option trigger 'netdev'
list mode 'link'
list mode 'tx'
list mode 'rx'
option dev 'eth1.2'
So now, when my vpn is up, the led is amber and when my vpn is down the led is white. It works, but I want this the other way around (white when vpn is up and amber when it's down)
I thought just change al the white to amber and al the amber to white right?
Then the led stays white in both states. Any ideas?
Little update;
I changed INTERFACE to DEVICE as shown in your added link. and changed white into amber en visa versa.
Now the white led is on if vpn is up and off when the vpn is down. So when the vpn (tun0) is down, it does stop the white led, but doesn't start the amber option.
config led
option default '0'
option sysfs 'pca963x:rango:white:wan'
option trigger 'netdev'
list mode 'link'
list mode 'tx'
list mode 'rx'
option dev 'tun0'
option name 'wan vpn up'
config led
option default '0'
option trigger 'netdev'
option sysfs 'pca963x:rango:amber:wan'
list mode 'link'
list mode 'tx'
list mode 'rx'
option name 'wan vpn down'
option dev 'eth1.2'
well my post was a bit messy, should be more clear now..
first let's define leds:
wan_amber netdev trigger for eth1.2 for main ISP connectivity
wan_white trigger none no interface (just a dummy definition so we can change it later)
config led
option default '0'
option trigger 'netdev'
option sysfs 'pca963x:rango:amber:wan'
option name 'wan_amber'
list mode 'link'
list mode 'tx'
list mode 'rx'
option dev 'eth1.2'
config led
option default '0'
option sysfs 'pca963x:rango:white:wan'
option name 'wan_white'
option trigger 'none'
then set up hotplug script vpn up white, vpn down amber:
Thanks for your reply, suddenly something maked sense to me
With INTERFACE or DEVICE = "tun0" it didn't work, but when I changed it with INTERFACE = "vpnclient" (the name of my interface) it workt. I was convinced that I already tried that yesterday, but nevertheless is works!