TransWikia.com

Multiple IPv6 addresses, how to set primary/default address via netplan (Ubuntu 20.04 LTS)

Ask Ubuntu Asked by Jackobli on February 9, 2021

Hello and thank you for reading

Ubuntu 20.04 LTS with

  • SLAAC and
  • Static IPv6 address

SLAAC mainly because easy use in this network. Static for servers, that are needed to contacted from the outside.

For outgoing traffic, the system is always using the SLAAC (Autoconfig) address 🙁

I was thinking about stopping SLAAC/Autoconfig, but I read, this could harm RA / Path MTU discovery and such things.

So I found, that I could set a route manually. Works like a charm on the cmdline/bash

sudo ip -6 route del AlreadyExistingRoutes
sudo ip -6 route add 2001:0db8:dead:8000::/64 src 2001:0db8:dead:8000::2000 dev ens192

I tried to write that config into /etc/netplan/01-netcfg.yaml

network:
version: 2
renderer: networkd
ethernets:
  ens192:
    dhcp4: no
    dhcp6: no
    addresses:
    - '2001:0db8:dead:8000::4000/64'
  routes:
    - to: '2001:0db8:dead:8000::/64'
      scope: link
      from: '2001:0db8:dead:8000::4000/64'
      via: '2001:0db8:dead:8000::1'

These are example IPv6 addresses
But this netplan YAML is not doing, what I want.

Thank you for any hints.

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP