Redirect traffic using iptables

HOST_PORT=3230
PUBLIC_IP=192.168.1.150
CONT_PORT=22
CONT_IP=10.121.80.77

sudo iptables -t nat -I PREROUTING -i eth0 -p TCP -d $PUBLIC_IP --dport $HOST_PORT -j DNAT --to-destination $CONT_IP:$CONT_PORT -m comment --comment "forward ssh to the container"

Revision #6
Created Sat, Sep 22, 2018 11:13 PM by kenneth
Updated Mon, Sep 24, 2018 1:21 PM by kenneth