diff -ruN openvpn-1.3.2-orig/openvpn.c openvpn-1.3.2/openvpn.c
--- openvpn-1.3.2-orig/openvpn.c	Mon Oct 21 03:46:52 2002
+++ openvpn-1.3.2/openvpn.c	Mon Mar 10 14:06:03 2003
@@ -626,7 +626,7 @@
 		     MAX_RW_SIZE_TUN (&frame));
 
       /* open the tun device */
-      open_tun (options->dev, options->dev_type, options->dev_node, options->tun_ipv6, tuntap);
+      open_tun (options->dev, options->dev_type, options->dev_node, options->dev_name, options->tun_ipv6, tuntap);
 
       /* do ifconfig */  
       if (ifconfig_order() == IFCONFIG_AFTER_TUN_OPEN)
@@ -1510,7 +1510,7 @@
 #endif
 	    )
 	  msg (M_FATAL, "Options error: options --mktun or --rmtun should only be used together with --dev");
-	tuncfg (options.dev, options.dev_type, options.dev_node,
+	tuncfg (options.dev, options.dev_type, options.dev_node, options.dev_name,
 		options.tun_ipv6, options.persist_mode);
 	goto exit;
       }
diff -ruN openvpn-1.3.2-orig/options.c openvpn-1.3.2/options.c
--- openvpn-1.3.2-orig/options.c	Sat Oct 19 23:26:11 2002
+++ openvpn-1.3.2/options.c	Mon Mar 10 14:21:06 2003
@@ -67,6 +67,8 @@
   "                  does not begin with \"tun\" or \"tap\".\n"
   "--dev-node node : Explicitly set the device node rather than using\n"
   "                  /dev/net/tun, /dev/tun, /dev/tap, etc.\n"
+  "--dev-name name : Explicitly set the device name rather than using\n"
+  "                  tun0, tun1, etc.\n"
   "--tun-ipv6      : Build tun link capable of forwarding IPv6 traffic.\n"
   "--ifconfig l r  : Configure tun device to use IP address l as a local\n"
   "                  endpoint and r as a remote endpoint.  l & r should be\n"
@@ -287,6 +289,7 @@
   SHOW_STR (dev);
   SHOW_STR (dev_type);
   SHOW_STR (dev_node);
+  SHOW_STR (dev_name);
   SHOW_BOOL (tun_ipv6);
   SHOW_STR (ifconfig_local);
   SHOW_STR (ifconfig_remote);
@@ -650,6 +653,11 @@
     {
       ++i;
       options->dev_node = p2;
+    }
+  else if (streq (p1, "dev-name") && p2)
+    {
+      ++i;
+      options->dev_name = p2;
     }
   else if (streq (p1, "tun-ipv6"))
     {
diff -ruN openvpn-1.3.2-orig/options.h openvpn-1.3.2/options.h
--- openvpn-1.3.2-orig/options.h	Sat Oct 19 22:25:46 2002
+++ openvpn-1.3.2/options.h	Mon Mar 10 14:04:55 2003
@@ -53,6 +53,7 @@
   const char *dev;
   const char *dev_type;
   const char *dev_node;
+  const char *dev_name;
   const char *ifconfig_local;
   const char *ifconfig_remote;
   int shaper;
diff -ruN openvpn-1.3.2-orig/tun.c openvpn-1.3.2/tun.c
--- openvpn-1.3.2-orig/tun.c	Mon Oct 14 22:19:03 2002
+++ openvpn-1.3.2/tun.c	Mon Mar 10 14:14:43 2003
@@ -248,7 +248,7 @@
 }
 
 static void
-open_tun_generic (const char *dev, const char *dev_node,
+open_tun_generic (const char *dev, const char *dev_node, const char *dev_name,
 		  bool ipv6, bool ipv6_explicitly_supported,
 		  struct tuntap *tt)
 {
@@ -273,6 +273,9 @@
       set_nonblock (tt->fd);
       msg (M_INFO, "tun/tap device %s opened", tunname);
       strncpynt (tt->actual, dev, sizeof (tt->actual));
+
+      if (dev_name)
+	msg (M_WARN, "Cannot rename dev %s to %s", dev, dev_name);
     }
 }
 
@@ -294,9 +297,11 @@
 #define LINUX_IPV6 0
 #endif
 
+#include <linux/sockios.h>
+
 void
-open_tun (const char *dev, const char *dev_type, const char *dev_node, bool ipv6,
-	  struct tuntap *tt)
+open_tun (const char *dev, const char *dev_type, const char *dev_node,
+	  const char *dev_name, bool ipv6, struct tuntap *tt)
 {
   struct ifreq ifr;
 
@@ -336,22 +341,41 @@
 	strncpynt (ifr.ifr_name, dev, IFNAMSIZ);
 
       if (ioctl (tt->fd, TUNSETIFF, (void *) &ifr) < 0)
-	msg (M_ERR, "Cannot ioctl TUNSETIFF %s", dev);
+	msg (M_WARN, "Cannot ioctl TUNSETIFF %s", dev);
 
       set_nonblock (tt->fd);
       msg (M_INFO, "tun/tap device %s opened", ifr.ifr_name);
       strncpynt (tt->actual, ifr.ifr_name, sizeof (tt->actual));
+
+      if (dev_name) {
+	struct ifreq	r;
+	int		fd;
+
+	if((fd = socket(PF_INET, SOCK_DGRAM, 0)) < 0)
+		msg (M_WARN, "Cannot open control_fd", dev);
+	else {
+      		strncpynt (r.ifr_name, tt->actual, IFNAMSIZ);
+      		strncpynt (r.ifr_newname, dev_name, IFNAMSIZ);
+
+		if(ioctl(fd, SIOCSIFNAME, &r) < 0)
+			msg (M_WARN, "Cannot ioctl SIOCSIFNAME %s", dev);
+		else
+      			strncpynt (tt->actual, dev_name, sizeof (tt->actual));
+
+		close(fd);
+	}
+      }
     }
 }
 
 #ifdef TUNSETPERSIST
 
 void
-tuncfg (const char *dev, const char *dev_type, const char *dev_node, bool ipv6, int persist_mode)
+tuncfg (const char *dev, const char *dev_type, const char *dev_node, const char *dev_name, bool ipv6, int persist_mode)
 {
   struct tuntap tt;
 
-  open_tun (dev, dev_type, dev_node, ipv6, &tt);
+  open_tun (dev, dev_type, dev_node, dev_name, ipv6, &tt);
   if (ioctl (tt.fd, TUNSETPERSIST, persist_mode) < 0)
     msg (M_ERR, "Cannot ioctl TUNSETPERSIST(%d) %s", persist_mode, dev);
   close_tun (&tt);
@@ -363,10 +387,10 @@
 #else
 
 void
-open_tun (const char *dev, const char *dev_type, const char *dev_node, bool ipv6,
+open_tun (const char *dev, const char *dev_type, const char *dev_node, const char *dev_name, bool ipv6,
 	  struct tuntap *tt)
 {
-  open_tun_generic (dev, dev_node, ipv6, false, tt);
+  open_tun_generic (dev, dev_node, dev_name, ipv6, false, tt);
 }
 
 #endif /* HAVE_LINUX_IF_TUN_H */
@@ -436,8 +460,8 @@
 #elif defined(TARGET_SOLARIS)
 
 void
-open_tun (const char *dev, const char *dev_type, const char *dev_node, bool ipv6,
-	  struct tuntap *tt)
+open_tun (const char *dev, const char *dev_type, const char *dev_node,
+	  const char *dev_name, bool ipv6, struct tuntap *tt)
 {
   int if_fd, muxid, ppa = -1;
   struct ifreq ifr;
@@ -528,6 +552,9 @@
     }
 
   set_nonblock (tt->fd);
+
+  if (dev_name)
+    msg (M_WARN, "Cannot rename dev %s to %s", dev, dev_name);
 }
 
 /*
@@ -581,10 +608,10 @@
 #elif defined(TARGET_OPENBSD)
 
 void
-open_tun (const char *dev, const char *dev_type, const char *dev_node, bool ipv6,
-	  struct tuntap *tt)
+open_tun (const char *dev, const char *dev_type, const chart *dev_name,
+	  const char *dev_node, bool ipv6, struct tuntap *tt)
 {
-  open_tun_generic (dev, dev_node, ipv6, false, tt);
+  open_tun_generic (dev, dev_node, dev_name, ipv6, false, tt);
 }
 
 void
@@ -633,10 +660,10 @@
 #elif defined(TARGET_FREEBSD)
 
 void
-open_tun (const char *dev, const char *dev_type, const char *dev_node, bool ipv6,
-	  struct tuntap *tt)
+open_tun (const char *dev, const char *dev_type, const char *dev_node,
+	  const char *dev_name, bool ipv6, struct tuntap *tt)
 {
-  open_tun_generic (dev, dev_node, ipv6, false, tt);
+  open_tun_generic (dev, dev_node, dev_name, ipv6, false, tt);
 
   if (tt->fd >= 0)
     {
@@ -669,10 +696,10 @@
 #else /* generic */
 
 void
-open_tun (const char *dev, const char *dev_type, const char *dev_node, bool ipv6,
-	  struct tuntap *tt)
+open_tun (const char *dev, const char *dev_type, const char *dev_node,
+	  const char *dev_name, bool ipv6, struct tuntap *tt)
 {
-  open_tun_generic (dev, dev_node, ipv6, false, tt);
+  open_tun_generic (dev, dev_node, dev_name, ipv6, false, tt);
 }
 
 void
diff -ruN openvpn-1.3.2-orig/tun.h openvpn-1.3.2/tun.h
--- openvpn-1.3.2-orig/tun.h	Fri Oct  4 01:26:27 2002
+++ openvpn-1.3.2/tun.h	Mon Mar 10 14:16:08 2003
@@ -43,15 +43,15 @@
 
 void clear_tuntap (struct tuntap *tuntap);
 
-void open_tun (const char *dev, const char *dev_type, const char *dev_node, bool ipv6,
-	       struct tuntap *tt);
+void open_tun (const char *dev, const char *dev_type, const char *dev_node,
+	  const char *dev_name, bool ipv6, struct tuntap *tt);
 void close_tun (struct tuntap *tt);
 
 int write_tun (struct tuntap* tt, uint8_t *buf, int len);
 int read_tun (struct tuntap* tt, uint8_t *buf, int len);
 
-void tuncfg (const char *dev, const char *dev_type, const char *dev_node, bool ipv6,
-	     int persist_mode);
+void tuncfg (const char *dev, const char *dev_type, const char *dev_node,
+	  const char *dev_name, bool ipv6, int persist_mode);
 
 void do_ifconfig (const char *dev, const char *dev_type,
 		  const char *ifconfig_local, const char *ifconfig_remote,
