Using Linux and glibc, when a TCP / IP connection occurs (call connect () on the socket), how can I explicitly choose which of the local IP addresses I want to create this connection if I have several interfaces (with different IP addresses ), where can I contact the remote host?
Is this possible, or does the IP stack of the operating system always automatically choose a route?
source
share