1

I'm trying to configure NetworkManager to perform the following action for an interface

ip route add ::/0 dev he-ipv6

he-ipv6 is a point-to-point ipv4 sit mode tunnel and running the above command directly works. Unfortunately when the device is rebooted the default gateway is not reconfigured and therefore all IPv6 traffic outside the network is dropped.

I've tried configuring a manual route via:

nmcli c modify he-ipv6 ipv6.routes '::/0'

but of course nmcli will not let you configure static routes for the default gateway.

Error: failed to modify ipv6.routes: invalid prefix '0'; <1-128> allowed.
  • What about 2 routes? ::/1 and 8000::/1? – Patrick Nov 4 '16 at 1:42
0

In the end I found it cleanest to create a very simple networkmanager(8) dispatcher.d script to add the route when the interface comes online:

/etc/NetworkManager/dispatcher.d/99-he-ipv6-add-default-route

#!/bin/bash

[[ "${1}" -ne "he-ipv6" ]] && exit

if [[ "${2}" -eq "up" ]]; then 
  ip route add ::/0 dev he-ipv6
fi
0

Actually, you can configure the entire tunnel connection using nmcli, see Fedora's wiki page about it.

nmcli connection add type ip-tunnel con-name sit1 ifname sit1 mode sit \
remote SERVER_IPV4_ADDRESS -- ipv4.method disabled ipv6.method manual \
ipv6.address CLIENT_IPV6_ADDRESS ipv6.gateway SERVER_IPV6_ADDRESS \
ip-tunnel.ttl 64

The above doesn't need a dispatcher script and survives reboots.

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.