linux - Tap interfaces and /dev/net/tun device, using ip tuntap command -


i'm using ip tuntap create tap interface, this:

$ sudo ip tuntap add mode tap tap0 

afterwards, set interface , address common ip commands. can see interface , addressed simple ifconfig.

now, told teacher creating tap interface (named tap0 in case), find /dev/net/tap0 node, , able write in or read it. however, can't find it. "just" have /dev/net/tun.

do have deal tun node, or supposed have tap0 node?

it's been long time since question asked, thought idea post actual answer future reference.

tap interfaces, tun interfaces, virtual interfaces provided in-kernel tun/tap device driver. interface driver provides character device /dev/net/tun mentioned in question.

by issuing:

$ sudo ip tuntap add mode tap tap0 

we instruct ip tuntap create network interface named tap0, accomplished using proper ioctl(2) calls on aforementioned device file /dev/net/tun talk underlying tun/tap device driver, can observe in ip tuntap's source code.

one of these ioctl(2) calls (the 1 tunsetiff option, called first) returns file descriptor associated new virtual interface created , can used processes.


summing up:

do have deal tun node, or supposed have tap0 node?

the /dev/net/tun device file used starting point create both tap , tun interfaces, userspace utilities iproute2. in context of question, there's no need deal ip tuntap job us.

any /dev/net/tap0 device files not needed or expected created processes use tap interfaces.


Comments

Popular posts from this blog

Hatching array of circles in AutoCAD using c# -

ios - UITEXTFIELD InputView Uipicker not working in swift -

Python Pig Latin Translator -