You are not logged in.

#1 2019-06-06 20:21:45

mobike
Member
Registered: 2019-06-06
Posts: 1

ipv6 source ip selection

hi

i have a working setup with a hurrican electric tunnel.
i got a single IP on my tunnel endpoint and a delegated /48 subnet

if i set a ip on my internal lan from this /48 range i can it ping
from extern; so this works to

but new connections from the host will always use my tunnel-endpoint
ip as source address. i would like to change the from a dynamic (slaac)
ip from mit /48 range. how can this set up with systemd-networkd?

thanks

Offline

#2 2019-06-07 01:08:48

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,231
Website

Re: ipv6 source ip selection

http://www.davidc.net/networking/ipv6-source-address-selection-linux wrote:

Linux implements RFC 3484, "Default Address Selection for Internet Protocol version 6 (IPv6). Briefly, the algorithm involves building a candidate list of potential source addresses, then following these rules in order:

    Prefer same address. (i.e. destination is local machine)
    Prefer appropriate scope. (i.e. smallest scope shared with the destination)
    Avoid deprecated addresses.
    Prefer home addresses.
    Prefer outgoing interface. (i.e. prefer an address on the interface we're sending out of)
    Prefer matching label.
    Prefer public addresses.
    Use longest matching prefix.
....
Influencing the algorithm

The solution is to mark unwanted source addresses as "deprecated", causing them to fail rule 3.

The method to implement this under Linux is to set preferred_lft to 0, thus causing the address to be marked as deprecated.

# ip -6 addr change 2001::db8::1/128 dev eth0 preferred_lft 0

I'm not sure how to get systemd-networkd to do this for you, but hopefully this gives you a starting point.

Offline

#3 2019-06-07 11:51:02

rsmarples
Member
Registered: 2009-05-12
Posts: 287

Re: ipv6 source ip selection

Another alternative is to set the preferred source address for your routes.

Offline

Board footer

Powered by FluxBB