ReRoutes incoming traffic through one port to another host & port.
(Based on Ambassador pattern in Kubernetes)
- Must be executed with
NET_ADMIN
capabilities. - Configuration is defined by an environment variable (
REROUTER
) which contains:<input_port>:<dest_ip>:<dest_port>
. Multiple routes could be configured separated by,
character.
For example, if you would like to reroute port 1022
to port 22
in host 192.168.200.4
run:
docker run \
-d \
--cap-add=NET_ADMIN \
-p 1022-1024:1022-1024/tcp \
-e REROUTER="1022:192.168.200.4:22, 1023:1.2.3.4:5432, 1024:10.50.0.4:80" \
--name=net-rerouter \
manuellr/net-rerouter