I am looking for some sort of routing trickery to set a specific source IP:

Local machine has two IPs;



Default gateway is via Eth1

Remote subnet is

Any traffic that is sent to 10.0.0.x host, I want to leave via Eth1:2 so that it has IP when it is received by the remote hosts, or some how force to be my source IP when talking to 10.0.0.x hosts.


It was as simple as ip r a via dev eth1:2


Both interfaces are on the same net, that doesn't make any kind of sense (unless they are connected to switch(es), and you bond them into a single interface). Why this bizarre setup? What are you trying to gain with it?

  • Its one physical interface, with two IP addresses. There is policy based routing further up the line, traffic to/from is routed over separate links to traffic to/from I've fixed this now anyway. – jwbensley Feb 11 '13 at 10:23
  • Please answer your own question (giving any other relevant data) and accept it to close the issue. – vonbrand Feb 11 '13 at 10:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.