I have this scenario:
- a HOST machine running Debian with ufw installed.
- a CentOS docker container that have an VM that working on an specific IP.
- This VM have an app working on the container calling
https://app.domainas put an entry in
I want calling
localhost:7000 on my HOST machine and use the VM app that is in the container.
I already exposed the port of the container while running it with
I read about
iptables and I tried to redirect the traffic on the container, but without success!
If this is the way... can anyone make an example of
iptables command that I should run?
EDIT: Following this I tried:
IP_CONTAINER=xxx.xxx.xxx.xxx APP_IP=xxx.xxx.xxx.xxx echo 1 > /proc/sys/net/ipv4/ip_forward iptables -t nat -A PREROUTING --protocol tcp --destination $APP_IP --dport 80 --source $IP_CONTAINER --jump DNAT --to-destination $APP_IP iptables -t nat -A POSTROUTING -j MASQUERADE
but still without success!