title: TUN interface created from C not showing up in ifconfig output
body: <p>I have written the following function that is supposed to create a TUN interface named &quot;my_tun&quot; on Linux:</p>
  <pre><code>int tun_open()
  {
    int fd;
    if ((fd = open(&quot;/dev/net/tun&quot;, O_RDWR)) == -1) {
      return -1;
    }
  
    struct ifreq ifr;
    strncpy(ifr.ifr_name, &quot;my_tun&quot;, IFNAMSIZ);
    ifr.ifr_flags = IFF_TUN | IFF_NO_PI;
  
    if (ioctl(fd, TUNSETIFF, &amp;ifr) == -1) {
      return -1;
    }
  
    return fd;
  }
  </code></pre>
  <p>I'm testing it by running it inside a Ubuntu docker container started with <code>--cap-add NET_ADMIN</code>. Inside this docker container I first execute:</p>
  <pre><code>mkdir /dev/net
  mknod /dev/net/tun c 10 200
  </code></pre>
  <p>And the run my function. The latter does not fail yet afterwards <code>ifconfig</code> does not show a TUN interface, only an ethernet and a loopback interface. What am I doing wrong?</p>