Proxmox VM, no internet

#1

Hello everyone

We have started a new Proxmox 6 and I am not able to get internet access from the virtual machines.
Earlier we have used Proxmox 4 without any problems.

We have tried with this information in the interfaces file:

auto lo
iface lo inet loopback

auto enp1s0f0
iface enp1s0f0 inet static
        address 51.15.185.203
        netmask 255.255.255.0
        gateway 51.15.185.1

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 enp1s0f0 -j MASQUERADE
    post-down iptables -t nat -D POSTROUTING -s '192.168.0.0/24' -o enp1s0f0 -j MASQUERADE

The VM then uses the vmbr2 as network with this configuration
IP: 192.168.0.101
Subnet mask: 255.255.255.0
Default gateway: 192.168.0.254

The VM can ping 192.168.0.254 but with no internet connectivity.

We have also tried the same configuration that worked in Proxmox 4:

auto lo
iface lo inet loopback

iface enp1s0f0 inet manual

auto vmbr0
iface vmbr0 inet static
    address 51.15.185.203
    netmask 255.255.255.0
    gateway 51.15.185.1
    bridge_ports enp1s0f0
    bridge_stp off
    bridge_fd 0

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

Would really appreciate any help on this one :grinning:

//Stefan

#2

Solved it :slight_smile:

I finally tried to ping googles ip from the VM and that worked.
Turn ut I had used wrong DNS…

The above interfaces config should work.