A simple tool that connects tap interfaces to stdin/stdout
 
 
Go to file
BodgeMaster 0c4ef661e2 README: add documentation 2025-02-06 19:32:29 +01:00
.gitignore Initial commit, start writing EtherCat 2025-01-29 23:40:28 +01:00
README.md README: add documentation 2025-02-06 19:32:29 +01:00
build.sh build.sh: show commands as they are run 2025-02-06 17:01:23 +01:00
ethercat.c And now rewrite half of it bc the previous approach didn't actually work... 2025-02-06 17:30:48 +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