[lfs-dev] Fwd: Error in ipv4-static

Bruce Dubbs bruce.dubbs at gmail.com
Fri Mar 23 10:12:22 PDT 2012


Qrux wrote:
> On Mar 22, 2012, at 2:20 PM, Bruce Dubbs wrote:
> 
>>> # ip addr show eth0
>>> 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state
>>> UP qlen 1000
>>>   link/ether 00:1e:4f:f8:00:39 brd ff:ff:ff:ff:ff:ff
>>>   inet 172.16.24.1/24 brd 172.16.24.255 scope global eth0
>>>   inet 172.16.24.2/24 brd 172.16.24.255 scope global secondary eth0
>>>   inet 172.16.24.3/24 brd 172.16.24.255 scope global secondary eth0
>>>   inet 172.16.24.4/24 brd 172.16.24.255 scope global secondary eth0
>>>   inet 172.16.24.6/24 brd 172.16.24.255 scope global secondary eth0
>>>   inet 172.16.24.8/24 brd 172.16.24.255 scope global secondary eth0
>>> ....
>>>
>>>
>>> if [ "$(ip addr show ${1} | grep ${IP}/)" == "" ]; then
>> This is a pretty rare corner case, but the fix looks right.  I'll update 
>> the script.  Technically there could also be an error if the IP address 
>> in the ifconfig file is specified with leading zeros, e.g. 
>> 172.016.024.008, but I'll ignore that for now.
> 
> Interestingly, this came up for me (I use generated IPs in certain places).  I'm using this to strip leading zeros:
> 
> 	sed -E -e 's/0+([1-9])/\1/g' -e 's/000/0/g' -e 's/^00/0/' -e 's/\.00/\.0/g'
> 
> I'm bet there's something more clever, but it works.  I tried it with this:
> 
> 	00.010.001.100.000.01.00.10
> 
> as input, and it generated the correct output.

> * * *
> 
> On that note...Where does the ifup/ipv4-static (and bridge) situation stand?

I'll try to get to that today.

   -- Bruce



More information about the lfs-dev mailing list