How to create more TAP and TUN devices? - Linux

This is a discussion on How to create more TAP and TUN devices? - Linux ; My Ubuntu OS has only one tun device in /dev/net/tun and no tap. I would like to create more taps and tuns but I don't know how. In order to use mknod I need to know major and minor number ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: How to create more TAP and TUN devices?

  1. How to create more TAP and TUN devices?

    My Ubuntu OS has only one tun device in /dev/net/tun and no tap.
    I would like to create more taps and tuns but I don't know how.

    In order to use mknod I need to know major and minor number and I can't
    find documentation for the tun/tap module on what these numbers are: is
    there a standard way to proceed?

    The existing tun device is (major, minor) = (10, 200), so I can be sure
    that for additional tun/tap devices the major will be 10, but what about
    the minor? Can I be sure that 201 is supported? And will that be a tap
    or tun?

    modinfo on tun does not help me. I hoped in a parameter max_tun which
    would trigger udev creation but there is no such parameter.

    I even tried to use MAKEDEV and the result is:

    # MAKEDEV -n tun1
    /sbin/MAKEDEV: don't know how to make device "tun1"
    (tun instead of tun1 does the same)

    ow ow hold on...
    "MAKEDEV tap" works, however the result is not the one expected: major
    number is different from 10, see:

    # MAKEDEV -n tap
    udev active, devices will be created in /dev/.static/dev/
    create route c 36 0 root:root 0600
    create skip c 36 1 root:root 0600
    create fwmonitor c 36 3 root:root 0600
    create tap0 c 36 16 root:root 0600
    create tap1 c 36 17 root:root 0600
    create tap2 c 36 18 root:root 0600
    create tap3 c 36 19 root:root 0600
    create tap4 c 36 20 root:root 0600
    create tap5 c 36 21 root:root 0600
    create tap6 c 36 22 root:root 0600
    create tap7 c 36 23 root:root 0600
    create tap8 c 36 24 root:root 0600
    create tap9 c 36 25 root:root 0600
    create tap10 c 36 26 root:root 0600
    create tap11 c 36 27 root:root 0600
    create tap12 c 36 28 root:root 0600
    create tap13 c 36 29 root:root 0600
    create tap14 c 36 30 root:root 0600
    create tap15 c 36 31 root:root 0600

  2. Smile Re: How to create more TAP and TUN devices?

    Hi,I also want to create more TAP and TUN devices in a linux programe.I want the answer.Thanks

+ Reply to Thread