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:
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
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).
Created attachment 170092 [details]
Add notice about IPv6 encapsulation
> [inet6] tunnel src_address dest_address
be a better choice?