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:
Created attachment 10894 [details, diff] patch to /etc/init.d/net.eth0 from baselayout
Created attachment 10895 [details, diff] patch to net.lo from baselayout
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 ....
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
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
this is done in latest cvs/masked baselayout