#define ID_MAX 2
 
 #define TOKEN_IFNAME "ifname"
+#define TOKEN_SCRIPT "ifup"
 
 #define TRANS_RAW "raw"
 #define TRANS_RAW_LEN strlen(TRANS_RAW)
 
 #define MAX_UN_LEN 107
 
+static const char padchar[] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
+static const char *template = "tapXXXXXX";
+
 /* This is very ugly and brute force lookup, but it is done
  * only once at initialization so not worth doing hashes or
  * anything more intelligent
        return err;
 }
 
+
 static struct vector_fds *user_init_tap_fds(struct arglist *ifspec)
 {
-       int fd = -1;
+       int fd = -1, i;
        char *iface;
        struct vector_fds *result = NULL;
+       bool dynamic = false;
+       char dynamic_ifname[IFNAMSIZ];
+       char *argv[] = {NULL, NULL, NULL, NULL};
 
        iface = uml_vector_fetch_arg(ifspec, TOKEN_IFNAME);
        if (iface == NULL) {
-               printk(UM_KERN_ERR "uml_tap: failed to parse interface spec\n");
-               goto tap_cleanup;
+               dynamic = true;
+               iface = dynamic_ifname;
+               srand(getpid());
        }
 
        result = uml_kmalloc(sizeof(struct vector_fds), UM_GFP_KERNEL);
        result->remote_addr_size = 0;
 
        /* TAP */
+       do {
+               if (dynamic) {
+                       strcpy(iface, template);
+                       for (i = 0; i < strlen(iface); i++) {
+                               if (iface[i] == 'X') {
+                                       iface[i] = padchar[rand() % strlen(padchar)];
+                               }
+                       }
+               }
+               fd = create_tap_fd(iface);
+               if ((fd < 0) && (!dynamic)) {
+                       printk(UM_KERN_ERR "uml_tap: failed to create tun interface\n");
+                       goto tap_cleanup;
+               }
+               result->tx_fd = fd;
+               result->rx_fd = fd;
+       } while (fd < 0);
 
-       fd = create_tap_fd(iface);
-       if (fd < 0) {
-               printk(UM_KERN_ERR "uml_tap: failed to create tun interface\n");
-               goto tap_cleanup;
+       argv[0] = uml_vector_fetch_arg(ifspec, TOKEN_SCRIPT);
+       if (argv[0]) {
+               argv[1] = iface;
+               run_helper(NULL, NULL, argv);
        }
-       result->tx_fd = fd;
-       result->rx_fd = fd;
+
        return result;
 tap_cleanup:
        printk(UM_KERN_ERR "user_init_tap: init failed, error %d", fd);
 {
        char *iface;
        struct vector_fds *result = NULL;
+       char *argv[] = {NULL, NULL, NULL, NULL};
 
        iface = uml_vector_fetch_arg(ifspec, TOKEN_IFNAME);
        if (iface == NULL) {
                        "uml_tap: failed to create paired raw socket: %i\n", result->rx_fd);
                goto hybrid_cleanup;
        }
+
+       argv[0] = uml_vector_fetch_arg(ifspec, TOKEN_SCRIPT);
+       if (argv[0]) {
+               argv[1] = iface;
+               run_helper(NULL, NULL, argv);
+       }
        return result;
 hybrid_cleanup:
        printk(UM_KERN_ERR "user_init_hybrid: init failed");
        int err = -ENOMEM;
        char *iface;
        struct vector_fds *result = NULL;
+       char *argv[] = {NULL, NULL, NULL, NULL};
 
        iface = uml_vector_fetch_arg(ifspec, TOKEN_IFNAME);
        if (iface == NULL)
                result->remote_addr = NULL;
                result->remote_addr_size = 0;
        }
+       argv[0] = uml_vector_fetch_arg(ifspec, TOKEN_SCRIPT);
+       if (argv[0]) {
+               argv[1] = iface;
+               run_helper(NULL, NULL, argv);
+       }
        return result;
 raw_cleanup:
        printk(UM_KERN_ERR "user_init_raw: init failed, error %d", err);