This is a quick post on how to do port forwarding with iptables on linux.
What would we like to achieve
We have a lxc container running a redis server and we would like to do port forwarding so that we can reach the server over the internet
On our host that hosts our lxc containers, we want to forward the host port
6379 of the container (10.37.117.37), so we can connect on a non-standard redis port:
Test over the Internet
Test the connection by connecting to the LXC Host’s IP:
Thanks for reading my short post on how to use iptables to do port forwarding.