1

I have using something similar to How to enforce IPv6 source address selection with addrlabel at startup? to configure IPv6 address selection in Ubuntu 16.04.

Now I am deploying Ubuntu 18.04 and the new network configuration tool is "netplan".

This machine has a handful of IPv6 addresses and I want to be able to configure the source address as described in RFC 3484. That is, several IPv6 source addresses are valid for a given destination, but I want to be able to choose what source IPv6 address is used depending of the destination.

I have tried "routes" and "routing-policy", with no effect. Maybe I am doing it wrong.

I have found some examples por policy routing for IPv4, but all of them use "via" with an static address and I want to use automatic IPv6 router discovery so, technically, I don't know what my router address is, and it could change anytime.

I have tried something like this, with no success:

network:
  version: 2
  renderer: networkd
  ethernets:
    enp1s0:
      addresses:
        - 2001:XXXX:XXXX::1/48
      routing-policy:
        - to: "::/0"
          from: "2001:XXXX:XXXX::1/48"
          priority: 0

EDIT: My current netplan configuration is:

network:
  version: 2
  renderer: networkd
  ethernets:
    enp1s0:
      dhcp4: yes
      dhcp6: yes
      addresses:
        - 2001:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:1/48
  • I get most of my configuration via DHCP4/DHCP6. I have a IPv6/48, so I manually added an explicit IPv6 address in that range, and I want that IP to be "source address selected" when initiating outgoing connections. I modified my post with the current configuration. – jcea Jan 18 at 2:57
0

Before you do anything with routes you need to configure your network device properly. It should look something like this:

network:
    ethernets:
        ens32:
            addresses:
            - xx.99.99.99/29
            - xxxx:9999:9999::99/64
            dhcp4: false
            dhcp6: false
            gateway4: xx.99.99.1
            gateway6: xxxx:9999:9999::1
            nameservers:
                addresses:
                - 8.8.8.8
                - 2001:4860:4860::8888
                search:
                - example.com
  • I get most of my configuration via DHCP4/DHCP6. I have a IPv6/48, so I manually added an explicit IPv6 address in that range, and I want that IP to be "source address selected" when initiating outgoing connections. I modified my post with the current configuration. – jcea Jan 18 at 2:46

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.