2

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

Local machine has two IPs;

Eth1: 192.168.0.1

Eth1:2 192.168.0.2

Default gateway is 192.168.0.254 via Eth1

Remote subnet is 10.0.0.0/24

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

6

It was as simple as ip r a 10.0.0.0/24 via 192.168.0.254 dev eth1:2

0

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 192.168.0.1 is routed over separate links to traffic to/from 192.168.0.2. 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.