Re: Behavior of SO_BINDTODEVICE

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

 



In article <6d71560527183fab0093d18a9a83a3c6.squirrel@xxxxxxxxxxxxxx> you wrote:
> However, do you or anyone else know how to do this if both interfaces are
> connect to the same network (same subnet)?

Well, first of all, the BINDTODEVICE is not intended to regulate the source
of response IP Addresses. It only regulates which Incoming TCP Connections
are accepted. IP Communication still is processed by the IP FIB (Cache).

So if you have 2 Interfaces on the same network, you cant use destination
based routing tables. But if the two interfaces have differen (local) IP
Addresses you can use those to discremninate. This is also why I saied, just
bind to IP Addresses instead of named interfaces.

> Btw, the reason I used named bindings, is that often I want two
> connections to the same server. When I think of it, modifying libcurl and
> binding the IP of the network interface to the socket would probably work,
> but I would rather use an unmodied libcurl (for portability reasons).

Well most Software I know supports binding to ip and not to name, so I am
not sure why it is different with curl.

Note that TCP is smart enough to sent answers out with the IP Address of the
request. It is not smart enough to sent it over the named devices.

Gruss
Bernd
--
To unsubscribe from this list: send the line "unsubscribe linux-net" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux 802.1Q VLAN]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Git]     [Bugtraq]     [Yosemite News and Information]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux PCI]     [Linux Admin]     [Samba]

  Powered by Linux