From 0c4ef661e2abf29e6b951a70e07565b3c74e2b65 Mon Sep 17 00:00:00 2001 From: BodgeMaster <> Date: Thu, 6 Feb 2025 19:32:29 +0100 Subject: [PATCH] README: add documentation --- README.md | 44 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 4946b02..8471887 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,45 @@ +``` +|\ /| +| \______/ | +| ,,,,,,,, | +| |||||||| | +| |||||||| | +| ¯¯¯¯¯¯¯¯ | +|__________| + \- -/ +``` + # EtherCat -a tool to interface tap interfaces with stdin and stdout +A simple tool written in C that connects a Linux tap interface to stdin and stdout + +## How to build + +- Prerequisites: Linux, C compiler + - Might be easily portable to other systems that support tap interfaces, Idk. +- Run `./build.sh` +- Install by copying to `/usr/local/bin` or just leave it where it is + +## How to use + +Run as root: +``` +ip tuntap add mode tap user USERNAME group GROUPNAME name tapN +ip link set tapN up +``` +Run as user: +`ethercat tapN` + +## Simple network tunnel: + +Be warned: This will behave as if you had both sides connected with a (slow and less reliable) cable. This is more of a bridge than a regular VPN. +If you bridge both sides to a real NIC and you have DHCP servers on both networks, you will end up with two DHCP servers on the same network. + +- Set up a bridge between a physical NIC and the tap interface on one or both sides +- Connect a port between the hosts, for example using SSH port forwarding +- Make two FIFOs on both hosts (mkfifo) +- Use netcat to connect the FIFOs between the hosts through the forwarded port + - `nc -l 10000 < fifo1 > fifo2` + - `nc localhost 10000 < fifo1 > fifo2` +- Start an instance of EtherCat with the other ends of the FIFOs on both hosts + - `./ethercat tapN < fifo2 > fifo1`