[lfs-dev] How to create an alias interface with LFS networt bootscripts

Bruce Dubbs bruce.dubbs at gmail.com
Fri Feb 6 21:39:26 PST 2015


Bruce Dubbs wrote:
> Tim Tassonis wrote:
>> Hi all
>>
>> I would like to create an alias interface in the form of eth0:0 to set a
>> a second ip address on the interface. I tried the (obvious):
>>
>> cat > /etc/sysconfig/ifconfig.eth0:0  << EOF
>> ONBOOT="yes"
>> IFACE="eth0:0"
>> SERVICE="ipv4-static"
>> IP="192.168.219.221"
>> GATEWAY="192.168.219.1"
>> PREFIX="24"
>> EOF
>>
>> and then ifup eth0:0, but then got the error:
>>
>>       Bringing up the eth0:0 interface...
>>    *  Adding IPv4 address 192.168.219.221 to the eth0:0 interface... [
>> OK  ]
>>
>> *****face eth0:0 doesn't exist.                                        [
>> FAIL ]
>>
>>
>> Is there a way to do it with the networkbootscripts in lfs 7.6, or do I
>> have to do something manually elsewhere?
>
> It's not supported right now.  I'll take a look and see what I can come
> up with.

OK, there needs to be a change to /lib/lsb/ipv4-static.

The basic command would be
'ip addr add 192.168.219.221 broadcast 192.168.219.255 label eth0:0 dev 
eth0'

The only difference is that we need to add 'label eth0:0'.

Perhaps if we make the IFACE=eth0 and add a LABEL=eth0:0 entry, it will 
do what we want fairly easily.

Note that there should be no GATEWAY for a secondary device.  Only one 
GATEWAY can be active at a time.

I'll post a revised script that you can use tomorrow.

   -- Bruce




More information about the lfs-dev mailing list