Hi guys,
I got another problem today.
I got a proxmox node (running version 6.1-8) that has got one public IP (lets say A.A.A.A) and one secondary IP (lets say B.B.B.B).
I also got a bridge with the internal network 192.16.8.0/24 where every VM gets an IP. Currently my setup is working and I can portforward to my containers/VMs without a problem
But what I would like to do is to forward the port 2020 to one of two VMs depending on the destination IP
For instance:
Is this possible and how could I do this? I read on the forum (here) that something like SNAT could work but I am not sure how the iptables command should look like. Is the following example code somehow working for my needs?
Thanks in advance
I got another problem today.
I got a proxmox node (running version 6.1-8) that has got one public IP (lets say A.A.A.A) and one secondary IP (lets say B.B.B.B).
I also got a bridge with the internal network 192.16.8.0/24 where every VM gets an IP. Currently my setup is working and I can portforward to my containers/VMs without a problem
But what I would like to do is to forward the port 2020 to one of two VMs depending on the destination IP
For instance:
A.A.A.A:2020 gets forwarded to 192.16.8.100:2020
B.B.B.B:2020 gets forwarded to 192.16.8.200:2020
Is this possible and how could I do this? I read on the forum (here) that something like SNAT could work but I am not sure how the iptables command should look like. Is the following example code somehow working for my needs?
iptables -t nat -A PREROUTING -p tcp --dport 8188 -j DNAT --to-destination 192.168.1.10:80
iptables -t nat -A POSTROUTING -p tcp --sport 80 -s 192.168.1.10 -j SNAT --to-source 213.214.215.216:8188
Thanks in advance