Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Wrong source IP address
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
friesia
Apprentice
Apprentice


Joined: 23 Mar 2007
Posts: 181

PostPosted: Thu Mar 14, 2013 8:39 am    Post subject: Wrong source IP address Reply with quote

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?
Back to top
View user's profile Send private message
friesia
Apprentice
Apprentice


Joined: 23 Mar 2007
Posts: 181

PostPosted: Thu Mar 14, 2013 6:37 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum