-1

Using Ubuntu 18.04 Server LTS for an embedded application. Two physical network interfaces are present, one ethernet and one a PCI Athros wifi card. I can use netplan .YAML and ifconfig up/down to manually control and switch between interfaces.

I have added the 99-disable-network-config.cfg file with the contents:

network: {config: disabled}

to the /etc/cloud/cloud.cfg.d directory. Netplan apply has been run (multiple times)

I have one 01_xx.YAML file present in /etc/netplan that sets the Wifi adapter up to DHCP. The expectation is that the ethernet interface will remain down on a reboot. When I reboot I see the startup message that it is attempting to initialize the network and it times out after 2 minutes as failing. However as soon as I am at the CLI prompt I check the interfaces and I have both the ethernet and Wifi interfaces up and connected.

Is there a way to actually keep one of the interfaces down at startup? I want to only have one adapter being started based on the 01_xx.YAML I have set.

And then to keep the startup networking timeout from running to 2 minutes? I suspect this is part of systemd but I can't find it. This doesn't seem to be related to the dhclient.conf timeout parameter as I already have it set to 30 seconds.

Nathan Smith
  • 1,573
  • 2
  • 10
  • 17

1 Answers1

0

Assuming you're using the networkd renderer, try adding optional: true to the device definition. This will tell systemd-networkd not to wait for it on boot.

mwp
  • 8,217
  • 20
  • 26
  • Adding the `optional: true` to the .YAML seems to have solved the timeout issue on startup. It attempts and seems to continue after about 20 seconds or so. I found that the 50-cloud-init.yaml still contained the definition for the fixed ethernet interface as I was still getting it when I was specifying my wifi interface. Manually removing that, applying and rebooting seems to now allow my .YAML files so be controlling the network interface configuration as needed. Is there an expected method to regenerate 50-cloud-init.yaml? `netplan generate` didn't seem to have any effect on that. – Nathan Smith May 15 '18 at 11:51
  • @NathanSmith `netplan generate` simply takes the YAML files in /etc/netplan and generates the files necessary for the designated renderer in the appropriate place. For the networkd renderer, for example, it writes files to /run/systemd/network (I believe). I don't know too much about cloud-init but I found this, which may help you: https://stackoverflow.com/questions/23151425/how-to-run-cloud-init-manually – mwp May 15 '18 at 13:28