added support for tun interfaces (tested on linux)