| 1 | # OpenVPN Data Channel Offload in the linux kernel (ovpn-dco) - OBSOLETE (only for OpenVPN <2.7.0) |
| 2 | |
| 3 | ## COMPATIBILITY NOTE |
| 4 | |
| 5 | The kernel module in this repository is compatible only with OpenVPN 2.6.x and |
| 6 | older. |
| 7 | |
| 8 | For OpenVPN 2.7.0 and newer you MUST use the new `ovpn` kernel module. |
| 9 | It comes with Linux kernel 6.16 and onwards. |
| 10 | |
| 11 | If you are running an older kernel, you can compile an out-of-tree version |
| 12 | of `ovpn` using the code provided at the following repository: |
| 13 | |
| 14 | https://github.com/OpenVPN/ovpn-backports |
| 15 | |
| 16 | ## MAINTENANCE MODE |
| 17 | |
| 18 | This repository is currently in maintenance mode and we only accept important |
| 19 | and meaningful bugfixes. |
| 20 | |
| 21 | For the new version of the DCO linux kernel module, namely `ovpn`, please refer |
| 22 | to the following repository: |
| 23 | |
| 24 | https://github.com/OpenVPN/ovpn-net-next |
| 25 | |
| 26 | # License |
| 27 | |
| 28 | ovpn-dco is released under the terms of the GPLv2 license. |
| 29 | |
| 30 | |
| 31 | # Submitting patches |
| 32 | |
| 33 | Patches for ovpn-dco can be submitted to the openvpn-devel mailing list at |
| 34 | [email protected] |
| 35 | |
| 36 | The patch subject *must* start with "ovpn-dco:". This way patches for this |
| 37 | project can easily be dinstinguished from patches for other projects. |
| 38 | At the same time it is part of the kernel guidelines to have subjects starting |
| 39 | with a prefix identifying the component being modified (ovpn-dco in this case). |
| 40 | |
| 41 | To generate patches, please use git-format-patch and git-send-email. |
| 42 | |
| 43 | |
| 44 | # Building |
| 45 | |
| 46 | To build the ovpn-dco kernel module, just type: |
| 47 | |
| 48 | $ make |
| 49 | |
| 50 | in the root folder. |
| 51 | The Makefile will autodetect your running kernel and will try to use its |
| 52 | headers to get the code compiled. |
| 53 | |
| 54 | If you want to build ovpn-dco against a kernel different from the one |
| 55 | running on the host, run: |
| 56 | |
| 57 | $ make KERNEL_SRC=/path/to/the/kernel/tree |
| 58 | |
| 59 | The control is passed to the kernel Makefile, therefore any kernel Makefile |
| 60 | argument can be specified on the command line and it will be passed |
| 61 | automatically. |
| 62 | |
| 63 | Once done building, executing the command: |
| 64 | |
| 65 | $ make install |
| 66 | |
| 67 | will install the ovpn-dco.ko kernel module in the updates/ subfolder of |
| 68 | the kernel modules directory on your system. |
| 69 | It normally means `/lib/modules/$(uname -r)/updates/`. |
| 70 | |
| 71 | |
| 72 | # Testing |
| 73 | |
| 74 | A basic pre-shared-key client (called ovpn-cli) is also provided in the |
| 75 | tests/ folder. |
| 76 | It can be compiled by typing: |
| 77 | |
| 78 | $ make tests |
| 79 | |
| 80 | One way to test ovpn-dco is to run multiple tun interfaces on the same hosts |
| 81 | associated with different network namespaces. |
| 82 | A script that takes care of setting up 2 NS and 2 interfaces is provided at |
| 83 | `tests/netns-test.sh`. |
| 84 | |
| 85 | By running this script from the tests folder as follows: |
| 86 | |
| 87 | $ cd tests |
| 88 | $ ./netns-test.sh |
| 89 | |
| 90 | the host will configure a basic tunnel using a pre-shared key (the ovpn-cli |
| 91 | binary is used for this). |
| 92 | |
| 93 | The 2 namespaces are named `peer0` and `peer1`. Each interface is respectively |
| 94 | configured with `5.5.5.1/24` and `5.5.5.2/24`. |
| 95 | |
| 96 | At this point it is possible to make a basic ping test by executing: |
| 97 | |
| 98 | $ ip netns exec peer0 ping 5.5.5.2 |
| 99 | |
| 100 | If the command above works, it means that the 2 interfaces are exchanging |
| 101 | traffic properly over the ovpn link. |
| 102 | |
| 103 | Note: running kernel must have network namespaces support compiled in, but it |
| 104 | is fairly standard on modern Linux distros. |
| 105 | |
| 106 | For reference, a sample kernel config file is provided in tests/qemu/config.net-next. |
| 107 | This config file is used for compiling a minimal kernel based on the net-next tree. |
| 108 | |
| 109 | |
| 110 | To run net-next, it's better to rely on any VM, so that the developer does not need |
| 111 | to worry about bugs or spurious kernel crashes. For this reason qemu is suggested |
| 112 | (but any other VM is fine too). At `tests/qemu/launch_deb2.sh` a sample script |
| 113 | can be found that shows how qemu can be launched for testing. |
| 114 | |
| 115 | |
| 116 | # Limitations |
| 117 | |
| 118 | This is a list of current limitations which are planned to be removed as we move forward: |
| 119 | * Only AEAD mode and 'none' (with no auth) supported |
| 120 | * Only AES-GCM and CHACHA20POLY1305 ciphers supported |