Port from Host to VM

Dao

New Member
Mar 3, 2016
1
0
1
32
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:

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!