All Projects → Nat-Lab → Eoip

Nat-Lab / Eoip

Licence: mit
EoIP/EoIPv6 for *nix.

Programming Languages

c
50402 projects - #5 most used programming language

Projects that are alternatives of or similar to Eoip

V2ray Core
A platform for building proxies to bypass network restrictions.
Stars: ✭ 13,438 (+39423.53%)
Mutual labels:  network, tunnel
Otunnel
peer-to-peer tunnel tool
Stars: ✭ 224 (+558.82%)
Mutual labels:  network, tunnel
Tun2socks
tun2socks - powered by gVisor TCP/IP stack
Stars: ✭ 123 (+261.76%)
Mutual labels:  network, tunnel
Trojan Go
Go实现的Trojan代理,支持多路复用/路由功能/CDN中转/Shadowsocks混淆插件,多平台,无依赖。A Trojan proxy written in Go. An unidentifiable mechanism that helps you bypass GFW. https://p4gefau1t.github.io/trojan-go/
Stars: ✭ 4,049 (+11808.82%)
Mutual labels:  network, tunnel
Zserver4d
ZServer4D 是一套从商业项目剥离而出的云服务器中间件,可以承载百万级的分布式负载服务,并且支持IoT及内网穿透
Stars: ✭ 199 (+485.29%)
Mutual labels:  network, tunnel
Nexer
Content based network multiplexer or redirector made with love and Go
Stars: ✭ 7 (-79.41%)
Mutual labels:  network, tunnel
Metta
An information security preparedness tool to do adversarial simulation.
Stars: ✭ 867 (+2450%)
Mutual labels:  network
Androidutilcode
AndroidUtilCode 🔥 is a powerful & easy to use library for Android. This library encapsulates the functions that commonly used in Android development which have complete demo and unit test. By using it's encapsulated APIs, you can greatly improve the development efficiency. The program mainly consists of two modules which is utilcode, which is commonly used in development, and subutil which is rarely used in development, but the utils can be beneficial to simplify the main module. 🔥
Stars: ✭ 30,239 (+88838.24%)
Mutual labels:  network
Pytorch Forecasting
Time series forecasting with PyTorch
Stars: ✭ 849 (+2397.06%)
Mutual labels:  network
Packetfence
PacketFence is a fully supported, trusted, Free and Open Source network access control (NAC) solution. Boasting an impressive feature set including a captive-portal for registration and remediation, centralized wired and wireless management, powerful BYOD management options, 802.1X support, layer-2 isolation of problematic devices; PacketFence can be used to effectively secure networks small to very large heterogeneous networks.
Stars: ✭ 846 (+2388.24%)
Mutual labels:  network
Tina
a powerful android network library base on okhttp
Stars: ✭ 32 (-5.88%)
Mutual labels:  network
Whatpulse
WhatPulse reverse engineered
Stars: ✭ 30 (-11.76%)
Mutual labels:  network
Subdue
The Subdue graph miner discovers highly-compressing patterns in an input graph.
Stars: ✭ 20 (-41.18%)
Mutual labels:  network
Clientserverproject
一个C-S模版,该模版由三部分的程序组成,一个服务端运行的程序,一个客户端运行的程序,还有一个公共的组件,实现了基础的账户管理功能,版本控制,软件升级,公告管理,消息群发,共享文件上传下载,批量文件传送功能。具体的操作方法见演示就行。本项目的一个目标是:提供一个基础的中小型系统的C-S框架,客户端有三种模式,无缝集成访问,winform版本,wpf版本,asp.net mvc版本,方便企业进行中小型系统的二次开发和个人学习。同时网络组件方便的支持读写三菱和西门子PLC的数据,详细见Readme
Stars: ✭ 873 (+2467.65%)
Mutual labels:  network
Tk Listen
A library that allows to listen network sockets with proper resource limits and error handling
Stars: ✭ 27 (-20.59%)
Mutual labels:  network
Powermodelsannex.jl
A PowerModels.jl Extension Package for Exploratory Work
Stars: ✭ 11 (-67.65%)
Mutual labels:  network
Networkmnt
Monitor network float of process
Stars: ✭ 31 (-8.82%)
Mutual labels:  network
Pyetcdlock
a mutux network lock based on etcd
Stars: ✭ 9 (-73.53%)
Mutual labels:  network
Hsdn
Analysis of the human symptoms–disease network
Stars: ✭ 15 (-55.88%)
Mutual labels:  network
Xinblog
前端基础。Vue框架。数据结构与算法。计算机网络。夯实基础。
Stars: ✭ 29 (-14.71%)
Mutual labels:  network

eoip

This is an implement of MikroTik's EoIP/EoIPv6 tunnel using TAP. EoIP (Ethernet over IP) and EoIPv6 (Ethernet over IPv6) are MikroTik RouterOS's Layer 2 tunneling protocol.

The 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.

Supported Systems

  • Linux
  • OpenBSD*
  • FreeBSD*
  • Darwin

* 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.

Install

# git clone https://github.com/nat-lab/eoip
# cd eoip
# make
# make install

Usage

Usage: eoip [ OPTIONS ] IFNAME { remote RADDR } { local LADDR } [ id TID ]
                               [ mtu MTU ] [ uid UID ] [ gid GID ] [ fork ]
where: OPTIONS := { -4 | -6 }

The 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.

Optionally 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.

Notice 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.

Example

On MikroTik:

[[email protected]] > /interface eoip add local-address=172.17.0.1 name=eoip-1 remote-address=172.17.0.2 tunnel-id=100

On the other side:

# eoip -4 tap1 local 172.17.0.2 remote 172.17.0.1 id 100

Now tap1 is connected to eoip-1 on MikroTik, don't forget to bring tap1 up.

Protocol

EoIP uses IP Protocol 47, which is the same as GRE.

Here's the packet format of EoIP:

0                   1                   2                   3
0 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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|       GRE FLAGS 0x20 0x01     |      Protocol Type  0x6400    | = "\x20\x01\x64\x00"
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|   Encapsulated frame length   |           Tunnel ID           |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Ethernet frame...                                             |

(noticed that encapsulated frame length is in BE while Tunnel ID is in LE)

EoIPv6 is much simpler. It use IP Protocol 97, which is the same as EtherIP:

0                   1                   2                   3
0 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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|  EoIP HEADER  | Ethernet frame...                             |

Header part of EoIPv6 are similar to 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:

0   1   2   3   4   5   6   7   8   9  10  11  12  13  14  15
+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
|               |               |                               |
|  TID Part 1   |    VERSION    |          TID Part 2           |
|               |               |                               |
+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+

where VERSION = "\x03".

Contribute/Bugs

Feel free to send PR or report issue on the Github project page at:

https://github.com/nat-lab/eoip

Acknowledgement

My waifu @amphineko for making me de-punk this project :)

Licenses

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].