Linux From ScratchThis Forum is for the discussion of LFS.
LFS is a project that provides you with the steps necessary to build your own custom Linux system.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I've recently gotten through LFS 7.0 and all is fine until I get to the networking part (never been my strong suite.) I've been all over LQ (and other places) trying to get past the infamous "unknown host" problem: to no avail. I think I'm getting screwed up with the etc/hosts file. Here's what I've got:
/etc/hosts:
Code:
127.0.0.1 localhost
127.0.1.1 LFS2
# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
I gave your thought a quick try on my LFS running on virtualbox but still get "unknown host" when I ping. I don't think it'll make a difference but I will try it again when I reboot into the dedicated LFS partition.
First, although i've come up with a word-around, I value your thoughts and would love further input in figuring this out.
Bertical, I'm not sure what "/21 network" is. As I've said, networking is a weak spot for me and even more so with Linux.
Soooooo, to make sure the problem wasn't with something I may have done while configuring the kernel, I did the following:
Copied the LFS 7.0 partition to a new partition (so I could preserve the build as it stood at the completion of the LFS 7.0 book.) Then I installed dhcp (dhcpcd-5.2.12) as per BLFS. Rebooted to the new partition (with dhcp) and things seem happy. Tried some pings against google and all was fine.
So, again begging your patience, I would love to figure out what I have messed up with the original LFS7 (without dhcp.)
The "PREFIX" command in /etc/sysconfig/ifconfig.eth0 is used to set the subnet mask. Your Ubuntu box is using 255.255.248.0 which is a /21 subnet mask ( first 21 bits are used for the network , the rest are used for the hosts ). On your LFS machine the subnet mask is set to /24.
Bertical, thanks for the thought. I'm certainly not arguing with you, just going by the book which states that the IP address is four octets of 8 bytes (bits ?) each. So if the last octet is 0 then the first three are used and the prefix would be 24. I did try changing the prefix to 21 anyway but no go.
I gave your thought a quick try on my LFS running on virtualbox but still get "unknown host" when I ping.
Don't you need to create some sort of bridged connection when running in a virtual machine? At the bottom this page it talks about forwarding packets from the host.
Andy, you may be right about virtualbox but I have also tried booting straight into LFS on its own partition and have tried every combination I can imagine. No luck. Bertical may also be onto something with the subnet mask but simply changing the PREFIX in my ifconfig didn't work. I've spent quite a few hours with google trying to learn more about the networking part and am still learning. I'm beginning to think that since it works fine with DHCP maybe it can't be done by putting addresses in myself. (LFS on virtualbox also works fine if I use DHCP.) I've been going through the scripts run by INIT but can't get the specific error from those scripts. I think that one day when I feel adventurous I'm going to have to but some debugging in the "ping" program and see exactly what is being returned when it fails. Thanks for your thoughts.
Bertical, thanks much for the info. While I don't have it fixed just yet, I am beginning to think LFS is working fine and I should perhaps learn more over in the networking forum.
Just one last question if I may: is it possible that connecting to my ISP through a modem (no router) mandates that I have dhcp of some kind running on my PC?
Meanwhile I did change the IP Address to the exact same one Ubuntu uses (note that I am booting directly into LFS, not virtualbox now.) I also changed the PREFIX to 21 and enabled the gateway. Now, at the end of init, I am getting a message that the default gateway is set up. Ping still gives me "unknown host" when pinging www.google.com but now tells me that the destination host is unreachable when I ping 8.8.8.8. From what I've found on google, I still have a "route" problem.
Since I would really like to learn just what is going on I think I'm going to dig out a live CD for another distribution (or perhaps the LFS liveCD) and watch the discovery process. I have Ubuntu and Mint but Ubuntu seems to use avahi and Mint is a derivative of Ubuntu so probably uses avahi also. I'd like to dig into the network part of INIT on liveCD to see just how it is acquiring addresses. A liveCD would surely have a dhcp type discovery process. Again, if my ignorance is showing and this all is a simple matter of DHCP being needed to connect to my ISP, don't be afraid to call me an idiot.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.