# Wrong source IP address

## friesia

I've set up the following configuration:

PC's ethernet port has 2 global IP addresses:

2001:db8:1::b/48

2001:db8:2::b/48

It is connected to my router box with a single cable. The interface on the box also has 2 addresses:

2001:db8:1::a/48

2001:db8:2::a/48

The default route on PC is via 2001:db8:1::a.

However when OS tries to send something into the Internet by the default route, it may prefer to use 2001:db8:2::/48 subnet and not 2001:db8:1::/48 subnet. So the origin's IP would be 2001:db8:2::b/48 and not 2001:db8:1::b/48 as I intend. I check this with traceroute6 and tcpdump. My further routing may be based on source IP.

So if I want to have a fixed source IP, do I have to throw one of the IP addresses into a VLAN?

----------

## friesia

I used 'src' parameter to 'ip route' and it works as intended.

However both addresses have to be in PC's neighbour table, otherwise kernel still selects the wrong source address. I had to a add a permanent record to the neighbour table.

----------

