Interface name or ID of /dev/tun tunnels

Remi Denis-Courmont rdenis at simphalempin.com
Mon Jul 10 07:45:52 UTC 2006


   Hello,

Is there any clean way to find out the name, or better yet the ID (since ID
are immutable while names are not), of a tunnel device allocated from
/dev/tun ?

The question was already raised here, but I could find no answer:
http://lists.freebsd.org/pipermail/freebsd-net/2004-March/003338.html

If not, would it be possible to add, say, an ioctl() on tun/tap devices to
return their ID (which could be converted to a name via if_indextoname()), or
something similar? That should retain full backward compatibility...

Or maybe there is another way to configure the tunnel a la ifconfig with only
the file descriptor??

Thanks,

-- 
Remi Denis-Courmont
http://www.simphalempin.com/home/


More information about the freebsd-net mailing list