3 ms·
`tun` lets a user-space process send/receive Layer 3 IP packets. `tap` lets a user-space process send/receive Layer 2 Ethernet frames. Ethernet is a layer bel
by tenebrisalietum 5y ago
`tun` lets a user-space process send/receive Layer 3 IP packets.
`tap` lets a user-space process send/receive Layer 2 Ethernet frames.
Ethernet is a layer below IP, so it doesn't care about IP addresses, in the same manner that Ethernet switches don't (it cares about MAC addresses instead).
If you want to do virtual switching, you'll use taps.
If you need to deal with a protocol that needs to use Ethernet broadcasts, like DHCP, you'll also use taps.
tap can be user accessible, it just needs to be part of a bridge (at least on Linux). The entire bridge consisting of one or more NICs will have an IP, and the individual interfaces of the bridge function like a switch.