Re: ip aliasing

Dancer (dancer@zeor.simegen.com)
Mon, 26 Jul 1999 13:55:27 +1000


Roman Drahtmueller wrote:
>
> Q:
> How come 2.2.10 uses a somehow arbitrary ip number out of the aliases
> pool instead of the primary one as source address when opening a
> connection to the world?
>
> Ex: 70 virt interfaces up with IPs in 7 subnets /24.
> ping et al use source ip from one of these interfaces
> down the 70 again, and it works.
> down the one with the IP, then ping uses another from the alias
> pool.
>
> this behaviour is most irritating, since it renders ip aliasing
> useless.
> Hint?

Maybe try using the ip route tool, and pretending ip-aliases don't
exist:

# Add three different addresses to eth0
ip addr add 10.1.1.1/24 dev eth0
ip addr add 10.1.1.2/24 dev eth0
ip addr add 1.2.3.4/24 dev eth0

# Route to different networks with different source addresses
ip route add 10.1.1.0/24 src 10.1.1.1 dev eth0
ip route add 10.0.0.0/8 src 10.1.1.2 dev eth0
ip route add default src 1.2.3.4 dev eth0

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/