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
LXC Host
On our host that hosts our lxc containers, we want to forward the host port 5379
to 6379
of the container (10.37.117.37), so we can connect on a non-standard redis port:
1
|
|
Test over the Internet
Test the connection by connecting to the LXC Host’s IP:
1 2 |
|
Thank You
Thanks for reading my short post on how to use iptables to do port forwarding.