How to provide internet access to VMs in proxmox if only 1 public ip?

IP PUBLIC PROXMOX : 10.3.10.240    -----> vmbr0

IP PRIVATE VM   :   10.7.10.0/24

IP PRIVATE GATEWAY : 10.7.10.100


1. Enter the proxmox web gui click on 

    Proxmox node --> System --> Network -->Create --> Linux Bride




in this config I use ip 10.7.10.100/24 on vmbr1 as a gateway for the VMs






auto vmbr0
iface vmbr0 inet static
        address 10.3.10.240/24
        gateway 10.3.10.1
        bridge-ports ens18
        bridge-stp off
        bridge-fd 0

auto vmbr1
iface vmbr1 inet static
        address 10.7.10.100/24
        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.7.10.0/24' -o vmbr0 -j MASQUERADE
        post-down iptables -t nat -D POSTROUTING -s '10.7.10.0/24' -o vmbr0 -j MASQUERADE


2.  To make the VM accessible via PUBLIC IP

iptables -t nat -A PREROUTING -p tcp -d 10.3.10.240 --dport 80 -i vmbr0 -j DNAT --to-destination 10.7.10.200:80

3.  To make SSH service  on the VM

Posting Komentar

Please Select Embedded Mode To Show The Comment System.*

Lebih baru Lebih lama

Formulir Kontak