netdev
[Top] [All Lists]

Re: Q: 2.2.15 default behavior for IPv4 ... (solved)

To: ric@xxxxxxx, netdev@xxxxxxxxxxx
Subject: Re: Q: 2.2.15 default behavior for IPv4 ... (solved)
From: Peter Bieringer <pb@xxxxxxxxxxxx>
Date: Sun, 14 May 2000 12:26:46 +0200
In-reply-to: <nuvh0ps2ls.fsf@ric.tbit.dk>
References: <Peter Bieringer's message of "Fri, 05 May 2000 22:45:41 +0200"> <3.0.6.32.20000505224541.008d3940@mail.bieringer.de>
Sender: owner-netdev@xxxxxxxxxxx
At 13:28 08.05.2000 +0200, Richard Jørgensen wrote:
>> perhaps someone could update me, how a Linux kernel select the source IPv4
>> address on ICMP/UDP.
>
>I haven't read the kernel source, but I might be able to help anyway.
>
>> One PC with one Ethernet interface
>> 
>> Basic IP is:
>>      eth0: x.y.z.62
>> Also I defined some aliases:
>>      eth0:0 x.y.z.61
>[...]
>>      ping [...] should have source IP address of "eth0" (*.62).
>
>My experience with using aliases is that the source address is based
>on the routing table: 
>"route add -host x.y.x.t" will cause "ping x.y.z.t" to have source
>address x.y.z.62 whereas 
>"route add -host x.y.x.t dev eth0:0" will cause "ping x.y.z.t" to have
>source address x.y.z.61
>
>The aliases you create will automatically be added to the routing, so
>if you use several ip-adresses belonging to the same net, pinging a
>host on that net will use the last alias you defined as source address.
>
>Note: The routing table will show Iface = eth0 regardless of whether
>it is eth0, eth0:0, eth0:1, ...

Good hint, this solved the problem.

You're right, I got about 4 default route entries after setting 1 basic and
3 alias IPs.

If I've removed 3 of them, the first IP address set (eth0) is used on
outgoing packets.

Because of on 2 other similar RedHat 6.2 installations this won't occur,
I've looked for diffs and found one:
        /etc/sysconfig/network
must contain:
        GATEWAYDEV="eth0" 

Afterwards, only one default route is set up, not per each alias.


Thanks for helping!
        Peter



<Prev in Thread] Current Thread [Next in Thread>