LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux From Scratch (https://www.linuxquestions.org/questions/linux-from-scratch-13/)
-   -   failed to start network service LFS systemd 9.1 (https://www.linuxquestions.org/questions/linux-from-scratch-13/failed-to-start-network-service-lfs-systemd-9-1-a-4175672757/)

extrimis 04-07-2020 09:55 PM

failed to start network service LFS systemd 9.1
 
I Was trying to configure the LFS systemd network configuration and i finished it but while booting the system shows error message:

failed to start network service

my .network file looks like this

[Match]
Name=eth0

[Network]
Address=192.168.43.12
Gateway=192.168.43.1
DNS=192.168.43.1

LinkLocalAddressing=no
IPv6AcceptRA=no


the screenshot
https://firebasestorage.googleapis.c...0-2c1b05ea9e78

TheRealGrogan 04-09-2020 01:37 PM

I see you're doing that in Qemu. What you are trying to do with the static configuration in the guest like that simply will not work with the "user" (NAT) networking that will be in use by default as you will have no communication with the network. You would need to create a bridged interface on the host, a TAP interface on the host, and use the TAP interface in the guest in order for that to work.

How you would do so depends on the distro you are using. Kali Linux on the host? I'm not familiar with it, but I believe it's debian based. You can use your network manager, or search for information on the network system you are using. For example ifup/down or systemd-networkd.

https://kali.training/topic/configuring-the-network/
https://www.hiroom2.com/2017/07/22/k...7-1-bridge-en/

extrimis 04-09-2020 01:46 PM

Thankyou I'll try

extrimis 04-09-2020 01:48 PM

Even though I boot it in my original system it's the same issue

TheRealGrogan 04-09-2020 03:03 PM

OK, so you just loaded up what you built so far in Qemu so you could take screenshots etc.

So then, what does

"systemctl status systemd-resolved.service" say? Any useful information as to why the service is failing?

For a static config like that, I'd still put my nameserver in /etc/resolv.conf

[grogan@getstuffed:~]$ cat /etc/resolv.conf
#nameserver 208.67.222.222
#nameserver 208.67.220.220
nameserver 192.168.0.1

I used to specify them directly, but I'm running dnsmasq on my router (that's why I have those OpenDNS nameservers commented out, they are configured in my router). I would not put a search domain in my resolv.conf as most instructions say to do. It tends to cause delays.

TheRealGrogan 04-09-2020 03:19 PM

Another thing, if you're going to use your NIC as "eth0" you probably need to edit a udev rule or it's going to want to use that "enp?S?" naming. Something like:

/etc/udev/rules.d/70-persistent-net.rules

Code:

# net device module
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="y:o:u:r:mac:address", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*" NAME="eth0"


extrimis 04-09-2020 09:58 PM

here are the screenshots
when i run systemctl status systemd-networkd.service
https://firebasestorage.googleapis.c...9-23d3d7fe2393

https://firebasestorage.googleapis.c...4-01e0eb0b77b4

when i run ip a i get
https://firebasestorage.googleapis.c...f-2a6ec01a8286

when i boot in my original system the enp0s3 is also missing

TheRealGrogan 04-09-2020 11:10 PM

Well, your NIC is not eth0, it's enp0s3 so there's no way it's going to start with the network config you have. You can just make it easier on yourself and use Name=enp0s3

Now that error that systemd-networkd is throwing (200/CHDIR) generally means the service's working directory is unavailable at the time the service is trying to start. That could simply be due to a misconfiguration.

The first step would be to fix your network configuration and go from there.

Are your tempfs mounts like /run getting mounted?

extrimis 04-09-2020 11:15 PM

Yes

extrimis 04-09-2020 11:17 PM

I try to make the kernel with the host system config file,now I'm screwed so I'm rebuilding LFS systemd from beginning.

So from where should I have to take care of this problem(i mean which chapter)

TheRealGrogan 04-09-2020 11:28 PM

Well, the chapters for systemd and networking would be:

6.73. Systemd-244
7.2. General Network Configuration

I have never built a LFS system with systemd and while I've had to use it in various distros, I'm not as familiar with it. I find it pretty cryptic when things are broken.

extrimis 04-09-2020 11:43 PM

Thankyou I'll finish it and let you know

TheRealGrogan 04-10-2020 04:33 PM

I thought of something else later... your NIC is enp0s3 in the Qemu guest, that may not be what it is in the host. It should be the same as in your Kali Linux host distro, for the real install of LFS.

You can also figure it out from lspci. It works like this:

enp0s3

en - type of device, ethernet
p - from bus type (PCI includes PCI-E)
0 - PCI bus number (00:00.0) <---- unlikely on the host
s3 - slot number

extrimis 04-11-2020 10:56 PM

I tried rebuilding from scratch but same error. I loaded alx kernel module which is used by my host syatem. But after booting into LFS and type lspci it is showing e1000 but why is it not changing i also tried modprobe alx

extrimis 04-12-2020 01:07 AM

at last i changed the kernel module but staill the problem exist


All times are GMT -5. The time now is 09:26 PM.