title: How to route TCP/IP responses through a different interface?
body: <p>I have two machines each with two valid network interfaces, an Ethernet interface <code>eth0</code> and a tun/tap interface <code>gr0</code>. The goal is to start a TCP connection on machine A using interface <code>gr0</code> but then have the responses (ACKs, etc) from machine B come back over the Ethernet interface, <code>eth0</code>. So, machine A sends out a SYN on <code>gr0</code> and machine B receives the SYN on its own <code>gr0</code> but then sends its SYN/ACK back through <code>eth0</code>. The tun/tap device is a GNU Radio wireless link and we just want the responses to come through the Ethernet.</p>
  
  <p>What's the easiest way to accomplish this? I need to research more on TCP/IP, but I was initially thinking that source-spoofing outgoing packets would tell the receiver to respond to the spoofed address (which should get routed to <code>eth0</code>). This would involve routing the IPs from the tun/tap interfaces through <code>gr0</code> and leave the other traffic to <code>eth0</code>.</p>
  
  <p>We are using Linux and a Python solution would be preferable.</p>
  
  <p>Thanks for looking!</p>