Bug 208173 - can't create GRE-tunnel over IPv6
Summary: can't create GRE-tunnel over IPv6
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 10.2-RELEASE
Hardware: Any Any
: --- Affects Many People
Assignee: freebsd-net mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-03-21 08:43 UTC by Konstantin V Bekreyev
Modified: 2018-06-19 08:36 UTC (History)
2 users (show)

See Also:
me: maintainer-feedback? (net)


Attachments
Add notice about IPv6 encapsulation (849 bytes, patch)
2016-05-07 12:48 UTC, Christian Schwarz
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Konstantin V Bekreyev 2016-03-21 08:43:36 UTC
Why I can't create GRE-tunnel over IPv6? The same problem with gif interface.

# ifconfig gre0 tunnel inet6 2001:db8::1 2001:db8::2
ifconfig: error in parsing address string: hostname nor servname provided, or not known

# ifconfig gre0 tunnel 2001:db8::1 2001:db8::2
ifconfig: SIOCSIFPHYADDR: Address family not supported by protocol family

How I can do it?

I found these RFCs:
RFC2473 https://tools.ietf.org/html/rfc2473
RFC7676 https://tools.ietf.org/html/rfc7676
Comment 1 Konstantin V Bekreyev 2016-03-21 09:18:48 UTC
I found that I must use inet6 keyword before tunnel.

But it's not clear - whether to deliver the simplest possible options?
Without inet6 at all for example, it would be ideal.

For example, I'm trying to create a connection with a single command and get the error:
# ifconfig gre0 inet6 2001:db8:ffff::1 2001:db8:ffff::2 prefixlen 128 inet6 tunnel 2001:db8::1 2001:db8::2
ifconfig: inet6: bad value

But if I using two commands - all is ok:
# ifconfig gre0 inet6 tunnel 2001:db8::1 2001:db8::2
# ifconfig gre0 inet6 2001:db8:ffff::1 2001:db8:ffff::2 prefixlen 128
# ifconfig gre0
gre0: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> metric 0 mtu 1456
        tunnel inet6 2001:db8::1 --> 2001:db8::2
        inet6 2001:db8:ffff::1 --> 2001:db8:ffff::2 prefixlen 128
        inet6 fe80::7a2b:abff:fe13:73ce%gre0 prefixlen 64 scopeid 0xb
        nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
Comment 2 Marie Helene Kvello-Aune 2016-03-21 10:10:30 UTC
I believe this happens because ifconfig requires the address family (inet, inet6, link, possibly others) to be the first argument to the program. Not passing 'inet' works because there's code to make it default to 'inet' for historical/backwards compatible reasons. Essentially, ifconfig is doing exactly what the man page says it should be doing here.

I have a fix for this (and other similar bad UX scenarios) on my todo, but it involves rewriting how ifconfig parse and process arguments. I won't start work on it until after libification of ifconfig (libifconfig).
Comment 3 Christian Schwarz 2016-05-07 12:48:57 UTC
Created attachment 170092 [details]
Add notice about IPv6 encapsulation

Would

> [inet6] tunnel src_address dest_address

be a better choice?