Is there an existing Linux / POSIX C / C ++ library or sample code for how to reconfigure a socket from one physical interface to another?
For example, I have ping on a socket that is connected to physical connection A, and I want to reinstall this socket on physical connection B and continue to send and receive ping packets on connection B (after a short delay during the switch).
I only need this for session protocols.
thanks
Update:
I am trying to provide a fault tolerance solution for use with PPP and Ethernet devices.
I have a basic script that can do 90% of the functionality using iptables, NAT and a routing table.
The problem is when the transition to another resource occurs, all messages continue to be sent over the secondary connection, however, the source IP address is from the old connection.
I spoke with several people who work on commercial routers, and their suggestion is to reinstall the socket on the secondary interface.
Update 2:
, . . ping, . ping , , , . , . , , , , , .