That doesn't work, and the reason doing it like you would ethernet
aliases doesn't work is because the init script currently
short-circuits the normal configuration procedure when the interface
is lo. The way I eventually made this work was by adding a postup()
function to /etc/init.d/net:
postup() {
if [ "${IFACE}" = "eth0" ]; then
ifconfig lo:0 x.x.x.x netmask 255.255.255.255
fi
}
Due to the short-circuiting, you have to add the aliases when some
interface other than lo comes up; postup() and friends are not
executed for lo in the current baselayout.
Why do this at all? It's useful for virtual server transparent load
balancing schemes, i.e. the load balancer receives incoming packets
for the virtual server address, and then routes them to backend
servers without rewriting the packet headers. The backend servers put
the public virtual server address on the loopback device and the
service listens on that IP. Then the backend server replies go
directly to the client and do not have to be processed by the load
balancer since they already have the correct source address. An
example of this is shown here:
http://www.linuxvirtualserver.org/VS-DRouting.html
Note that baselayout-1.12.0_pre19_r1 (current ~x86 and maybe some
earlier) do not short-circuit lo behavior, i.e. you can do:
config_lo=("x.x.x.x/32")
and it will add x.x.x.x/32 as an alias on lo. The short-circuting
behavior applies to baselayout-1.11.14-r8 (current x86).
On 3/14/06, Josh Hunholz <[EMAIL PROTECTED]> wrote:
Probably the easiest way is to make them aliases. So assign one to
lo:1, lo:2, lo:3, etc.
--Josh Hunholz
On 3/14/06, Joe Rizzo <[EMAIL PROTECTED]> wrote:
> I can not figure this out. How can I configure /etc/conf.d/net to
> assign multiple IP addresses on the lo interface?
>
> cat /etc/conf.d/net
> modules=( "iproute2" )
>
> config_eth0=(
> "null"
> )
>
> vlans_eth0="16"
>
> config_eth0_16=(
> "10.8.16.74/24"
> )
>
> routes_eth0_16=(
> "0.0.0.0/0 via 10.8.16.1"
> )
>
> config_lo=(
> "10.8.16.75/32"
> )
>
> Any help is appreciated -
> Joe Rizzo
>
> --
> [email protected] mailing list
>
>
--
[email protected] mailing list
--
The Pythonic Principle: Python works the way it does
because if it didn't, it wouldn't be Python.
--
[email protected] mailing list