0

I have a problem with port forwarding when I create VMs. When it comes to container it works. I'm using this configuration and it works fine.

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

    # VM-WEB HTTP 80:192.168.0.1:80
    post-up iptables -t nat -A PREROUTING -i vmbr0 -p tcp --dport 80 -j DNAT --to 192.168.0.1:80
    post-down iptables -t nat -D PREROUTING -i vmbr0 -p tcp --dport 80 -j DNAT --to 192.168.0.1:80

When I create a VM and bridge it with vmbr2 I can reach it but no internet "incoming no outgoing " with container it works just fine. Any ideas? 3 days working on it I gave up :)

dda
  • 6,030
  • 2
  • 25
  • 34
Fares K Saleh
  • 37
  • 1
  • 8

1 Answers1

0

Proxmox creates dynamic Routing with containers. Please check your /etc/hosts file ans also your /etc/network/interfaces

patrick_
  • 156
  • 2
  • 12