Add an IP alias to ethernet interface

Andrew Beverley andy at andybev.com
Mon Jun 4 13:15:26 PDT 2007


(Background: I needed a method to add an aliased IP address to an
existing interface. No set out method is currently available in LFS to
achieve this)

> > I think this would be a worthwhile inclusion to LFS. Have you emailed
> > lfs-dev or would you like me to?
> 
> The right way to do this is to add a new service in
> /etc/sysconfig/network-devices/services. You could call it ipv4-alias
> or something. Copy ipv4-static for a template. It would be really
> simple since it's just one call to ip. Then you'd enable that service
> in /etc/sysconfig/network-devices/ifconfig.eth0 just like you do with
> dhcp or any other service.

I've created an ipv4-alias script, please see attached. However, it is
almost exactly the same as the ipv4-static script (it still needs all
the same parameters as a normal static address), which makes me think
that the ipv4-static script should just be updated so that it can deal
with an ALIAS variable (similar to the script Rabenkind did).

> As for getting it in LFS, I would be find adding it to the contrib
> directory in lfs-bootscripts.

Great. If you do want to keep it as a separate script, can I suggest a
mention of it in the network script page of LFS (ch 7.13)? This is the
first place I think most people would go to look for this sort of
information.

Andy Beverley

-------------- next part --------------
A non-text attachment was scrubbed...
Name: ipv4-alias
Type: application/x-shellscript
Size: 1728 bytes
Desc: not available
URL: <http://lists.linuxfromscratch.org/pipermail/lfs-dev/attachments/20070604/00ae392d/attachment.bin>


More information about the lfs-dev mailing list