"In Linux, to control the physical topology of communication you use the SO_BINDTODEVICE socket option."
SO_BINDTODEVICE
http://codingrelic.geekhold.com/2009/10/code-snippet-sobindtodevice.html