Am unable to configure the default route using netplan
on an Ubuntu 18.04.2 system. The route works when explicit ip -6 route add ...
commands are issued.
Privacy extensions have been disabled: /etc/sysctl.d/10-ipv6-privacy.conf
net.ipv6.conf.all.use_tempaddr = 0
net.ipv6.conf.default.use_tempaddr = 0
net.ipv6.conf.ens192.use_tempaddr = 0
SLACC and RA have been disabled, IPv4/IPv6 forwarding are one (machine serves as an OpenVPN server)
/etc/sysctl.d/10-ipv6-router.conf
net.ipv6.conf.default.autoconf = 0
net.ipv6.conf.all.accept_ra = 0
net.ipv6.conf.all.proxy_ndp = 1
/etc/sysctl.conf
net.ipv4.ip_forward=1
...
net.ipv6.conf.all.forwarding=1
/etc/netplan/01-netcfg.yaml
network:
version: 2
renderer: networkd
ethernets:
ens18:
dhcp4: no
addresses:
- a.b.c.d/24
gateway4: a.b.c.e
dhcp6: no
accept-ra: no
addresses:
- "2001:0db8:0004:4a1a::dead:beef/64"
gateway6: "2001:0db8:0004::0001"
ens19:
dhcp6: no
accept-ra: no
addresses:
- "2001:0db8:0004:4a1a::dead:dead/64"
gateway6: "2001:0db8:0004::0001"
This assigns the addresses to the interface as shown below:
$ ip -6 addr show
2: ens18: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 state UP qlen 1000
inet6 2001:0db8:0004:4a1a::dead:beef/64 scope global
valid_lft forever preferred_lft forever
inet6 fe80::abcd:efff:fea3:2a03/64 scope link
valid_lft forever preferred_lft forever
3: ens19: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 state UP qlen 1000
inet6 2001:0db8:0004:4a1a::dead:dead/64 scope global
valid_lft forever preferred_lft forever
inet6 fe80::defc:deff:fe98:7c74/64 scope link
valid_lft forever preferred_lft forever
The routes using ip -6 route show
2001:0db8:0004:4a1a::/64 dev ens19 proto kernel metric 256 pref medium
2001:0db8:0004:4a1a::/64 dev ens18 proto kernel metric 256 pref medium
fe80::/64 dev ens19 proto kernel metric 256 pref medium
fe80::/64 dev ens18 proto kernel metric 256 pref medium
There is no default route configured and pinging external sites does NOT work:
$ ping -6 -c3 ipv6.google.com
connect: Network is unreachable
Running the following two commands:
$ sudo ip -6 route add 2001:0db8:0004::0001 dev ens18 metric 1
$ sudo ip -6 route add default via 2001:0db8:0004::0001 dev ens18 metric 1
Now running ip -6 route
shows:
2001:0db8:4::1 dev ens18 metric 1 pref medium
2001:0db8:4:4a1a::/64 dev ens19 proto kernel metric 256 pref medium
2001:0db8:4:4a1a::/64 dev ens18 proto kernel metric 256 pref medium
fe80::/64 dev ens19 proto kernel metric 256 pref medium
fe80::/64 dev ens18 proto kernel metric 256 pref medium
default via 2001:0db8:4::1 dev ens18 metric 1 pref medium
A default route is now configured and pinging external sites works:
$ ping -6 -c3 ipv6.google.com
PING ipv6.google.com(ord38s18-in-x0e.1e100.net (2607:f8b0:4009:804::200e)) 56 data bytes
64 bytes from ord38s18-in-x0e.1e100.net (2607:f8b0:4009:804::200e): icmp_seq=1 ttl=56 time=23.2 ms
64 bytes from ord38s18-in-x0e.1e100.net (2607:f8b0:4009:804::200e): icmp_seq=2 ttl=56 time=23.2 ms
64 bytes from ord38s18-in-x0e.1e100.net (2607:f8b0:4009:804::200e): icmp_seq=3 ttl=56 time=23.2 ms
--- ipv6.google.com ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2002ms
rtt min/avg/max/mdev = 23.274/23.283/23.293/0.176 ms
So, what is wrong with the netplan configuration? Why are the default IPv6 routes not being configured?
Edited after making changes suggested by @slangasek:
ethernets:
ens18:
...
dhcp6: no
accept-ra: no
addresses:
- "2001:0db8:0004:4a1a::dead:beef/64"
routes:
- to: "::/0"
via: "2001:0db8:0004::1"
metric: 1
on-link: true
However, this does not work. I get messages like ens18: Could not set route: No route to host
in the journal logs.
From the answer at https://askubuntu.com/a/1014683, I added the additional route to the router using scope: link
:
routes:
- to: "2001:0db8:0004::1/128"
via: "2001:0db8:0004::1"
metric: 1
scope: link
- to: "::/0"
via: "2001:0db8:0004::1"
metric: 1
on-link: true
But, still not working!
cat /usr/share/doc/netplan/examples/static.yaml
and then try again. – chili555 Jun 02 '19 at 23:18netplan
so terribly broken? – Sachin Garg Jun 03 '19 at 02:09