1

I am trying add a transmit GUE tunnel with GRE as the header using IPV6 addresses in linux like this:

ip -6 link add name gue1 type ip6gre remote $REMOTE_IPV6 local $LOCAL_IPV6 dev eth0 encap gue encap-dport 42424

Both $REMOTE_IPV6 and $LOCAL_IPV6 are valid IPV6 addresses. But I keep getting this error:

RTNETLINK answers: Invalid argument

If I remove encap gue then it doesn't give that error since it then defaults to encap type of none. However, the helptext from ip link help ip6gre seems to imply that the valid encap types are encap { fou | gue | none }. What could be the issue causing the encap type to be invalid here?

1
  • encap none runs without error but encap fou or encap gue does not. Jun 8, 2021 at 23:26

1 Answer 1

2

TL;DR:

Run this first:

modprobe fou6

More details

Tested on Linux kernel 5.10.x

There are two issues, one possible issue with the configuration (which doesn't cause the error but might prevent correct operations later), the other that I can only consider a minor bug.

  • the GUE receiving port appears to have to be declared first

    According to online blogs like An intriduction to Linux virtual interfaces: Tunnels | Red Hat Developer:

    # ip fou add port 5555 gue
    # ip link add name tun1 type ipip remote 192.168.1.1 local 192.168.1.2 ttl 225 encap gue encap-sport auto encap-dport 5555
    

    This will set up a GUE receive port for IPIP bound to 5555, and an IPIP tunnel configured for GUE encapsulation.

    So a receive port must be declared first with an ip fou add port XXXX gue command and it will be reused in the encap-dport XXXX part of the second command. The first command is described in ip fou(8) in case more restrictions should be added.

  • but ip fou add port 42424 gue doesn't work either

    # ip fou add port 42424 gue
    RTNETLINK answers: No such file or directory
    Error talking to the kernel
    

    It appears, and this looks like a bug to me, that the kernel module fou isn't autoloaded by using this command. GUE is just an additional mode to FOU handled by the same kernel module fou.

    # modprobe fou
    # ip fou add port 42424 gue
    # ip -6 link add name gue1 type ip6gre remote $REMOTE_IPV6 local $LOCAL_IPV6 dev eth0 encap gue encap-dport 42424
    RTNETLINK answers: Invalid argument
    

    Nor is the kernel module fou6 loaded for the IPv6 part...

    Actually the -6 option had to be added to the ip fou command or the port will be opened on an IPv4 socket.

    # modprobe fou6
    # ip -6 fou add port 42424 gue
    # ip -6 link add name gue1 type ip6gre remote $REMOTE_IPV6 local $LOCAL_IPV6 dev eth0 encap gue encap-dport 42424
    #
    
1
  • I added a note about ip -6 fou
    – A.B
    Jun 9, 2021 at 1:06

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.