VM network not working

wanna_b

New Member
Oct 7, 2017
1
0
1
44
Hello,

I have a new proxmox 5 installation on a dedicated server. The VM that I create cannot access any outside network.

My configuration on the host is as follows... vmbr0 has the public static IP info marked with the x's.

auto lo
iface lo inet loopback

iface enp5s0f0 inet manual

auto vmbr0
iface vmbr0 inet static
address x.x.x.x
netmask 255.255.255.0
gateway x.x.x.1
bridge_ports enp5s0f0
bridge_stp off
bridge_fd 0

auto vmbr1
iface vmbr1 inet static
address 10.10.10.1
netmask 255.255.255.0
bridge_ports none
bridge_stp off
bridge_fd 0

post-up echo > /proc/sys/net/ipv4/ip_forward
post-up iptables -t nat -A POSTROUTING -s '10.10.10.0/24' -o vmbr0 -j MASQUERADE
post-down iptables -t nat -D POSTROUTING -s '10.10.10.0/24' -o vmbr0 -j MASQUERADE


When I create the VM I choose vmbr1 and give the following IP information when installing the OS (Debian 9 netinst)....

IP: 10.10.10.5
Gateway: 10.10.10.1
Netmask: 255.255.255.0


I am unable to ping anything, especially 8.8.8.8, from the VM. I have no idea what's wrong. I have been working on this for hours. I hope someone can help.
 
Hi guys

Same issue for me after upgrading to Proxmox 5, NAT/container internet access is not working.

Is debian 9 networking rules are different ?

pveversion
pve-manager/5.0-32/2560e073 (running kernel: 4.10.17-4-pve)
 
Last edited:
I found these explanations:
https://forum.proxmox.com/threads/lxc-cant-access-internet-with-network-firewall-enabled.35973/

Where it require to add
iptables -t raw -I PREROUTING -i fwbr+ -j CT --zone 1

But that the same result for me, container cannot ping internet ip.

Here my NAT startup config files:
Code:
iptables -t filter -F
iptables -t filter -X

echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -o vmbr0 -s 10.0.1.0/24 -j MASQUERADE

iptables -t raw -A PREROUTING  -i fwbr+ -j CT --zone 1

#container1
iptables -t nat -A PREROUTING -p tcp -d 195.154.x.x--dport 5432 -i vmbr0 -j DNAT --to-destination 10.0.1.100:5432
 
Ok found it, maybe it can help other:

I'm using a init.d script file that work until proxmox 5
iptables -t nat -A POSTROUTING -o vmbr0 -s 10.0.1.0/24 -j MASQUERADE

10.0.1.0/24 have to be between quote:
iptables -t nat -A POSTROUTING -o vmbr0 -s '10.0.1.0/24' -j MASQUERADE

Et voila
 
  • Like
Reactions: Cezar
@guik - you just saved my life! I have been looking for a solution to allow internet access for my VM for almost 2 weeks! Other forum members are not so willing to help newbies and give rather evasive answers...
Thank you so much!
 

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!