Skip to content

An Ethernet proxy for rpi 4b, based on tcpflow - maintained by Nesto

License

Notifications You must be signed in to change notification settings

nesto-software/EthernetProxy

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ethernet Proxy for Raspberry Pi (armhf)

.github/workflows/build-binaries.yml https://github.com/nesto-software/ProxySuite

Heads Up!

This project is currently being refactored by Nesto.
If you want to participate, feel free to reach out!
For more information, please visit the original README.

Martin Löper <[email protected]>

Development Status

VariantStatus
Software⚙️
Hardware✔️

The hardware variant runs without any known issues.
We are currently not actively developing the software variant. Thus, special hardware which leverages port mirroring is a prerequisite.

Conceptually, the software variant could be implemented using ip forwarding in the Linux kernel, setting up some iptables rules and capturing the packets using this codebase.

Setup

We use the TL-SG105E V4 for the reference design of our hardware variant. The larger TL-SG108E V6 works as well.

Make sure to use a separate ethernet port for the capturing interface (eth-proxy) and the interface with internet & LAN access (eth0). Since the Raspberry Pi 4B has one ethernet interface only, an additional one is needed. We tested the Rankie USB Network Adapter in this scenario and it appears to work just fine.

Port Mirroring

You have to set up port mirroring using the TL-SG105E's manual. The switch is reachable via http://192.168.0.1 (user=pw=admin) by default.

Forward traffic from the POS system's port AND/OR the printer's port to the pi's eth-proxy port.

Install via GitHub Releases Download (binary)

Method Command
curl bash -c "$(curl -fsSL https://raw.githubusercontent.com/nesto-software/EthernetProxy/master/scripts/install-from-release.sh)"
wget bash -c "$(wget -O- https://raw.githubusercontent.com/nesto-software/EthernetProxy/master/scripts/install-from-release.sh)"

Usage

# 1.) make sure to name the eth-proxy interface correctly, e.g. use ./etc/systemd/network/89-nesto-external-eth.link
# 2.) make sure to bring up the eth-proxy interface, e.g. use ./etc/network/interfaces OR manually using `sudo ifconfig eth-proxy up`

# 3.) start the ethernet proxy binary - you must be root to open the interface in promiscuous mode
sudo DEVICE="eth-proxy" EXPRESSION="tcp and dst port 9100" ethernet-proxy

IPC Example

We provided a sample application for Node.js in the ./nodejs-client folder.

  1. Start ethernet-proxy as described above in the usage section
  2. Install Node.js binary from nodejs.org or via nvm.
  3. Install Node.js dependencies:
cd nodejs-client
npm install
  1. node ./nodejs-client/index.js

About

An Ethernet proxy for rpi 4b, based on tcpflow - maintained by Nesto

Topics

Resources

License

Stars

Watchers

Forks

Languages

  • C++ 75.5%
  • C 8.6%
  • M4 8.4%
  • Shell 3.2%
  • CMake 2.5%
  • Dockerfile 0.8%
  • Other 1.0%