2

I known that I can give a specific name to the TUN interface using --dev option, but I didn't and I have now on a router machine something like a hundred client configs. with less clients I was able to dig the log to search for the name of the interface and link it to a named config file, but now there is too much activity.

I have played for a while with lsof and udevadm but I'm still not able to link a specific tunX interface with an OpenVPN instance.

I would like to know which OpenVPN instance/config-name/process is linked to a specific TUN, like tun4 for example, is there a solution for that?

slm
  • 369,824
dominix
  • 610

1 Answers1

1

So I came with a solution inspired by A.B comment.

$ ps ax | \
  awk '/[o]penvpn/{print $7" "$1;system("grep iff /proc/"$1"/fdinfo/*")}'` 

which give me both running config and it's linked TUN interface.

slm
  • 369,824
dominix
  • 610