diff --git a/master/debug.c b/master/debug.c
index 98c0f2c3fcdc87f2a899d4e639e8e10f46cf10aa..99b45612ae3dddbe60ced77fb70afc5333b2b5c9 100644
--- a/master/debug.c
+++ b/master/debug.c
@@ -59,7 +59,10 @@ struct net_device_stats *ec_dbgdev_stats(struct net_device *);
    Initializes the debug object, creates a net_device and registeres it.
 */
 
-int ec_debug_init(ec_debug_t *dbg /**< debug object */)
+int ec_debug_init(
+        ec_debug_t *dbg, /**< debug object */
+        const char *name /**< interface name */
+        )
 {
     int result;
 
@@ -67,7 +70,7 @@ int ec_debug_init(ec_debug_t *dbg /**< debug object */)
     memset(&dbg->stats, 0, sizeof(struct net_device_stats));
 
     if (!(dbg->dev =
-          alloc_netdev(sizeof(ec_debug_t *), "ec%d", ether_setup))) {
+          alloc_netdev(sizeof(ec_debug_t *), name, ether_setup))) {
         EC_ERR("Unable to allocate net_device for debug object!\n");
         goto out_return;
     }
diff --git a/master/debug.h b/master/debug.h
index df5ce231bdb1d05d947c80dadfd973dbfb7404fd..bf8ad278d09beadd4679682166e64f3a45b2e84a 100644
--- a/master/debug.h
+++ b/master/debug.h
@@ -56,7 +56,7 @@ ec_debug_t;
 
 /*****************************************************************************/
 
-int ec_debug_init(ec_debug_t *);
+int ec_debug_init(ec_debug_t *, const char *);
 void ec_debug_clear(ec_debug_t *);
 void ec_debug_send(ec_debug_t *, const uint8_t *, size_t);
 
diff --git a/master/device.c b/master/device.c
index 47fa8c03f1968a64de5b95e9458782929918e9be..301057c16753afed4787aa18e925019aec56ac4b 100644
--- a/master/device.c
+++ b/master/device.c
@@ -57,10 +57,22 @@ int ec_device_init(ec_device_t *device, /**< EtherCAT device */
         ec_master_t *master /**< master owning the device */
         )
 {
+#ifdef EC_DEBUG_IF
+    char ifname[10];
+    char mb = 'x';
+#endif
+
     device->master = master;
 
 #ifdef EC_DEBUG_IF
-    if (ec_debug_init(&device->dbg)) {
+    if (device == &master->main_device)
+        mb = 'm';
+    else if (device == &master->backup_device)
+        mb = 'b';
+
+    sprintf(ifname, "ecdbg%c%u", mb, master->index);
+
+    if (ec_debug_init(&device->dbg, ifname)) {
         EC_ERR("Failed to init debug device!\n");
         goto out_return;
     }