title: How to set up a udev rule for ETH "link down"/"link up"?
body: <p>I like to switch on a green LED(connected through GPIOs), when eth0 is connected. When disconnected I like to switch the green LED of and a red one on.</p>
  
  <p>Thought that udev is maybe the right place for it. I created the simple demo rule:</p>
  
  <pre><code>KERNEL=="eth0", SUBSYSTEM=="net", ACTION=="add", RUN+="/sbin/set_BSPleds eth0 on"
  </code></pre>
  
  <p>This rule should call a script when the eth0 is added. It was never executed.
  After I was looking to the udev monitor by entering "udevadm monitor -k -u" at the shell. There were no events coming when I unplug/plug the lan cable.</p>
  
  <pre><code>root@sama5d3xek:/etc/udev/rules.d# udevadm monitor -k -uh0
  monitor will print the received events for:
  UDEV - the event which udev sends out after rule processing
  KERNEL - the kernel uevent
  
  root@sama5d3xek:/etc/udev/rules.d#
  </code></pre>
  
  <p>Seems that there are no uevents for eth0. The ethernet driver is provided my ATMEL. I am building a custom Linux by the help of Yocto. </p>
  
  <p>My question is, how to get the "link down"/"link up" events to udev?
  If it does not works with udev, what alternative way is the best?</p>