[lfs-support] Ethernet Card Not Found

Bruce Dubbs bruce.dubbs at gmail.com
Mon Nov 25 17:37:50 PST 2013


Alan Feuerbacher wrote:

> The file that worked:
>
> ifconfig.enp3s0
> #######
> ONBOOT=yes
> IFACE=enp3s0
> SERVICE=ipv4-static
> IP=10.0.1.31
> GATEWAY=10.0.1.1
> PREFIX=24
> BROADCAST=192.168.0.255

The BROADCAST is still wrong.  It needs top be 10.0.1.255.  You are not 
a part of the 192.168.0 network.

> #######
>
> Some questions and comments to help me really understand what's going on
> with this file:
>
> Short of going through the rigamarole that I just did, namely, looking
> at /sys/class/net/ and finding a cryptically named directory like
> "enp3s0", with the help of a number of experts, how does a newbie like
> me figure all this out ahead of time? Such as exactly what "IFACE" means
> and what you're supposed to put there?

IFACE stands for interface -- the network interface you are 
initializing.  If you look at /etc/init.d/network, you will effectively see:

for file in /etc/sysconfig/ifconfig.*
do
    interface=${file##*/ifconfig.}
    /sbin/ifup ${interface}
done

The /sbin/ifup script brings up the interface by setting the variables 
specified in the ifconfig file and acts on them accordingly.

The udev program names the interface.  It used to be eth0, eth1, etc, 
but upstream decided in their wisdom to dictate a different paradigm for 
naming network interfaces:

http://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames/

Now that you know your interface name, you can rename it to eth0.  Just 
run the init-net-rules.sh in Section 6.62 (udev).  It should set up 
/etc/udev/rules.d/70-persistent-net.rules  to soemthing like:

SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", \ 
ATTR{address}=="00:25:64:38:ec:dd", ATTR{dev_id}=="0x0", \ 
ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

The MAC address would be different of course and match your network 
interface.  The KERNEL entry may need to be "enp*", but I'm not 100 
percent sure about that.


> Apparently things in the linux world have changed recently with respect
> to naming devices generally, so that old conventions like "eth0" have
> been replaced by conventions that are said to make more sense. I suppose
> "enp3s0" makes sense to some people, but "eth0" makes more sense to a
> non-expert like me.

See above.

> How does someone setting up an LFS system find out the "IP" address? I
> had to look at what Fedora had done to figure this out.

In LFS, 'ls /sys/class/net' should do it.  Note that if the interface 
has been renamed, than the new name will be there.

> How does one find out the "GATEWAY" address? A friend who is relatively
> expert set up our router, airport and wireless stuff, and I paid no
> attention to this when it was done a few years ago. After googling
> around some, I found a way to figure this out, more or less, by looking
> at stuff in "Control Panel" on my Windows 7 machine. Not cool!
>
> How does one figure out what the "BROADCAST" address is supposed to be?
> I still have no clue whether the one above is right.

You have to understand networks.  The PREFIX specifies the network 
portion of the IP address in bits.  The network address is the network 
portion followed by all zeros:  10.0.1.0 in your case.  No hosts should 
have the network address.  The broadcast address is your network portion 
followed by all ones:  10.0.1.255 in your case.  Again, not host should 
be assigned to the broadcast address (it may not work at all).

> Can the LFS book be updated to discuss these things in some detail?

No.  We expect a LFS user to know these things.  LFS is not a beginner 
project.  See Section vi - Prerequisites.

>> Remember that you will need a resolv.conf. All I wrote is for manual ip,
>> not dhcp, but could help you, there, too, perhaps.
>
> I borrowed that file straight from the Fedora installation. It has:
>
> resolv.conf
> ######
> domain hsd1.nh.comcast.net.
> search hsd1.nh.comcast.net.
> nameserver 10.0.1.1
> ######
>
> I've googled "resolv.conf" to try to understand precisely what the
> fields are, but can't find anything useful in the sense of teaching one
> exactly how to determine what goes in the field and how you can find it.
>
> Is the stuff in my resolv.conf correct for this LFS installation?

You probably don't need the domain or search lines unless you are 
regularly contacting hosts at something.hsd1.nh.comcast.net.  Having 
both lines is not a good working practice.  Personally I use:

$ cat /etc/resolv.conf
domain linuxfromscratch.org
nameserver 8.8.4.4
nameserver 8.8.8.8

The nameservers are Google's public nameservers.  The nameserver you 
have seems to be local to your router and is probably OK if it's working 
now.  See BLFS (BIND) for how to set up one on your host.

   -- Bruce



More information about the lfs-support mailing list