A simple tool that connects tap interfaces to stdin/stdout
 
 
Go to file
BodgeMaster 4e7adb9c53 fix a bug that prevented --help from being detected correctly 2025-02-10 16:34:51 +01:00
.gitignore add build script for static binary 2025-02-10 14:26:17 +01:00
README.md README: add documentation 2025-02-06 19:32:29 +01:00
build-static.sh add build script for static binary 2025-02-10 14:26:17 +01:00
build.sh build.sh: show commands as they are run 2025-02-06 17:01:23 +01:00
ethercat.c fix a bug that prevented --help from being detected correctly 2025-02-10 16:34:51 +01:00

README.md

|\        /|
| \______/ |
| ,,,,,,,, |
| |||||||| |
| |||||||| |
| ¯¯¯¯¯¯¯¯ |
|__________|
  \-    -/

EtherCat

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