# 🐧Fixing Persistent Ethernet Interface Naming Problems on Debian Buster🦚

When dealing with multiple Ethernet controllers on Debian 10, interface naming issues can arise, particularly if two controllers have non-persistent interface names. This guide walks through resolving such issues by making interface names persistent based on MAC addresses.

---

## Problem Overview

In a typical scenario:

* **First controller**: Has six interfaces (e.g., `eth0` to `eth5`), each with consecutive MAC addresses.
    
* **Second controller**: Has two interfaces (`eth6` and `eth7`).
    

The problem arises when the second controller's interface names are not consistent across reboots. This can cause networking services to fail if they depend on specific interface names.

---

## Step-by-Step Solution

### 1\. Identify MAC Addresses

Use the `ip a` command to list all network interfaces and their MAC addresses:

```plaintext
ip a
```

Note the MAC addresses associated with the interfaces. For example:

* First controller: `eth0` through `eth5`, with MAC addresses like `04:2b:58:0f:8f:90` to `04:2b:58:0f:8f:95`.
    
* Second controller: `eth6` and `eth7`, with MAC addresses `04:2b:58:0f:9d:e0` and `04:2b:58:0f:9d:e1`.
    

### 3\. Create a Persistent Naming Rule

Define rules for persistent naming by creating a file in `/etc/udev/rules.d/`:

```plaintext
sudo nano /etc/udev/rules.d/70-persistent-net.rules
```

Add the following rules, replacing the example MAC addresses with the actual addresses from your system:

```plaintext
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="04:2b:58:0f:9d:e0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth6"
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="04:2b:58:0f:9d:e1", ATTR{type}=="1", KERNEL=="eth*", NAME="eth7"
```

### 4\. Reboot the System

Reboot to apply the new udev rules:

```plaintext
sudo reboot
```

### 5\. Verify Persistent Interface Names

After reboot, verify that the interfaces `eth6` and `eth7` have been correctly assigned to the MAC addresses:

```plaintext
ip a
```

### 6\. Double-Check with `ethtool`

Verify the MAC address assignments to ensure accuracy:

```plaintext
sudo ethtool -i eth6
sudo ethtool -i eth7
```

This confirms the interface is correctly linked to the MAC address. If the interface are SFP/+ then you should also be able to query the module details.

Confirm that the names are consistent and match the MAC addresses configured in the udev rules.

---

## Troubleshooting

* If the interfaces do not appear as expected, check the udev rule syntax and ensure no conflicts exist in `/etc/udev/rules.d/`.
    
* Use `udevadm` to debug:
    
    ```plaintext
    sudo udevadm test /sys/class/net/eth6
    sudo udevadm test /sys/class/net/eth7
    ```
    

---

## Wrap

By defining persistent naming rules based on MAC addresses, you can ensure consistent interface names for your network controllers. This solution is robust for systems with multiple Ethernet controllers, providing stability for networking configurations across reboots.

---
