How can I send through a specific network interface?
问题 I need send messages through different gateways dynamically. How do that and what must be my first step in this direction? On my server I have two connections: one-direct, and secondary over VPN. Default route is direct connection, but i need dynamically change connection to VPN. At current time I try build socket from libc::bind() it's work, but have not expected effect. Changing the outgoing IP is not a solution to define the interface. 回答1: As suggested in a comment we must use SO