Hello,
I need to setup network in initramfs so I've set up kernel command line as follows:
Code:
linux /vmlinuz-5.2.0-0.bpo.3-amd64 root=UUID=40d729d8-b87e-455f-a7a5-2520be1ca65a ro quiet systemd.show_status=1 acpi=force net.ifnames=0 biosdevname=0 apparmor=1 security=apparmor rd.luks.name=32c764bd-9612-4bd0-9d0f-cda3d0a3595d=root rd.luks.options=timeout=60s rd.neednet=1 ip=10.0.0.118::10.0.0.102:255.255.255.0:lunada:eth1:none:10.0.0.103:10.0.0.104
When the kernel is loaded and the system starts, the networking service failed:
Code:
systemctl status networking
● networking.service - Raise network interfaces
Loaded: loaded (/lib/systemd/system/networking.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Wed 2019-11-27 18:09:04 CET; 6min ago
Docs: man:interfaces(5)
Process: 867 ExecStart=/sbin/ifup -a --read-environment (code=exited, status=1/FAILURE)
Main PID: 867 (code=exited, status=1/FAILURE)
Nov 27 18:09:03 lunada systemd[1]: Starting Raise network interfaces...
Nov 27 18:09:03 lunada ifup[867]: RTNETLINK answers: File exists
Nov 27 18:09:03 lunada ifup[867]: ifup: failed to bring up eth0
Nov 27 18:09:04 lunada systemd[1]: networking.service: Main process exited, code=exited, status=1/FAILURE
Nov 27 18:09:04 lunada systemd[1]: networking.service: Failed with result 'exit-code'.
Nov 27 18:09:04 lunada systemd[1]: Failed to start Raise network interfaces.
Although I just setup eth1 interface in the initramfs, it seems that the interface eth0 is already up and because of that the networking service fails.
I've added a script to bring down the interfaces in the pre-up stage:
Code:
cat /etc/network/if-pre-up.d/clean
#!/bin/bash
if [[ $IFACE =~ ^eth[0-1]$ ]]
then
ifconfig $IFACE down
ip addr flush dev $IFACE
fi
But it isn't working. Nevertheless, if I restart the networking service after the system boots, it works like a charm:
Code:
# systemctl restart networking
systemctl status networking
● networking.service - Raise network interfaces
Loaded: loaded (/lib/systemd/system/networking.service; enabled; vendor preset: enabled)
Active: active (exited) since Wed 2019-11-27 18:40:32 CET; 4s ago
Docs: man:interfaces(5)
Process: 2948 ExecStart=/sbin/ifup -a --read-environment (code=exited, status=0/SUCCESS)
Main PID: 2948 (code=exited, status=0/SUCCESS)
Nov 27 18:40:32 lunada systemd[1]: Starting Raise network interfaces...
Nov 27 18:40:32 lunada systemd[1]: Started Raise network interfaces.
How can I fix the systemd networking.service to initialize the network interfaces?
I'm using Debian Buster.
Kind regards,