Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

As far as i know, there are 4 main types of network interfaces in linux: tun, tap, bridge and physical.

When i'm doing sys admin on machines running KVM, i usually come accross tap, bridge and physical interfaces on the same machine, without being able to tell them apart. I can't see any significant differences in ifconfig results, as in ip results.

How can i know if an interface is tun/tap/bridge/physical ?

note: I don't claim there is no other types of network interfaces in linux, but i know only this 4 ones

share|improve this question
up vote 9 down vote accepted

I don't think there's an easy way to distinguish them. Poking around in /sys/class/net I found the following distinctions:

  • Physical devices have a /sys/class/net/eth0/device symlink
  • Bridges have a /sys/class/net/br0/bridge directory
  • TUN and TAP devices have a /sys/class/net/tap0/tun_flags file
  • Bridges and loopback interfaces have 00:00:00:00:00:00 in /sys/class/net/lo/address
share|improve this answer
Good idea to look in /sys/ – user368507 Jun 17 '12 at 15:43
Virtual devices may also have such a device symlink: ls -l /sys/class/net/lan1/device Shows /sys/class/net/lan1/device -> ../../../dsa.0 on a router running OpenWrt (embedded Linux). I found that physical Interfaces have an Interrupt entry in the output of ifconfig. It is strange that such a simple question about an Interface seems so hard to answer. Investigation continues ... – Lumi Dec 1 '12 at 11:53

Regarding TUN and TAP devices: it is not enough to make the check above.

The reason is that there may be cases when we create a TUN device and (by error) call it tap10; or create a TAP device and name it tun10. So, how can I know if it is a tun device or a tap device, since both of course will have "tun_flags" entries?

The answer is to run ethtool -i tunOrTapDeviceName.

  • In case of a TAP device we will get: "bus-info: tap".
  • In case of a TUN device we will get: "bus-info: tun".


$ ethtool -i tapfffb93e9-6a
driver: tun
version: 1.6
bus-info: tap
supports-statistics: no
supports-test: no
supports-eeprom-access: no
supports-register-dump: no
supports-priv-flags: no
share|improve this answer
Isn't there a ethtool command to find if an interface it physical or bridge? – madCode Sep 3 '13 at 14:49
This answer is the more concise and general-purpose solution. – Joshua Miller Nov 15 '15 at 19:07
@madcode In the general case you want the driver field. bridges will show driver: bridge. Unfortunately tun/tap both show up as driver: tun, breaking the pattern :). – sourcejedi Jan 17 at 12:21
Yes this is the answer. The other one only tells you if the intf is virtual of not! You can name a tap interface with a name that gives no indication of the nature of the interface – MiniMe Mar 16 at 1:49

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.