Missing LED trigger

Hello everybody,

I just wanted to customize the setup of my LEDs from my Linksys WRT3200acm. I stumbled across this wiki articel: https://openwrt.org/docs/guide-user/base-system/led_configuration

However, I am absolutely missing the mentioned trigger, which is necessary for the configuration I'd like to have (netfilter-ssh):

root@OpenWrt:~# cat /sys/class/leds/pca963x:rango:amber:wan/trigger
[none] usbport mmc0 timer disk-activity ide-disk default-on netdev heartbeat phy0rx phy0tx phy0assoc phy0radio phy1rx phy1tx phy1assoc phy1radio

This trigger is not present for any of the systems LEDs:

root@OpenWrt:~# cat /sys/class/leds/*/trigger       
none usbport [mmc0] timer disk-activity ide-disk default-on netdev heartbeat phy0rx phy0tx phy0assoc phy0radio phy1rx phy1tx phy1assoc phy1radio 
[none] usbport mmc0 timer disk-activity ide-disk default-on netdev heartbeat phy0rx phy0tx phy0assoc phy0radio phy1rx phy1tx phy1assoc phy1radio 
[none] usbport mmc0 timer disk-activity ide-disk default-on netdev heartbeat phy0rx phy0tx phy0assoc phy0radio phy1rx phy1tx phy1assoc phy1radio 
[none] usbport mmc0 timer disk-activity ide-disk default-on netdev heartbeat phy0rx phy0tx phy0assoc phy0radio phy1rx phy1tx phy1assoc phy1radio 
[none] usbport mmc0 timer disk-activity ide-disk default-on netdev heartbeat phy0rx phy0tx phy0assoc phy0radio phy1rx phy1tx phy1assoc phy1radio 
[none] usbport mmc0 timer disk-activity ide-disk default-on netdev heartbeat phy0rx phy0tx phy0assoc phy0radio phy1rx phy1tx phy1assoc phy1radio 
[none] usbport mmc0 timer disk-activity ide-disk default-on netdev heartbeat phy0rx phy0tx phy0assoc phy0radio phy1rx phy1tx phy1assoc phy1radio 
[none] usbport mmc0 timer disk-activity ide-disk default-on netdev heartbeat phy0rx phy0tx phy0assoc phy0radio phy1rx phy1tx phy1assoc phy1radio 
[none] usbport mmc0 timer disk-activity ide-disk default-on netdev heartbeat phy0rx phy0tx phy0assoc phy0radio phy1rx phy1tx phy1assoc phy1radio 
[none] usbport mmc0 timer disk-activity ide-disk default-on netdev heartbeat phy0rx phy0tx phy0assoc phy0radio phy1rx phy1tx phy1assoc phy1radio 
[none] usbport mmc0 timer disk-activity ide-disk default-on netdev heartbeat phy0rx phy0tx phy0assoc phy0radio phy1rx phy1tx phy1assoc phy1radio 
[none] usbport mmc0 timer disk-activity ide-disk default-on netdev heartbeat phy0rx phy0tx phy0assoc phy0radio phy1rx phy1tx phy1assoc phy1radio 
none [usbport] mmc0 timer disk-activity ide-disk default-on netdev heartbeat phy0rx phy0tx phy0assoc phy0radio phy1rx phy1tx phy1assoc phy1radio 
none [usbport] mmc0 timer disk-activity ide-disk default-on netdev heartbeat phy0rx phy0tx phy0assoc phy0radio phy1rx phy1tx phy1assoc phy1radio 
none [usbport] mmc0 timer disk-activity ide-disk default-on netdev heartbeat phy0rx phy0tx phy0assoc phy0radio phy1rx phy1tx phy1assoc phy1radio 
none usbport mmc0 timer disk-activity ide-disk default-on [netdev] heartbeat phy0rx phy0tx phy0assoc phy0radio phy1rx phy1tx phy1assoc phy1radio 
[none] usbport mmc0 timer disk-activity ide-disk default-on netdev heartbeat phy0rx phy0tx phy0assoc phy0radio phy1rx phy1tx phy1assoc phy1radio 
[none] usbport mmc0 timer disk-activity ide-disk default-on netdev heartbeat phy0rx phy0tx phy0assoc phy0radio phy1rx phy1tx phy1assoc phy1radio 
none usbport mmc0 timer [disk-activity] ide-disk default-on netdev heartbeat phy0rx phy0tx phy0assoc phy0radio phy1rx phy1tx phy1assoc phy1radio 
[none] usbport mmc0 timer disk-activity ide-disk default-on netdev heartbeat phy0rx phy0tx phy0assoc phy0radio phy1rx phy1tx phy1assoc phy1radio 
[none] usbport mmc0 timer disk-activity ide-disk default-on netdev heartbeat phy0rx phy0tx phy0assoc phy0radio phy1rx phy1tx phy1assoc phy1radio 
root@OpenWrt:~# 

However the necessary packages (+ additional packages I thought might be missing, which I came up with while trying to find an answer) are installed:

root@OpenWrt:~# opkg install kmod-ipt-led
Package kmod-ipt-led (4.14.63-1) installed in root is up to date.
root@OpenWrt:~# opkg install iptables-mod-led                  
Package iptables-mod-led (1.6.2-1) installed in root is up to date.
root@OpenWrt:~# opkg install kmod-ipt-led                            
Package kmod-ipt-led (4.14.63-1) installed in root is up to date.
root@OpenWrt:~# 

Any ideas what the issue might be?

Thanks!

EDIT:
By the way: Manually adding netfilter-ssh via echo (as shown in the wiki article) doesn't work as well - I tried it already :slight_smile: (even tried to edit the sys file directly - same result)

nobody? :slight_smile:

  • You don't explain what LED you're trying to customize...I'm guessing you want to change the behavior of the switch WAN LED?
  • from your post above, there are LEDs available
  • you don't state what event you're trying to cause a trigger upon
  • If you're referring to an LED on the switch, it's likely not able to be customized

I'm totally lost as to why you think these would make a light work.

WFM on a mamba, an example using banIP :

In file /etc/config/system add stanza:

config led 'led_wps_amber'
	option name 'banIP Hit'
	option sysfs 'mamba:amber:wps'
	option trigger 'netfilter-banip'

in file /etc/firewall.user add:

iptables -I banIP -p all -j LED --led-trigger-id banip --led-delay 1000

in directory /sys/class/leds/mamba:amber:wps issue:

echo netfilter-banip > trigger

a cat trigger yields:

none usbport timer disk-activity ide-disk default-on netdev rfkill-any phy0rx phy0tx phy0assoc phy0radio phy1rx phy1tx phy1assoc phy1radio [netfilter-banip] 

with WPS LED flashing amber on a hit.

1 Like

Hello lleachii,
thank your for investigating this. Please find my answers below.

  • You don't explain what LED you're trying to customize...I'm guessing you want to change the behavior of the switch WAN LED?

I would have assumed, that it does not matter, which LED I want to customize, as I can see that the triggers are equal on each of them; In case it does: /sys/class/leds/rango:white:sata

  • from your post above, there are LEDs available

Correct

  • you don't state what event you're trying to cause a trigger upon

I want to use netfilter-ssh (as stated in my initial post), but the trigger is not available, as seen in the initial post. I simply want the LED to be steady, when an SSH connection to the router is active.

  • If you're referring to an LED on the switch, it's likely not able to be customized

No, I don't want to configure an LED on the switch (assuming switch-LEDs are the ones showing the connectivity of WAN/LAN ports)

I'm totally lost as to why you think these would make a light work.

It is not about the LED, but about the missing trigger

1 Like

Hello anomeome,

thank you for taking time to provide an example.

I totally understood the general procedure of how to achieve it. The problem simply is, that these (=netfilter-ssh or for example your netfilter-banip) triggers are not available for any LED.
Please see the following example output for one LED:

root@OpenWrt:/sys/devices/platform/gpio-leds/leds/rango:white:sata# cat trigger
none usbport mmc0 timer disk-activity [ide-disk] default-on netdev heartbeat phy0rx phy0tx phy0assoc phy0radio phy1rx phy1tx phy1assoc phy1radio 
root@OpenWrt:/sys/devices/platform/gpio-leds/leds/rango:white:sata# echo 'netfilter-banip' > trigger
ash: write error: Invalid argument
root@OpenWrt:/sys/devices/platform/gpio-leds/leds/rango:white:sata# cat trigger 
none usbport mmc0 timer disk-activity [ide-disk] default-on netdev heartbeat phy0rx phy0tx phy0assoc phy0radio phy1rx phy1tx phy1assoc phy1radio 
root@OpenWrt:/sys/devices/platform/gpio-leds/leds/rango:white:sata# echo 'netfilter-ssh' > trigger
ash: write error: Invalid argument
root@OpenWrt:/sys/devices/platform/gpio-leds/leds/rango:white:sata# cat trigger
none usbport mmc0 timer disk-activity [ide-disk] default-on netdev heartbeat phy0rx phy0tx phy0assoc phy0radio phy1rx phy1tx phy1assoc phy1radio

So, using actually available triggers:

root@OpenWrt:/sys/devices/platform/gpio-leds/leds/rango:white:sata# echo 'heartbeat' > trigger
root@OpenWrt:/sys/devices/platform/gpio-leds/leds/rango:white:sata# cat trigger 
none usbport mmc0 timer disk-activity ide-disk default-on netdev [heartbeat] phy0rx phy0tx phy0assoc phy0radio phy1rx phy1tx phy1assoc phy1radio 
root@OpenWrt:/sys/devices/platform/gpio-leds/leds/rango:white:sata# echo 'ide-disk' > trigger
root@OpenWrt:/sys/devices/platform/gpio-leds/leds/rango:white:sata# cat trigger 
none usbport mmc0 timer disk-activity [ide-disk] default-on netdev heartbeat phy0rx phy0tx phy0assoc phy0radio phy1rx phy1tx phy1assoc phy1radio 

As you can see manually setting the LED to a trigger, which is available for the LED, works perfectly fine.
My problem is basically, that I am missing these netfilter-* triggers and I don't understand whether it is possible to have them (or whether it is actually depended on anything particular [like hardware model or whatever - which I wouldn't assume however]) and if so, how to "get" them.

I hope I could make my point now.

Thanks again for your answers @anomeome and @lleachii

Yes, I understood that from the OP, which is why I gave an example with the [netfilter-banip] default addition to the LED trigger file. That is something I manually set and use on a mamba when I need the facility.

You do not "get" the netfilter-xxx triggers, you have to add them as a new default with the echo statement and a xxxx of your choosing. But, there is a bit of a chicken and egg issue, you cannot add the new netfilter-xxxx trigger to the LED trigger file until the iptable -j LED --led-trigger-id xxxx addition exists; I do not know why this is the case.

1 Like