Bad ethernet interface name

Questions about networking.
In the Original Post please also include the output of inxi -FNzxx
Posts: 7
Joined: 08 May 2016 20:25

Bad ethernet interface name

Postby yolkati » 24 Nov 2016 03:29

I had a problem connecting to internet with cable, it turns out that dhclient didn't start automatically on that interface. After checcking the configuration I found:

Code: Select all

$ sudo ifconfig
eth1      Link encap:Ethernet  HWaddr 00:26:6c:a8:4a:a1  
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
I'm pretty sure that the interface name was eth0 because everything is configured for it. I mean:

Code: Select all

$ cat /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
allow-hotplug eth0
iface eth0 inet dhcp
The question is, how change the interface name?

User avatar
Posts: 1850
Joined: 13 Aug 2013 14:28
Location: Lincolnshire, UK

Re: Bad ethernet interface name

Postby Zill » 27 Nov 2016 12:57

I suggest you open a terminal and run the following command:

Code: Select all

cat /etc/udev/rules.d/70-persistent-net.rules
You should see your interfaces listed, along with their names at the end of each line.

Assuming that your machine currently has only one ethernet interface, you may see NAME="eth1" for this interface.

If this is the case, you can change the name as follows...

First, make a backup of your original file:

Code: Select all

sudo cp /etc/udev/rules.d/70-persistent-net.rules /etc/udev/rules.d/70-persistent-net.rules_bak
Then edit the file with the nano editor:

Code: Select all

sudo nano /etc/udev/rules.d/70-persistent-net.rules
Using the keyboard (not the mouse!), move the cursor to the line containing NAME="eth1" and change "eth1" to "eth0".

Save the file with "ctrl-o", then hit "ctrl-x" to exit nano.

Reboot the machine then open a terminal and run "sudo ifconfig" to verify that the eth0 interface is now listed correctly.

Return to “Networking”

Who is online

Users browsing this forum: No registered users and 2 guests