bschelst/ November 20, 2017/ Linux/ 0 comments

You can use the following shell commands in order to redirect a port to another port.

PORT_FROM=443 
PORT_TO=443 
DEST=10.33.35.110 
iptables -t nat -A PREROUTING -p tcp --dport $PORT_FROM -j DNAT --to $DEST:$PORT_TO 
iptables -t nat -A POSTROUTING -p tcp -d $DEST --dport $PORT_TO -j MASQUERADE
Share this Post

Leave a Comment

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>
*
*

one × 5 =