Linux foo-over-udp tunnel creation issues

kernellinuxlinux-networkingtunneludp

I want to create fou(foo-over-udp) tunnel on linux 4.4.10 using iproute2 4.5.0 and while trying to create a tunnel i get the following error:

sudo ip link add dev tun0 type ipip remote 172.19.0.9 local 172.19.0.8 encap fou encap-sport auto encap-dport 4444
RTNETLINK answers: Invalid argument

While this usually indicates, that i provided wrong arguments, device still gets created with a wierd name and unconfigured:

10: tunl0@NONE: <NOARP> mtu 1480 qdisc noop state DOWN mode DEFAULT
group default qlen 1
     link/ipip 0.0.0.0 brd 0.0.0.0

I should also mention that fou and ipip kernel modules are loaded:

fou                     9093  0
ip6_udp_tunnel          1967  1 fou
udp_tunnel              2547  1 fou
ipip                    5260  0
ip_tunnel              13315  1 ipip
tunnel4                 2389  1 ipip

I didn't try with any other kernel version, but i did try with latest version of iproute2. I should also mention that i was trying this setup in linux network namespace, but i get the same problem if i do it outside of the namespace. What could be causing this issue, and is there any other alternative to configure fou tunnel? By my observations iproute2 is problematic one.

Best Answer

I was able to setup a FOU tunnel between two virtual machines on the same LAN running unmodified ubuntu 16.04.01. They started with the following configuration network-wise:

jeff@jeff-VirtualBox-ubuntu-16:~$ ip addr show

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00

inet 127.0.0.1/8 scope host lo

   valid_lft forever preferred_lft forever

inet6 ::1/128 scope host 

   valid_lft forever preferred_lft forever

2: enp0s3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 08:00:27:97:1d:bb brd ff:ff:ff:ff:ff:ff

inet 192.168.1.137/24 brd 192.168.1.255 scope global dynamic enp0s3

   valid_lft 86358sec preferred_lft 86358sec

inet6 fe80::3675:b335:4de3:9d6c/64 scope link 

   valid_lft forever preferred_lft forever

jeff@jeff-VirtualBox-ubuntu-16:~$ 

jeff@jeff-VirtualBox-ubuntu-16-2:~$ ip addr show

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00

inet 127.0.0.1/8 scope host lo

   valid_lft forever preferred_lft forever

inet6 ::1/128 scope host 

   valid_lft forever preferred_lft forever

2: enp0s3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast
 state UP group default qlen 1000
link/ether 08:00:27:40:13:85 brd ff:ff:ff:ff:ff:ff

inet 192.168.1.135/24 brd 192.168.1.255 scope global dynamic enp0s3

   valid_lft 86352sec preferred_lft 86352sec

inet6 fe80::7086:fe13:ab8:b44f/64 scope link 

   valid_lft forever preferred_lft forever

I then ran the following to configure both VMs in a 10-net using a FOU tunnel:

root@jeff-VirtualBox-ubuntu-16:~# modprobe fou

root@jeff-VirtualBox-ubuntu-16:~# ip fou add port 55137 ipproto 4

root@jeff-VirtualBox-ubuntu-16:~# ip link add name fou0 type ipip remote 192.168.1.135 local 192.168.1.137 encap fou encap-sport 55137 encap-dport 55135 dev enp0s3

root@jeff-VirtualBox-ubuntu-16:~# ip link set up dev tunl0

root@jeff-VirtualBox-ubuntu-16:~# ip link set up dev fou0

root@jeff-VirtualBox-ubuntu-16:~# ip addr add 10.0.0.137/24 dev fou0

root@jeff-VirtualBox-ubuntu-16:~#


root@jeff-VirtualBox-ubuntu-16-2:~# modprobe fou

root@jeff-VirtualBox-ubuntu-16-2:~# ip fou add port 55135 ipproto 4

root@jeff-VirtualBox-ubuntu-16-2:~# ip link add name fou0 type ipip remote 192.168.1.137 local 192.168.1.135 encap fou encap-sport 55135 encap-dport 55137 dev enp0s3

root@jeff-VirtualBox-ubuntu-16-2:~# ip link set up dev tunl0

root@jeff-VirtualBox-ubuntu-16-2:~# ip link set up dev fou0

root@jeff-VirtualBox-ubuntu-16-2:~# ip addr add 10.0.0.135/24 dev fou0

root@jeff-VirtualBox-ubuntu-16-2:~#

It worked fine for me. Your mileage may vary. 8^)

Related Topic