6

I'm trying to create a tunnel to HE.net to get an IPv6 address on my (cloud) server.

When I created the tunnel and put this in /etc/network/interfaces:

auto he-ipv6
iface he-ipv6 inet6 v4tunnel
        address <my IPv6 address>
        netmask 64
        endpoint 66.220.7.82
        local <my IPv4 address>
        ttl 255
        gateway <my gateway>

Then ifup he-ipv6, and I got:

error: /etc/network/interfaces: line5: iface he-ipv6: unsupported address method 'v4tunnel'

How can I fix this?

The operating system is Ubuntu 18.04.3.

(I've tried to search this error but it seems nobody ever has it. But I've tried on two separate machine by different providers, and the results are the same.)


Update: add a picture for details:

Click this


Update 2: add a picture of netplan:

Click this


Conclusion: the problem is caused by ifupdown2.

KumaTea
  • 163

1 Answers1

4

ifupdown versus ifupdown2

From your error message, you are using the package ifupdown2 rather than ifupdown. Both are available on Ubuntu, but the online manpage shows only one version, I'm guessing the default installed, which would explain why you ended up using ifupdown2.

  • Ubuntu 16.04 LTS: interfaces(5)

    Provided by: ifupdown_0.8.10ubuntu1_amd64
    [...]

    AUTHOR
    The ifupdown suite was written by Anthony Towns <aj@azure.humbug.org.au>.

  • Ubuntu 18.04 LTS: interfaces(5)

    Provided by: ifupdown2_1.0~git20170314-1_all
    [...]

    AUTHOR
    Roopa Prabhu <roopa@cumulusnetworks.com>

While ifupdown2 is a replacement for ifupdown developped by Cumulus Networks, with improved support for modern network features, there are some syntax incompatibilities.

So either install ifupdown instead of ifupdown2, or adapt the configuration, which I give below.


What tunnel?

The original ifupdown provides the v4tunnel method:

The v4tunnel Method

This method may be used to setup an IPv6-over-IPv4 tunnel. It requires the ip command from the iproute package.

The ifupdown settings run these actual commands:

ip tunnel add he-ipv6 mode sit remote 66.220.7.82 local <my IPv4 address> ttl 255
ip link set he-ipv6 up
ip addr add <my IPv6 address> dev he-ipv6
ip route add <my gateway> dev he-ipv6
ip route add ::/0 via <my gateway> dev he-ipv6 onlink

So we know it's a SIT tunnel.


Using ifupdown2

The package ifupdown2, doesn't provide a v4tunnel method and lacks documentation for the replacement tunnel method which should have been described in man ifupdown-addons-interfaces but is not. It's still available from ifquery --syntax-help. Here's an excerpt (from Ubuntu 18.04's version):

tunnel: create/configure GRE/IPIP/SIT tunnel interfaces
[...]
  endpoint
    help: IP of remote tunnel endpoint
    required: True
    validvals: <ipv4>,<ipv6>
    example:
      endpoint 192.2.0.23
  local
    help: IP of local tunnel endpoint
    required: True
    validvals: <ipv4>,<ipv6>
    example:
      local 192.2.0.42
  mode
    help: type of tunnel as in 'ip link' command.
    required: True
    validvals: greipip,sit
    example:
      mode gre
  ttl
    help: TTL for tunnel packets
    required: False
    validvals: <number>
    example:
      ttl 64

Note that there's a typo in mode values (it should be gre,ipip,sit). Newer versions would handle more modes (anyway we already have sit available):

    validvals: gre,gretap,ipip,sit,vti,ip6gre,ipip6,ip6ip6,vti6

Which gives this working configuration:

auto he-ipv6
iface he-ipv6 inet6 tunnel
        mode sit
        address <my IPv6 address>
        netmask 64
        endpoint 66.220.7.82
        local <my IPv4 address>
        ttl 255
        gateway <my gateway>

The difference is the generic tunnel method and that you specify the type of tunnel with the mode keyword.

A.B
  • 13,968