Port from Host to VM

Dao

New Member
Mar 3, 2016
1
0
1
33
Hello,

Sorry for the Bad English!

I have Proxmox freshly installed and have a VM created.

The host and the VM than OS Linux Debian.

I have installed on the VM Apache2.

How can I port 80 forward from my host to port 80 of the VM?

I am a beginner in this field. Please precise instructions.

Thank you!

my cfg:

auto vmbr0
iface vmbr0 inet static
address xx.xxx.xxx.xxx
netmask 255.255.255.0
network xx.xxx.xxx.0
broadcast xx.xxx.xxx.255
gateway 89.163.144.1
bridge_ports eth0
bridge_stp off
bridge_fd 0

auto vmbr2
iface vmbr2 inet static
address 10.21.21.254
netmask 255.255.255.0
bridge_ports none
bridge_stp off
bridge_fd 0
post-up echo 1 > /proc/sys/net/ipv4/ip_forward
post-up iptables -t nat -A POSTROUTING -s '10.21.21.0/24' -o vmbr0 -j MASQUERADE
post-down iptables -t nat -D POSTROUTING -s '10.21.21.0/24' -o vmbr0 -j MASQUERADE
post-up iptables -t nat -A PREROUTING -i vmbr0 -p tcp --dport 80 -j DNAT --to 10.21.21.6:80
post-down iptables -t nat -D PREROUTING -i vmbr0 -p tcp --dport 80 -j DNAT --to 10.21.21.6:80
 
Last edited: