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
  • 20,241
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,359
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
  • 24,109
Rauf
  • 1