[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: ip aliasing, virtual interfaces and incorrect source addresses...

On Wednesday 24 December 2003 10:58, Mike Mestnik wrote:
> Here is what I'm thinking, route would be setup like so...
> Destination     Gateway         Genmask         Flags Metric Ref    Use
> Iface   U     0      0       
> 0 eth0         UG    0      0      
>  0 eth0
> Then when the alias is set up, dose that change the localnet route to point
> at eth0:0? I can't reproduce any thing like that on my setup
> 2.6.0-test9-1-386.

It's got nothing to do with routing!

The kernel picks an IP to set as it's source address on outgoing packets. It 
will pick whatever IP it thinks is appropriate unless the user-space program 
specifies one.

As per the original problem, the issue was that it was picking the IP address 
on eth0:0 for it's source address rather than the IP on eth0.

The solution is to either tell your userspace program to use the other IP 
address, or bind the unwanted source address to the loopback adapter instead 
of eth0, which will then function identically, except that the system will 
not use that address to originate - that is, use the address as a source IP - 
unless it's specifically told to by a userspace program.

Side note, you can't route to aliased interfaces, only to the main adapter 
(ie: you can route to eth0, but not to eth0:0).

GPG: http://n12turbo.com/tarragon/public.key

Reply to: