Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 19639 - Slight modification to the way net.{eth0,lo} handle their variables + loopback aliases.
Summary: Slight modification to the way net.{eth0,lo} handle their variables + loopbac...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] baselayout (show other bugs)
Hardware: All All
: High enhancement (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-04-19 20:14 UTC by Mike Jones
Modified: 2004-10-02 22:43 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
patch to /etc/init.d/net.eth0 from baselayout (net.eth0.diff,1.71 KB, patch)
2003-04-19 20:15 UTC, Mike Jones
Details | Diff
patch to net.lo from baselayout (net.lo.diff,1.54 KB, patch)
2003-04-19 20:16 UTC, Mike Jones
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Jones 2003-04-19 20:14:49 UTC
Hi.  This is a set of patches to net.lo and net.eth0 that implement loopback
aliases (which are required in many clustered configurations), as well as a
small change to the way the variables in conf.d/net are handled to enable the
following syntax, which is backwards-compatible with the current syntax:

current:

alias_eth0='1.1.1.1 1.1.1.2'

new:

alias_eth0[0]='1.1.1.1'   # www.foo.com
alias_eth0[1]='1.1.1.2'   # www.bar.com

the old method still works, and using variable arrays is, in my opinion, a saner
way of managing a very large number of virtual IP addresses on a single server.

Tell me what you think.

Reproducible: Always
Steps to Reproduce:
Comment 1 Mike Jones 2003-04-19 20:15:38 UTC
Created attachment 10894 [details, diff]
patch to /etc/init.d/net.eth0 from baselayout
Comment 2 Mike Jones 2003-04-19 20:16:00 UTC
Created attachment 10895 [details, diff]
patch to net.lo from baselayout
Comment 3 Martin Schlemmer (RETIRED) gentoo-dev 2003-04-21 16:10:41 UTC
If you really have that many, why not rather do something like:

alias_eth0='`< /etc/conf.d/aliases_eth0`'

or similar, and then you can manage them in that file ....
Comment 4 Mike Jones 2003-04-21 17:15:25 UTC
I'm doing something similar to that, in essence: 

myalias_eth0[0]='1.2.3.4' #web virtual host for www.foo.com
myalias_eth0[1]='3.4.5.6' #web virtual host for www.bar.com
myalias_eth0[3]='4.5.6.7' #web virtual host for www.baz.com
myalias_eth0[4]='5.6.7.8' #ftp server ftp.gentoo-rocks.org
...

alias_eth0="${myalias_eth0[@]}"

My reasons for this are as follows:  As you can see, it allows me to comment what each domain does.  As an extreme example, the load balancer for one of the web clusters that I manage has 510 assigned IP addresses (CIDR /23), of which 391 are in use.  It's really easy to get lost in there :-).  I can easily delete and add IP addresses to/from the list (bash arrays don't seem to mind if array elements, or large chunks of array elements are missing), and it's well, pretty.

Loopback aliases are another story.  net.lo doesn't seem to support them, when in fact they are quite useful - they don't arp! :-).  Many clustered solutions need some form of hidden IP interface to do the dirtywork for them.

Anyways, that's just my take on it.  I figured, since it was an extension of syntax that didn't break backwards compatibility, it might be an idea.

Mike/Ashmodai
Comment 5 Brett Simpson 2003-07-02 10:26:15 UTC
I have several LVS real servers with the hidden arp patch and have the need to 
configure the netmask and broadcast address on each loopback address. For now I 
had to copy the net.eth0 to net.lo and add entries in my /etc/conf.d/net to make this 
work.  
Also I like the idea of being able to configure each alias in an alias_lo[1] and 
alias_eth0[1] type of fasion. It makes it easier to read for mulitple entries. I vote for this 
change too. :-) Brett 
Comment 6 SpanKY gentoo-dev 2004-10-02 22:43:53 UTC
this is done in latest cvs/masked baselayout