From 2ca8c31924869e53118768c0edcea629d684ee67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carl=20Ho=CC=88rberg?= Date: Sun, 9 Jun 2019 00:10:10 +0200 Subject: [PATCH] more text in the readme --- README.md | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 3d4ab35..5071a95 100644 --- a/README.md +++ b/README.md @@ -25,13 +25,18 @@ Usage: tcpprism [arguments] -h, --help Show this help ``` -Eg.: - -``` +If you for example would like to mirror the traffic currently coming in to a +server on port 80, to another server also running on port 80, but without +stopping and changing port of the original server, you can use trick with +iptables that redirects port 80 to the `tcpprism` server, which in turn will +forward the traffic to both the original server and the server on the other +host. + +```sh ulimit -n 16384 -tcpprism --listen 0.0.0.0:80 --forward 127.0.0.1:8080 --mirror 10.0.0.2:8080 +iptables -t nat -A PREROUTING -i ens5 -p tcp --dport 80 -j REDIRECT --to-port 8080 +tcpprism --listen 0.0.0.0:8080 --forward 127.0.0.1:80 --mirror 10.0.0.2:80 ``` - ## Contributing 1. Fork it ()