I have a Boost ASIO-based C++ server program and I\'d like to be able to set the source IP address used by TCP to that of another server. I know one can read the source and
Use bind call to assign the source IP address and port.
If you do not call bind before connect the OS picks and binds the interface for you using the routing table.
bind
connect
The IP address must be the address of one of your host's interfaces. In other words, you cannot spoof your source IP using bind call.