3

I have just installed ubuntu server 18.04 on DELL Power Edge T300 but Ethernet card isn't recognized. On ifconfig and /etc/network/interfaces, I see lo.

server's display during boot : ip address, netmask and gateway. But on ubuntu (no graphical interface) nothing.

How can I configure my ethernet connection without reinstalling OS?

thanks!

  • Please don't add "solved" to the question. Accepting an answer is enough. – muru May 15 '18 at 14:37
10

Networking in Ubuntu server edition, versions 17.10 and later, is handled by netplan.

In order to set up netplan, you’ll need to know the interface name for your ethernet connection; it will probably be ens140 or eno1 or enp3s0 or some such.

Check again:

ifconfig

Or else:

sudo lshw -C network

In the latter case, it will be shown opposite ‘logical name.’ Here is a sample from my machine:

*-network                 
       description: Ethernet interface
       product: Ethernet Connection I217-LM
       vendor: Intel Corporation
       physical id: 19
       bus info: pci@0000:00:19.0
       logical name: enp0s25
       version: 04
       serial: 68:f7:28:ae:83:47
       capacity: 1Gbit/s
       width: 32 bits
       clock: 33MHz
       <snip>

So, in my case, I would use the interface designation enp0s25.

Next, edit your netplan file:

sudo nano /etc/netplan/01-netcfg.yaml 

Amend the file to read:

network:
  version: 2
  renderer: networkd
  ethernets:
    enp0s25:
      addresses: 
        - 192.168.100.40/22
      gateway4: 192.168.100.1
      nameservers:
          addresses: [8.8.8.8,8.8.4.4]

Of course, substitute your exact details here. Spacing, indentation, etc. are crucial. Proofread carefully. Save (Ctrl+o followed by Enter) and close (Ctrl+x) the text editor.

Next:

sudo netplan apply
sudo ip link set enp0s25 down
sudo ip link set enp0s25 up

Did you get the requested IP address?

ip addr show

Can you ping?

ping -c3 8.8.8.8
ping -c3 www.ubuntu.com

If you get ping returns, you are all set.

| improve this answer | |
  • Awesome! Glad it's working. If my answer has been helpful, please accept it: askubuntu.com/tour The searchers will appreciate it. – chili555 May 14 '18 at 18:34
  • What is the /22 for the addresses? And when I use this I get an error for a yaml not valid "Values are not allowed in this context" but I have a space between each element ":" and the value – vinid223 Feb 8 '19 at 23:38
  • I found out the problem, the indentation in the answer is not right for the nameservers and addresses, but thank you for that. The network on my server was just not working after a reboot – vinid223 Feb 8 '19 at 23:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.