0

I'm trying to replicate in Netplan the equivalent of

ip -6 r a 2605:6400:1:fed5::1 dev eth0

There's no "via" address. I've tried:

      routes:
        - to: "2605:6400:1:fed5::1"
          on-link: true

But unfortunately, netplan comes back with an error

Error in network definition //etc/netplan/01-netcfg.yaml line 13 column 8: unicast route must include both a 'to' and 'via' IP

Is there a fake 'via' address I should use? It seems netplan doesn't even have post-up hooks so I can't work around the problem.

GDR
  • 329
  • 4
  • 14

1 Answers1

3

In versions of netplan >= 0.40 you can use:

eth0:
  routes:
    - to: "2605:6400:1:fed5::1"
      scope: link

In older versions you can use the "::" catch-all:

eth0:
  routes:
    - to: "2605:6400:1:fed5::1"
      via: "::"
      on-link: true
Gerrit
  • 1,552
  • 8
  • 8
  • Nope: `Error in network definition //etc/netplan/01-netcfg.yaml line 13 column 8: unicast route must include both a 'to' and 'via' IP` – GDR May 08 '19 at 13:59
  • Are you sure? I don't have a real good setup for testing now, but with Ubuntu 18 and netplan it doesn't give an error and it does make a ipv6 route. With ipv4 it certainly works. – Gerrit May 08 '19 at 14:35
  • Yes, i'm sure, I pasted it to routes and issued `netplan apply`. maybe it's a bug. – GDR May 08 '19 at 18:19
  • 1
    Do you have netplan >= 0.40? In lower versions it seems you can use via: "::" – Gerrit May 08 '19 at 18:51
  • I can confirm that: 1) via: "::" worked in 0.32 which comes out of the box in Ubuntu 18.04 and 2) upgrading to 0.96 removed the need for the 'via' directive. Want to make it an answer or should I? Thanks! – GDR May 09 '19 at 07:04