Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
17

Since you're using /etc/network/interfaces, you'll need a systemd service to monitor the status of each interface. Check to see if you have /lib/systemd/system/ifup-wait-all-auto.service (installed by the ifupdown package in Ubuntu 15.04). If not, then create /etc/systemd/system/ifup-wait-all-auto.service, and paste in the following: [Unit] Description=Wait ...


14

In the configuration file for local network interface we have to either specify we want to obtain local DNS server address from DHCP server using DHCP= option: [Network] DHCP=yes or specify its address explicitly using DNS= option: [Network] DNS=10.0.0.1 In addition we need to specify (in the same section) local domains using Domains= option Domains=...


10

systemd-networkd uses a different method to generate the DUID than dhclient. dhclient by default uses the link-layer address while systemd-networkd uses the contents of /etc/machine-id. Since the VMs were cloned, they have the same machine-id and the DHCP server returns the same IP for both. To fix, replace the contents of one or both of /etc/machine-id. ...


9

systemd-networkd when its enabled honors configurations in /etc/systemd/network Whereas NetworkManager will follow some automatic rules like it will try to connect to a wired connection if it finds one. Both are enabled and disabled as systemd services and systemd using udev creates the device files for the network adapters. Generally you probably shouldn'...


5

Surely this is a problem that cloud providers (Azure, AWS, RackSpace, Openstack) have already solved when they import vms. I think OpenStack uses cloud-init, ConfigDrive format, and provides a network configuration that matches the VM hardware. Sources: https://bugs.launchpad.net/cloud-init/+bug/1577747 https://cloudinit.readthedocs.io/en/latest/topics/...


4

Since you cannot depend on a system service, your only solution is to provide a user service that detects whether the network is online. (Or make your services system services.) Details for a "detect-online" user service would depend on your definition of "online". It could wait for a ping to 8.8.8.8 to succeed, for instance. Or for a DNS name resolution ...


4

To connect to network through systemd-networkd you need to create some configuration files: For wireless connections create wireless.network file with the following content: nano /etc/systemd/wireless.network: Match] Name=wlan0 [Network] DHCP=ipv4 DNS=8.8.8.8 DNS=8.8.4.4 [DHCP] RouteMetric=20 For wired connections create wired.network file with the ...


4

The message "Withdrawing address record" doesn't mean avahi is removing the IP address, it just means that avahi detected that the IP address has been removed, and is changing its internal state in response. In other words, you need to look further; this isn't avahi's fault.


4

The loopback interface is set up in early boot (before e.g. any network servers are run). It seems there was no significant variation between distributions. Current Debian ifupdown would bring up lo even without configuration in /etc/network/interfaces. Technically it was possible to change the configuration of lo - and it would still be possible to ...


4

Per Lennart's post here, you have to change systemd-networkd log level to debug. If you wanted to have it on all the time you could use a drop-in unit: mkdir -p /etc/systemd/system/systemd-networkd.service.d cat << IN > /etc/systemd/system/systemd-networkd.service.d/10-debug.conf [Service] Environment=SYSTEMD_LOG_LEVEL=debug IN systemctl daemon-...


4

The DHCP Discover packet includes a RFC 4361-style client identifier (option 61, also known as DUID) with systemd's Enterprise number (43793). This is because your /etc/systemd/network/dhcp.network file does not include the ClientIdentifier nor DUIDType settings; the defaults are ClientIdentifier=duid and DUIDType=vendor. The DUIDType=vendor default ...


3

I gave up on trying to do this cleanly, and came up with the following hack. By running the following script just before shutting down the vm and migrating, the vm will have eth0 as the network adapter when powered on. ln -s /dev/null /etc/systemd/network/99-default.link; echo '# This file describes the network interfaces available on your system # and ...


3

Do you need predictable network interface names? My solution has been to uninstall biosdevname, and that has reliably resulted in always having network interfaces named as eth0, eth1, and so on. I have not found a good reason to have predictable network interface names nor biosdevname installed. in /etc/udev/rules.d/70-persistent-net.rules is where you can ...


3

I've moved countries and the motivation behind the question is no longer there. However, some pointers for when it becomes pertinent again: Run script upon network connection Get SSID: iwgetid --raw wlp2s0 nmcli -t -f GENERAL.METERED dev show wlp2s0 | grep -q yes && echo "Connection is metered" Change metered status on the device's active ...


3

To quote systemd.netdev(5): The MAC address to use for the device. [...] This key is not currently suported for "tun" or "tap" devices. According to systemd commit e0fbf1fcffe014d5af6767b29f9108c2f2444888, this wasn't ever possible. As of systemd v215, this limitation is not mentioned in the manpage, which was an apparent documentation bug in that ...


3

Found it: in the [Network] section, where you configure the IP address (Address=) you can add the subnet mask by adding a / to it, and the subnet mask bit count afterwards. For instance, to configure the IP adress 1.2.3.4 with subnet mask 255.255.255.0 you would put it as following: [Network] Address=1.2.3.4/24 . . .


3

This is a bug in systemd. The entry in systemd bug tracker is issue #2242, the one in Arch Linux' flyspray is FS#47557.


3

Tinc should be updated as a systemd unit instead of sending direct signals. To achieve this one needs to configure their unit files to be chained with the appropriate Require=, Before=, and After= lines in the [Unit] section. Also ensure that you set the correct WantedBy= for network services. (ie. WantedBy= { network.target, network-online.target, network-...


3

Check for config files in /lib/systemd/network/ or /run/systemd/network, it seems some other config file is matching your eno1 interface and starts DHCP on it


3

Depending on the OS; Enabling debug isn't always necessary. systemd-networkd should store the lease info under /run/systemd/netif/leases/ i.e. cat /run/systemd/netif/leases/2


3

This is a bug in systemd, still present on version 240. Per the thread above, a workaround (or solution, I am not sure about the status since the bug is still open) is to add GatewayOnlink=yes in the [Route] section: [Match] Name=eth0 [Network] DHCP=yes [Route] Gateway=192.168.0.10 Destination=10.0.0.0/8 GatewayOnlink=yes This parameter is available ...


2

Per my setup, I had two systemd network unit files: one for the bridged adapter and one for the host-only adapter. I wanted the bridged adapter to have a dynamic address because the virtual machine is on a laptop that moves between networks, and I wanted the host-only adapter to have a static address so that I could access it, such as by ssh, without having ...


2

According to Systemd-networkd you need to create a virtual bridge interface with ; nano /etc/systemd/network/MyBridge.netdev past the following content [NetDev] Name=br0 Kind=bridge then restart systemd-networkd.service to verify type ip a Next step create a network profile for the Bridge with nano /etc/systemd/network/MyBridge.network And past the ...


2

As I understand it, to do this permanently, you simply pile all the addresses together, i.e.: Address=192.168.59.1/24 192.168.1.5/24


2

I don't think you can use systemd-networkd to replace NetworkManager in this way currently. it is mostly being proposed when configuring Virtual Machines where there is no need for dynamic setup. If you want to get this to work you will have to write a systemd.timer with OnBootSec= some seconds after boot that starts a service that checks if the dhcp has ...


2

I've worked on it and found a solution. Here is it in short. Look there for a more detailed description. We have to tell libvirt to set the right VLAN-ID to the dynamic created virtual network interface (e.g. vnet0) added to the bridge on startup of a domain (guest). For this we can use libvirt hook scripts. I do this in three steps. Step 1: define VLAN-ID ...


2

It turns out that systemd-networkd provides an option to not releasing the IP. Adding below in the config [DHCP] CriticalConnection=true Then the IP will not be released and NFS will not hang.


2

I don't know of any systemd solution, but you can monitor changes to interfaces efficiently with ip monitor and pipe the output into a script that looks for the changes that interest you. For example, if I do $ ip monitor address dev enp3s0 then add a new alias address to interface enp3s0 I get the line 2: enp3s0 inet 192.168.77.77/24 brd 192.168.77....


2

You do not appear to have configured a NETMASK or PREFIX value for your interface. While not clearly explained often, a proper address actually requires this information. If you can no longer remotely connect via SSH, Telnet, etc. to the VM, you will need to logon to the console of the system: physical computer will require access to the monitor, keyboard, ...


Only top voted, non community-wiki answers of a minimum length are eligible