6

I recently installed Ubuntu Server 16.04 onto a new hard drive. I had to install it while connected via USB on a different computer (due to the installer not able to detect a keyboard). I attached the hard drive via SATA to the new server. I can now boot and it sees the keyboard.

I however have no network.

I am missing the /etc/udev/rules.d/70-persistent-net.rules file.

When I execute sudo lshw -class network I get the following;

*-network DISABLED
description: Ethernet interface

When I execute ifconfig -a I get the following;

eno1 Link encap:Ethernet HWaddr 9c:5c:8e:95:44:6d
...
Arronical
  • 19,893
Fosol
  • 61

2 Answers2

2

my copy of that file looks like this :

# file was automatically generated by the /lib/udev/write_net_rules
# program, run by the persistent-net-generator.rules rules file.
#
# You can modify it, as long as you keep each rule on a single
# line, and change only the value of the NAME= key.

# PCI device 0x10ec:0x8168 (r8169) 
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="ur::ma:ca:dd:re:ss", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

yours will need adjustment to you mac address and your device but as it says at the top of the file its generated by /lib/udev/write_net_rules

Amias
  • 5,246
  • 1
    Hmm, I don't even have a "/lib/udev/write_net_rules" file... I'm not trying to do anything complicated yet... All I am trying to do is install a base Ubuntu OS on a new computer. – Fosol May 05 '16 at 16:30
  • it sounds to me like the differences between these two systems might be a bit much or the install has failed elsewhere. I'm sure it would be easier to find another method of keyboard attachment than to debug missing parts of udev. – Amias May 05 '16 at 16:34
  • @Fosol I have the same issue, no /lib/udev/write_net_rules. – fadedbee Dec 04 '19 at 10:27
0
sudo udevadm trigger --subsystem-match=net --action=add

will generate /etc/udev/rules.d/70-persistent-net.rules.

Run udevadm trigger --help for more options.

edwinksl
  • 23,789
Rauf
  • 1