{"id":13839668,"url":"https://github.com/Nat-Lab/eoip","last_synced_at":"2025-07-11T06:31:01.733Z","repository":{"id":97020687,"uuid":"117755327","full_name":"Nat-Lab/eoip","owner":"Nat-Lab","description":"EoIP/EoIPv6 for *nix.","archived":false,"fork":false,"pushed_at":"2019-01-15T22:59:10.000Z","size":36,"stargazers_count":59,"open_issues_count":4,"forks_count":25,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-08-05T17:24:02.276Z","etag":null,"topics":["mikrotik","network","tunnel"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Nat-Lab.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2018-01-16T23:25:25.000Z","updated_at":"2024-06-16T10:48:59.000Z","dependencies_parsed_at":"2024-01-23T12:27:38.931Z","dependency_job_id":null,"html_url":"https://github.com/Nat-Lab/eoip","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nat-Lab%2Feoip","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nat-Lab%2Feoip/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nat-Lab%2Feoip/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nat-Lab%2Feoip/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Nat-Lab","download_url":"https://codeload.github.com/Nat-Lab/eoip/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225699955,"owners_count":17510432,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["mikrotik","network","tunnel"],"created_at":"2024-08-04T17:00:33.000Z","updated_at":"2024-11-21T08:31:21.729Z","avatar_url":"https://github.com/Nat-Lab.png","language":"C","funding_links":[],"categories":["C","C (286)"],"sub_categories":[],"readme":"eoip\n---\n\nThis is an implement of MikroTik's [EoIP](http://wiki.mikrotik.com/wiki/Manual:Interface/EoIP)/EoIPv6 tunnel using TAP. EoIP (Ethernet over IP) and EoIPv6 (Ethernet over IPv6) are MikroTik RouterOS's Layer 2 tunneling protocol.\n\nThe EoIP protocol encapsulates Ethernet frames in the GRE (IP protocol number 47) packets, and EoIPv6 protocol encapsulates Ethernet frames in the EtherIP (IP protocol number 97) packets.\n\n### Supported Systems\n\n- Linux\n- OpenBSD*\n- FreeBSD*\n- Darwin\n\n\\* For some reason that I don't yet understand, specifying a local address of an interface on BSD-Based systems (except Darwin) will make `bind()` \"Can't assign requested address.\" Please use `0.0.0.0` as the local address on these systems.\n\n### Install\n\n```\n# git clone https://github.com/nat-lab/eoip\n# cd eoip\n# make\n# make install\n```\n\n### Usage\n\n```\nUsage: eoip [ OPTIONS ] IFNAME { remote RADDR } { local LADDR } [ id TID ]\n                               [ mtu MTU ] [ uid UID ] [ gid GID ] [ fork ]\nwhere: OPTIONS := { -4 | -6 }\n```\n\nThe parameters are pretty self-explanatory. `RADDR` = remote address, `LADDR` = local address, `TID` = tunnel ID, and `OPTIONS` can be either `-4` (EoIP) or `-6` (EoIPv6), EoIP will be used if unset. IFNAME, LADDR and RADDR are required fields, but there are not any parameter check whatsoever, so make sure you do it right.\n\nOptionally you might choose to set MTU, set UID/GID of the process, or fork process to the background. If you set `fork`, `eoip` will fork to background and print PID to stdout.\n\nNotice that `IFNAME` does not matter if you are using a non-Linux system, since `IFNAME` of TAP can't be set by us on the non-Linux system. Also, if you are using BSD, make sure to bring the TAP interface up as soon as you can. On BSD/Darwin, reading TAP file descriptor won't block if TAP is down, and this use up CPU cycles pretty quickly.\n\n### Example\n\nOn MikroTik:\n\n```\n[user@mikrotik] \u003e /interface eoip add local-address=172.17.0.1 name=eoip-1 remote-address=172.17.0.2 tunnel-id=100\n```\n\nOn the other side:\n\n```\n# eoip -4 tap1 local 172.17.0.2 remote 172.17.0.1 id 100\n```\n\nNow `tap1` is connected to `eoip-1` on MikroTik, don't forget to bring `tap1` up.\n\n### Protocol\n\nEoIP uses IP Protocol 47, which is the same as GRE.\n\nHere's the packet format of EoIP:\n\n```\n0                   1                   2                   3\n0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1\n+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n|       GRE FLAGS 0x20 0x01     |      Protocol Type  0x6400    | = \"\\x20\\x01\\x64\\x00\"\n+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n|   Encapsulated frame length   |           Tunnel ID           |\n+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n| Ethernet frame...                                             |\n```\n\n(noticed that encapsulated frame length is in BE while Tunnel ID is in LE)\n\nEoIPv6 is much simpler. It use IP Protocol 97, which is the same as EtherIP:\n\n```\n0                   1                   2                   3\n0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1\n+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n|  EoIP HEADER  | Ethernet frame...                             |\n```\n\nHeader part of EoIPv6 are similar to [RFC3378](https://tools.ietf.org/html/rfc3378). The 12 reserved bits in the EtherIP header are now Tunnel ID. MikroTik also swaps the first four bits with second four bits in the EtherIP header, so the header looks like this:\n\n```\n0   1   2   3   4   5   6   7   8   9  10  11  12  13  14  15\n+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+\n|               |               |                               |\n|  TID Part 1   |    VERSION    |          TID Part 2           |\n|               |               |                               |\n+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+\n```\n\nwhere `VERSION` = ``\"\\x03\"``.\n\n### Contribute/Bugs\n\nFeel free to send PR or report issue on the Github project page at:\n\nhttps://github.com/nat-lab/eoip\n\n### Acknowledgement\n\n\u003cdel\u003eMy waifu\u003c/del\u003e [@amphineko](https://github.com/amphineko) for making me de-punk this project :)\n\n### Licenses\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FNat-Lab%2Feoip","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FNat-Lab%2Feoip","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FNat-Lab%2Feoip/lists"}