On Thu, Oct 14, 2010 at 10:26 AM, Govi <[email protected]> wrote: > I have one ethernet card(eth0) , with three ip address(2 aliases). > When ever i am establishing a connection it was sending through eth0 only > .incomming packets are receiving for all the ips. > > My questions all the outgoing packets are sent through eth0 only or i will > sent through any one ip( eth0 , eth0:1 or eth0:2 ).
When you initiate a connection from your system, the kernel is free to choose any suitable source IP based on the kernel routing table. And by default, the primary IP of the interface is selected as src IP. If you want your application to use a specific IP (eth0:1), then your daemon/app needs to bind to that specific IP *before* initiating a connection. Most applications use 0.0.0.0 as the src IP by default and let the kernel choose the appropriate src IP. Eg. If eth0 is 192.168.0.10, eth0:1 is 192.168.0.11 "ping 192.168.0.1" will send ICMP packets with src IP 192.168.0.10 "ping -I 192.168.0.11 192.168.0.1" will send ICMP packets with src IP 192.168.0.11 Note that having multiple IPs defined in the same subnet can cause other unexpected problems unless it is handled specifically. If you have two physical interfaces with IPs assigned in the same subnet, ARP requests/responses can get mixed up and cause issues. IIRC recent kernel versions have addressed these issues. - Raja _______________________________________________ ILUGC Mailing List: http://www.ae.iitm.ac.in/mailman/listinfo/ilugc
