3

EDIT: This is precise situation after I took the code to rename the interfaces.

This is my netplan configuration file:

network:
  version: 2
  renderer: networkd
  ethernets:
    eno1:
      dhcp4: no
      dhcp6: no
      addresses: [192.168.1.93/24]
      gateway4: 192.168.1.91
      nameservers:
        addresses: [8.8.8.8, 8.8.4.4]

Here is the output of ip addr ls

 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
 2: rename2: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
    link/ether 00:1e:67:d6:33:24 brd ff:ff:ff:ff:ff:ff
 3: eno1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000
   link/ether 00:1e:67:d6:33:25 brd ff:ff:ff:ff:ff:ff

When I run sudo netplan --debug generate I get this output:

 ** (generate:1571): DEBUG: 00:08:01.444: Processing input file //etc/netplan/10-systemd-networkd-eth.yaml..
 ** (generate:1571): DEBUG: 00:08:01.444: starting new processing pass
 ** (generate:1571): DEBUG: 00:08:01.444: eno1: setting default backend to 1
 ** (generate:1571): DEBUG: 00:08:01.444: Generating output files..
 ** (generate:1571): DEBUG: 00:08:01.444: NetworkManager: definition eno1 is not for us (backend 1)

Here is the output of systemctl status systemd-networkd :

systemd-networkd.service - Network Service
   Loaded: loaded (/lib/systemd/system/systemd-networkd.service; enabled; vendor preset: enabled)
   Active: active (running) since Wed 2018-08-29 23:31:20 IST; 1h 1min ago
     Docs: man:systemd-networkd.service(8)
 Main PID: 570 (systemd-network)
   Status: "Processing requests..."
    Tasks: 1 (limit: 4915)
   CGroup: /system.slice/systemd-networkd.service
           └─570 /lib/systemd/systemd-networkd

Aug 29 23:31:19 august2018 systemd[1]: Starting Network Service...
Aug 29 23:31:20 august2018 systemd-networkd[570]: Enumeration completed
Aug 29 23:31:20 august2018 systemd[1]: Started Network Service.
Aug 29 23:35:01 august2018 systemd-networkd[570]: eno1: Gained carrier
Aug 29 23:35:03 august2018 systemd-networkd[570]: eno1: Gained IPv6LL 
Sunny
  • 381
  • 1
  • 6
  • 16

1 Answers1

1

You've used the literal string ethMac where the actual interface name is expected. Change this to the interface name, which you can learn by running the command ip link.

Michael Hampton
  • 244,070
  • 43
  • 506
  • 972
  • That is the interface name. I changed it and **ip addr ls** displays this name. – Sunny Aug 29 '18 at 17:40
  • 3
    @Sam Your interface name is actually `ethMac`? Literally? This I gotta see. What sort of system is this? How did it get that bizarre name? Is that something you did? – Michael Hampton Aug 29 '18 at 17:43
  • I have been changing the interface name using this in /etc/udev/rules.d/...: SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="...mac address...",ATTR{dev_id}=="0x0", ATTR{type}=="1", NAME="eth0" – Sunny Aug 29 '18 at 17:53
  • 2
    Well, that explains that. Obviously I can't recommend that; you really should use the predictable interface names the system comes up with on its own. – Michael Hampton Aug 29 '18 at 18:01
  • I reset the interface names to default and tried. I have given precise copy-pasted situation above. Any suggestions? – Sunny Aug 29 '18 at 18:48
  • Wait, is systemd-networkd even installed? The log entry says NetworkManager is _not_ configuring the interface, and the netplan configuration says that systemd-networkd should do it. – Michael Hampton Aug 29 '18 at 18:53
  • I have updated the question by providing output of **systemctl status systemd-networkd** – Sunny Aug 29 '18 at 19:07
  • @Sam Let's go back to: What sort of system is this? How did you install it? Was it a release upgrade? – Michael Hampton Aug 29 '18 at 19:09
  • I m installing on an Intel Server S1200... with a Xeon E3 processor (exact specs not with me at this time). I first downloaded from Ubuntu main site and got the 18.04 live version which I think is a short-cut version. I later found another link to get the "alternative" version from [here]( http://cdimage.ubuntu.com/releases/18.04/release/). I partitioned and had a Software RAID 1 configured. Nothing else... proceeded with networking config and am stuck! I had Ubuntu 16.04 LTS server running all along. This is the first time I am using netplan. – Sunny Aug 29 '18 at 19:18
  • This is a fresh install. Not an upgrade. – Sunny Aug 29 '18 at 19:21
  • 1
    And you're sure that netplan _did not_ generate a configuration for systemd-networkd? Did you go look at it? – Michael Hampton Aug 29 '18 at 19:24
  • There was one file and I removed it by mistake. I had no idea what it was. Thought it might be some default. But should that matter? I thought that the config file is self-contained and not reliant on any other file. This is my first-time with netplan. -:( – Sunny Aug 29 '18 at 19:28
  • The netplan config shown by OP is _not_ a default config; Netplan sets itself up to config interfaces using DHCP by default. If this is a fresh install, I'd suggest 2 things: **1)** download the `ubuntu-18.04.1-server-amd64.iso` image from [here](http://cdimage.ubuntu.com/releases/18.04.1/release/) (note it doesn't say `-live` in the name; **2)** re-install the OS. I get the impression @Sam has done things that we're not exactly aware of and the unnecessary network config changes have contributed to a self-inflicted problem. Why not just look at how netplan actually works? – code_dredd Aug 29 '18 at 19:30
  • @code_dredd I will read on netplan. If nothing works, will reinstall OS and see (without removing the default generated). – Sunny Aug 29 '18 at 19:42
  • @Sam netplan is a configuration file generator. And my personal opinion is that it's pointless crap, but hey, that's Canonical for you... It is meant to create the actual network configuration when you run `netplan apply` (or do nothing, if you set up networking during installation). If you deleted the network configuration, maybe you should just re-create it with `netplan apply`? – Michael Hampton Aug 29 '18 at 19:43
  • 1
    @MichaelHampton The default file Sam _may_ be referring to (i.e. the removed one) _could_ be one for cloud-init. If it was _that_ file, then the file has some comments at the top explaining what to do to disable cloud-init. – code_dredd Aug 29 '18 at 19:45
  • @Michael Hampton netplan apply just hangs. I will reinstall Ubuntu and see. Frankly I see this netplan layer as frustrating. Even YAML... Why did they not use JSON? Granted that I am not a full-time admin but this should have been easier... I am accepting your answer anyway. It put me on the right track... – Sunny Aug 29 '18 at 19:55
  • 1
    @Sam Honestly I would just ignore netplan and write your own systemd-networkd config directly. Like I said, it's a pointless piece of crap, the stated purpose of which makes no sense. It will most likely fade away. – Michael Hampton Aug 29 '18 at 20:00
  • @Michael Hampton That is music to my ears. I did the same with Network Manager years ago. I was about to look into it the moment you said that it is a configuration file generator... So whoever consumes the file, which is the systemd-networkd process can be interacted with directly. – Sunny Aug 30 '18 at 04:18
  • @Michael Hampton I looked into configuring sytemd.networkd directly. Its easy or at least not more complicated then using netplan. Now I really question the need to have netplan in the first place. "Pointless crap" is 100% on point. – Sunny Aug 30 '18 at 06:32