[LabFrontPage] [TitleIndex] [WordIndex] 

Using Port Forwarding for Testing Services During Migration

Summary

Port forwarding means to transparently "tunnel" one tcp port to another machine. This can for example be used to forward requests of a certain service to another host during migration

Setup

Using iptables, port forwarding for http can be established as follows:

# iptables -t nat -A PREROUTING -p tcp --dport 8880 -j DNAT --to-destination 134.96.186.124:80

In order to forward requests from clients on the local net, too, we need in addition

# iptables -t nat -A POSTROUTING -p tcp --dst 134.96.186.124 --dport 80 -j SNAT --to-source 134.96.186.68

These examples assume that the old host has ip 68, and the new one has 124.


2019-12-04 16:06