bbonev / eoip Goto Github PK
View Code? Open in Web Editor NEWLinux kernel mode EOIP tunnel (compatible with MikroTik)
License: GNU General Public License v2.0
Linux kernel mode EOIP tunnel (compatible with MikroTik)
License: GNU General Public License v2.0
# dkms status
eoip, 1.1, 5.14.21-150400.24.97-default, x86_64: installed
# modprobe eoip
modprobe: ERROR: could not insert 'eoip': Invalid argument
# dmesg | grep -i eoip
--snip--
[93971.853997] EoIP (IPv4) tunneling driver
[93971.854004] eoip init: can't add protocol
I'm able to build and install the latest commit using DKMS on a Raspberry Pi 4 B running Raspbian 11 kernel 6.1.21-v7l+
Any help is appreciated.
Version: Linux server.com 5.4.188-1.el7.elrepo.x86_64 #1 SMP Mon Mar 28 09:10:07 EDT 2022 x86_64 x86_64 x86_64 GNU/Linux
gcc:
Target: x86_64-redhat-linux Configured with: ../configure --enable-bootstrap --enable-languages=c,c++,fortran,lto --prefix=/opt/rh/devtoolset-9/root/usr --mandir=/opt/rh/devtoolset-9/root/usr/share/man --infodir=/opt/rh/devtoolset-9/root/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-shared --enable-threads=posix --enable-checking=release --enable-multilib --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-gcc-major-version-only --with-linker-hash-style=gnu --with-default-libstdcxx-abi=gcc4-compatible --enable-plugin --enable-initfini-array --with-isl=/builddir/build/BUILD/gcc-9.3.1-20200408/obj-x86_64-redhat-linux/isl-install --disable-libmpx --enable-gnu-indirect-function --with-tune=generic --with-arch_32=x86-64 --build=x86_64-redhat-linux Thread model: posix gcc version 9.3.1 20200408 (Red Hat 9.3.1-2) (GCC)
Problem:
When I start building eoipcr an error is occured
[root@server eoip]# make CC eoipcr.o In file included from eoipcr.c:7: /usr/include/linux/if_tunnel.h:42:16: error: field ‘iph’ has incomplete type 42 | struct iphdr iph; | ^~~ make: *** [eoipcr.o] Error 1
How to fix:
Add include ip.h before if_tunnel.h
#include <linux/ip.h>
#include <linux/if_tunnel.h>
Is it a problem in my version if_tunnel.h that is lack of include if ip.h or wrong include in eoipcr.c?
Maybe it is better to add including ip.h or write additional section in readme section with known issues&
Good day!
Please tell me how can I send a packet larger than 1500 through the eoip with parameter do-not-fragmet ?
With mtu 1500 and less all work great.
root@OpenWrt:/tmp/eoip# lsmod | grep eoip
eoip 7985 0
gre 2884 1 eoip
[ 388.224454] gre: GRE over IPv4 demultiplexor driver
[ 392.064801] EoIP (IPv4) tunneling driver
root@OpenWrt:/tmp/eoip# ip add | grep br10
6: eth3@dsa: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1600 qdisc noqueue master br10 state UP qlen 1000
9: br10: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1600 qdisc noqueue state UP qlen 1000
10: eoip0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel master br10 state UNKNOWN qlen 1000
root@OpenWrt:/tmp/eoip# ifconfig eoip0 mtu 1600
ifconfig: SIOCSIFMTU: Invalid argument
[ 791.378925] eoip0: mtu greater than device maximum
If I try to change the mtu of the tunnel, it gives an error
Hostname OpenWrt
Model Ubiquiti EdgeRouter X
Architecture MediaTek MT7621 ver:1 eco:3
Target Platform ramips/mt7621
Firmware Version OpenWrt SNAPSHOT r22549-9cbc83726e / LuCI Master git-23.093.56957-2145121
Kernel Version 5.15.106
I'm not well versed in all these matters, but I want to transfer EoIP from Mikrotik to Debian 11 and 12.
Can you write the instructions in more detail?
What should I do on a newly installed Debian 11?
Kernel 5.10.0-26-amd64
Hi,
Are there any plans to implement support for Kernel 5.15.x?
To make sysops' work easier, DKMS package would make kernel updates smoother because it would build the module automatically during kernel update (until we get this patch to mainline Linux).
[ 2939.235820] bond0: (slave eoip1): Enslaving as an active interface with an up link
[ 2939.351904] bond0: (slave eoip1): Releasing backup interface
[ 2939.357007] bond0: (slave eoip2): Enslaving as an active interface with an up link
[ 2939.362687] bonding: bond0 is being deleted...
[ 2939.363228] bond0 (unregistering): (slave eoip2): Releasing backup interface
[ 2939.365937] bond0 (unregistering): Released all slaves
[ 2939.462452] bonding: bond0 is being created...
[ 2939.690226] bond0: (slave eoip3): Enslaving as an active interface with an up link
[ 2939.975784] bond0: (slave eoip3): link status definitely up, 0 Mbps full duplex
[ 2939.975793] bond0: active interface up!
file kernel-4.15.0-eoip-gre-demux.patch
reports "file to patch: "
tried on kernels 4.15.175, 4.19.237. Ubuntu 18.04.6
This is probably coming from removing #include <netinet/in.h>
in 6430c84
Adding #include <stdint.h>
to libnetlink.c
fixes the issue.
user@localhost:~/eoip$ make
CC libnetlink.o
libnetlink.c: In function ‘rtnl_talk’:
libnetlink.c:348:26: error: ‘uint32_t’ undeclared (first use in this function)
if (nladdr.nl_pid != (uint32_t)peer ||`
...
On Mikrotik you can clear Do not Fragment flag with a mangle rule, https://wiki.mikrotik.com/wiki/Manual:IP/Firewall/Mangle , clear-df - clear 'Do Not Fragment' Flag . OpenBSD also has support for this in it's implementation of EOIP.
Can you remove DF flag on traffic going through the EOIP tunnel?
Thanks for merging my PR.
I noticed you remove cat from the lines.
Just a heads up, without piping lsmod like this
loaded=$(lsmod | grep '^gre ' | cat)
the script will cease executing without an error message.
This is because bash is invoked with #!/bin/bash -e
which will exit on error. As the output of the command is captured into a variable, nothing is shown in the output of the script.
There is no IPv6 support for tunnel end points. It occurs an error "invalid ip address" if you use IPv6 addresses for local and remote ip address. Thus, not compatible with Mikrotik IPv6 EOIP. Please extend support.
planned for the kernel version 3.8?
Looks like we need to have
diff --git i/net/ipv4/eoip.c w/net/ipv4/eoip.c
index 50bc7b466e9e..ba7c386a18b9 100644
--- i/net/ipv4/eoip.c
+++ w/net/ipv4/eoip.c
@@ -344,7 +344,7 @@ static int eoip_rcv(struct sk_buff *skb)
skb->protocol = ARPHRD_ETHER;
skb->mac_header = skb->network_header;
- __pskb_pull(skb, offset);
+ pskb_pull(skb, offset);
skb_postpull_rcsum(skb, skb_transport_header(skb), offset);
skb->pkt_type = PACKET_HOST;
#ifdef CONFIG_NET_IPGRE_BROADCAST
for 6.1 to work correctly, or we get net/ipv4/eoip.c:347:17: error: implicit declaration of function ‘__pskb_pull’; did you mean ‘__skb_pull’? [-Werror=implicit-function-declaration]
I have a Debian host that I want to connect over EOIP to multiple Mikrotik Routers. I've cloned the repository, and did an out of tree build to build the modules. I followed the example listed in the readme and can succesfully get EOIP working. I'm however not sure if I did it right as it does not persist a reboot or am unable to figure out how to define these EOIP tunnels in a configuration file. My Debian OS version:
root@:/# cat /etc/debian_version
10.11
root@:/# uname -r
4.19.0-18-amd64
root@:/#
What I did?
root@:/# git clone https://github.com/bbonev/eoip.git
root@:/# cd eoip/
root@:/# make
root@:/# cd out-of-tree-4.19.x/
root@:/# make
root@:/# insmod ./gre.ko
root@:/# insmod ./eoip.ko
From that point I can add EOIP interfaces and bring them up, however I cannot figure out what I should do best to run this at boot? Eventually I want to add multiple EOIP tunnels to a bridge that also has some VLANs to give out an IP from that VLAN and communicatie with other hosts. My POC is working, I just cannot figure out how to do this at boot and persist.
Anyone that can help me in the right direction what I might be doing wrong? At this point I'm even unsure if I patched the kernel even.
A interface é listada mas não se comunica.
Hi,
I think that your project may fit into Vyos.net project to improve interoperability
Take a look to the project if you can.
Any chance to have a release for 3.10 and > kernel ?
Hello,
are there any chances of this getting merged into the mainline kernel?
Hi,
I install a ubuntu 18.04 under VMWare and upgrade kernel to 4.19.128-0419128, then I try to make eoip connection between my VPS and another RouterOS in VMWare, I use the command "eoip add name testeoip local 192.168.17.12 remote 192.168.17.13 tunnel-id 6" on my ubuntu, and I got the response :
RTNETLINK
answers: Operation not permitted
failed to talk to netlink!`
Does I need install some support libraries on my VPS or change any settings to make it working? Please help, Thank you very much!
Got this error below while compiling.
my system is Ubuntu 18.04.5 LTS
dafi@fujitsu:~/linux-source-4.15.0/eoip/out-of-tree-4.15.x$ make
make[1]: Entering directory '/usr/src/linux-headers-4.15.0-65-generic'
CC [M] /home/dafi/linux-source-4.15.0/eoip/out-of-tree-4.15.x/eoip.o
/home/dafi/linux-source-4.15.0/eoip/out-of-tree-4.15.x/eoip.c: In function ‘eoip_if_xmit’:
/home/dafi/linux-source-4.15.0/eoip/out-of-tree-4.15.x/eoip.c:485:3: error: too many arguments to function skb_dst((const struct sk_buff *)skb)->ops->update_pmtu’
skb_dst(skb)->ops->update_pmtu(skb_dst(skb), NULL, skb, mtu, true);
^~~~~~~
scripts/Makefile.build:337: recipe for target '/home/dafi/linux-source-4.15.0/eoip/out-of-tree-4.15.x/eoip.o' failed
make[2]: *** [/home/dafi/linux-source-4.15.0/eoip/out-of-tree-4.15.x/eoip.o] Error 1
Makefile:1571: recipe for target 'module/home/dafi/linux-source-4.15.0/eoip/out-of-tree-4.15.x' failed
make[1]: *** [module/home/dafi/linux-source-4.15.0/eoip/out-of-tree-4.15.x] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-4.15.0-65-generic'
Makefile:11: recipe for target 'default' failed
make: *** [default] Error 2
Linux build novice here (just to be clear)...
uname -r
:
4.19.0-16-amd64
followed procedure:
apt install build-essential
apt install linux-headers-amd64
git clone https://github.com/bbonev/eoip.git
cd eoip/out-of-tree-4.19.x/
make
make install
make
result:
patching file eoip.c
using 4.19.0 version of gre_demux.c
using 4.19.0 version of gre.h
patching file gre.h
Hunk #1 succeeded at 24 (offset 15 lines).
patching file gre_demux.c
Hunk #1 succeeded at 31 (offset 1 line).
Hunk #3 succeeded at 155 (offset -129 lines).
Hunk #4 succeeded at 191 (offset -129 lines).
make[1]: Entering directory '/usr/src/linux-headers-4.19.0-16-amd64'
CC [M] /root/eoip/out-of-tree-4.19.x/eoip.o
CC [M] /root/eoip/out-of-tree-4.19.x/gre.o
Building modules, stage 2.
MODPOST 2 modules
CC /root/eoip/out-of-tree-4.19.x/eoip.mod.o
LD [M] /root/eoip/out-of-tree-4.19.x/eoip.ko
CC /root/eoip/out-of-tree-4.19.x/gre.mod.o
LD [M] /root/eoip/out-of-tree-4.19.x/gre.ko
make[1]: Leaving directory '/usr/src/linux-headers-4.19.0-16-amd64'
make install
result:
make[1]: Entering directory '/usr/src/linux-headers-4.19.0-16-amd64'
INSTALL /root/eoip/out-of-tree-4.19.x/eoip.ko
INSTALL /root/eoip/out-of-tree-4.19.x/gre.ko
DEPMOD 4.19.0-16-amd64
Warning: modules_install: missing 'System.map' file. Skipping depmod.
make[1]: Leaving directory '/usr/src/linux-headers-4.19.0-16-amd64'
thank you in advance!
how to coennect using IPSEC Secret
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.