1

I tried to install a new Ubuntu Server, but after the installation when I want to configure the network it didn't work using the Interface file. so i tried as per duplicate to set up the network with netplanbut thqt fqils too.

netplan file:

# Let NetworkManager manage all devices on this system
network:
  version: 2
  renderer: networkd
  ethernets:
    enp3s0:
      addresses:
        - 193.171.201.236/27
      gateway4: 193.171.201.225
      nameservers:
          search: [pro2future.at, pro2future.eu]
          addresses: [140.78.2.62, 140.78.3.62]

How should I proceed?

Fabby
  • 34,341
  • 38
  • 97
  • 191
freshd
  • 23
  • 4
  • I suspect that your ethernet interface is not `eth0`; verify: `ip addr show` – chili555 Jul 23 '19 at 13:47
  • 2: eth0: mtu 1500 qdisc noop state DOWN group default qlen 1000 link/ether db:44:2b:19:d3:a1 brd ff:ff:ff:ff:ff:ff inet 193.171.201.236/27 brd 193.171.201.255 scope global eth0 valid_lft forever preferred_lft forever – freshd Jul 25 '19 at 09:45
  • @chili555 edited and voted to re-open. Your call though... **:-)** – Fabby Jul 26 '19 at 15:39
  • This file strongly implies that Network Manager is running here. Is that true? `ps aux | grep etwork` If ir is running, make your changes there and not netplan. As you have confirmed that your ethernet interface is eth0, why did you specify enp3s0?? Please clarify. – chili555 Jul 26 '19 at 17:54
  • i dont now; i normally set up the network in the interfaces file (etc/network/).. and i found the netplan option on my researches.. – freshd Jul 30 '19 at 09:39
  • but it does also not work if i change it to eth0.. :( – freshd Jul 30 '19 at 09:40

1 Answers1

0

I'm assuming you have already checkout out: https://help.ubuntu.com/community/NetworkManager

I have found it more friendly if you use 'renderer: NetworkManager'. Place the following into /etc/netplan/01-netcfg.yaml

network:
  version: 2
  renderer: NetworkManager
  ethernets:
    enp3s0:
      addresses: [ 193.171.201.236/27 ]
      gateway4: 193.171.201.225

Build /etc/NetworkManager/NetworkManager.conf something like this:

[main]
plugins=ifupdown,keyfile

[ifupdown]
managed=false

[device]
wifi.scan-rand-mac-address=no

[device-enp3s0]
match-device=interface-name:enp3s0
ignore-carrier=true
managed=true

[device-other]
match-device=type:ethernet
managed=false

Try a simple configuration first, then use 'ifconfig -a' to verify the configuration worked.

After you change the above netplan configuration file, restart the network:

netplan apply
systemctl restart network-manager

You may need to install the network-manager package, too.

apt-get install network-manager

You can also check the status with:

systemctl status network-manager
Cruz
  • 11
  • 3
  • Unfortunately, in my experience, I have never seen Network Manager and a fully populated netplan yaml file work properly. I suspect that this will be no exception. – chili555 Jul 27 '19 at 15:04
  • root@nextcloudserv:/etc/netplan# systemctl status network-manager ● NetworkManager.service - Network Manager Loaded: loaded (/lib/systemd/system/NetworkManager.service; enabled; vendor p Active: active (running) since Tue 2019-07-30 11:41:42 CEST; 50s ago Docs: man:NetworkManager(8) Main PID: 4575 (NetworkManager) Tasks: 3 (limit: 4915) CGroup: /system.slice/NetworkManager.service └─4575 /usr/sbin/NetworkManager --no-daemon – freshd Jul 30 '19 at 09:44
  • does not work either :( – freshd Jul 30 '19 at 09:44
  • It is working for me, but probably because I have some other configuration files that I am overlooking. I also have an /etc/NetworkManager.conf file that looks like this: [main] plugins=ifupdown,keyfile [ifupdown] managed=false [device] wifi.scan-rand-mac-address=no [device-ens33] match-device=interface-name:ens33 ignore-carrier=true managed=true [device-other] match-device=type:ethernet managed=false I think the key here is to make sure your device is listed as "managed=true". – Cruz Jul 31 '19 at 16:56