On 2014-02-24 02:32, Scott Burns wrote:
nc has:
-s addr Local source address
would that work? It might take some scripting to figure out
which interface is using which address.
In my continued research on this I have found some notes that indicate that
the "bind() call may be used against the socket() call result, prior to the
connect() call. Although bind() traditionally is used for listeners
apparently it also works for the connect() call as well. We are putting
together some small code snippets to test.
In my world, bind have traditionally been used on *all* sockets, before
either connect or listen...
It's just a convenient shortcut that an implicit bind is done as a part
of connect, if you didn't already do it.
And if you want to connect from a specific source port number, you
*must* use bind before connect. Has always been that way.
Johnny