ifconfig.eth0/ipv4 or ifcfg-eth0 why the difference

Bruce Dubbs bruce.dubbs at gmail.com
Tue Feb 9 10:42:07 PST 2010


stosss wrote:
>> YES!!! (fist pump in the air) I have connectivity!
>>
> 
> A little early to get excited. I have eth0 and it loads and the kernel
> is happy no errors no warnings. Still no connectivity.
> 
> my ifconfig.eth0/ipv4 look like this:
> 
> ONBOOT=yes
> SERVICE=ipv4-static
> IP=10.0.2.15
> GATEWAY=10.0.2.0
> PREFIX=8
> BROADCAST=10.0.2.255
> 
> I did a test by launching the LFS LiveCD iso image in another VM to
> see how it configured itself.
> 
> ONBOOT=yes
> SERVICE=ipv4-static
> IP=10.0.2.15
> GATEWAY=10.0.2.0
> PREFIX=24
> BROADCAST=10.0.2.255

The prefix shouldn't matter since all the ip addresses start at 10.0.2.

> This is also the same for all my other VMs. VirtualBox sets all VMs to
> this private network and each one is completely separate from the
> others. If I set PREFIX=24 in my LFS build the kernel complains with
> FAIL. On most of my real machines and VMs I can run route -n and see
> the details for the gateway. I can't do that with my build LFS but I
> can do that with the LFS LiveCD. Which package needs to be installed
> so the route command is available? 

BLFS: Net-tools

You can use the default LFS program:

/sbin/ip route list

I see what the problem is.  The gateway is OK for /8, but wrong for /24. 
  IN a /24 network, the .0 address is the network address, not a host 
address.  You've set it up incorrectly on the LiveCD.  Either change the 
gateway to .1 or the prefix to 8 on the LiveCD instance.

   -- Bruce



More information about the lfs-support mailing list