5

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
  • 153
  • 4
  • The settings look correct - actually, specifics aside, identical to mine. What cloud provider/style of VPS? Might be something speicific to that. – Journeyman Geek Feb 08 '20 at 08:28
  • wait, are there no ipv4 settings? – Journeyman Geek Feb 08 '20 at 08:49
  • One is [Compute Engine](https://cloud.google.com/compute) from Google Cloud Platform, the other is [Elastic Compute Service](https://www.alibabacloud.com/product/ecs) from Alibaba Cloud Elastic Compute Service. – KumaTea Feb 08 '20 at 09:16
  • There is no IPv4 config in `/etc/network/interfaces` for default, but they both can get a public address automatically. `ifconfig` prints an interface named `eth0` with that address. – KumaTea Feb 08 '20 at 09:20
  • that's interesting. Is there a netplan config? That's the default for this version and I wonder if its using that or network manager... not very sure how precisely to check... – Journeyman Geek Feb 08 '20 at 09:29
  • `/etc/network/interfaces` of Google Compute Engine points out that it is managed by netplan. I have updated a screenshot of that. – KumaTea Feb 08 '20 at 09:45
  • ah, could you try the (experimental) netplan config for HE? Its newish but might be the easiest way to get this working – Journeyman Geek Feb 08 '20 at 09:47
  • Thanks! The provided netplan config doesn't work well (`ifconfig` shows `TX Error`), but a new interface is online. I'll try to fix it. – KumaTea Feb 08 '20 at 10:40
  • Oh! In which case *do* self answer once you get it to work. If it was a physical machine, least on 18.04, I'd go with removing netplan, but I'm worried about the prospect of breaking network totally on a cloud VM. – Journeyman Geek Feb 08 '20 at 10:44
  • Yes, changing the network config of cloud VM is not so safe... By the way I've tried on a local Debian machine, and everything works well after edited `/etc/network/interfaces`. – KumaTea Feb 08 '20 at 10:57
  • Debian dosen't use netplan. It's one of Ubuntu's own quirks – Journeyman Geek Feb 08 '20 at 11:01

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
  • 9,037
  • 2
  • 19
  • 37
  • Switching to _ifupdown_ solves the problem. (By the way, both _ifupdown_ and _ifupdown2_ are not installed on the VM, so I just thought the newer should be better) – KumaTea Feb 08 '20 at 17:29