Virtual Machine on OVH+PROXMOX6, not connect to internet.

marcosromero1946

New Member
Apr 28, 2020
3
0
1
78
Hi,

I’ve two dedicates servers in OVH (SRV1 and SRV2) each other with proxmox 6
I’ve activated a virtual rack (vRack OVH product) for build a LAN.
All the firewalls (dedicated servers, proxmox, virtual machines) are down (temporally).

Network configuration:
SRV1

ETH0
IP WAN SRV1: 50.50.50.12
GW SRV1: 50.50.50.254
ETH1
IP LAN SRV1: 172.16.0.1/12

SRV2
ETH0
IP WAN SRV2: 50.50.50.13
GW SRV2: 50.50.50.254
ETH1
IP LAN SRV2: 172.16.0.2/12

This is the SRV1 interfaces file:
auto lo
iface lo inet loopback

iface eth0 inet manual

iface eth1 inet manual

auto vmbr0
iface vmbr0 inet dhcp
bridge-ports eth0
bridge-stp off
bridge-fd 0

auto vmbr1
iface vmbr1 inet static
address 172.16.0.1/12
bridge-ports eth1
bridge-stp off
bridge-fd 0

post-up echo 1 > /proc/sys/net/ipv4/ip_forward
post-up iptables -t nat -A POSTROUTING -s 172.16.0.0/12 -o vmbr0 -j MASQUERADE
post-down iptables -t nat -D POSTROUTING -s 172.16.0.0/12 -o vmbr0 -j MASQUERADE

This is the SRV2 interfaces file:
auto lo
iface lo inet loopback

iface eth0 inet manual

iface eth1 inet manual

auto vmbr0
iface vmbr0 inet dhcp
bridge-ports eth0
bridge-stp off
bridge-fd 0

auto vmbr1
iface vmbr1 inet static
address 172.16.0.2/12
bridge-ports eth1
bridge-stp off
bridge-fd 0

post-up echo 1 > /proc/sys/net/ipv4/ip_forward
post-up iptables -t nat -A POSTROUTING -s 172.16.0.0/12 -o vmbr0 -j MASQUERADE
post-down iptables -t nat -D POSTROUTING -s 172.16.0.0/12 -o vmbr0 -j MASQUERADE

FILTER and NAT tables:

root@SRV2:/etc/network# iptables -t filter -S
-P INPUT ACCEPT
-P FORWARD ACCEPT
-P OUTPUT ACCEPT

root@SRV2:/etc/network# iptables -t nat -S
-P PREROUTING ACCEPT
-P INPUT ACCEPT
-P OUTPUT ACCEPT
-P POSTROUTING ACCEPT
-A POSTROUTING -s 172.16.0.0/12 -o vmbr0 -j MASQUERADE
-A POSTROUTING -s 172.16.0.0/12 -o vmbr0 -j MASQUERADE

I've installed a virtual machine (VM2) in SRV2 who has this configuration:
ETH0 (over vmbr1)
IP LAN 172.16.0.11
SUBNET MASK 255.254.0.0
GW 172.16.0.2

Ping testing:
From VM2 to 172.16.0.2 --> ok
From VM2 to 172.16.0.1 --> ok
From VM2 to 50.50.50.13 --> ok
From VM2 to 50.50.50.12 --> FAIL
From VM2 to www.google.com --> FAIL

Please, I need help with the configuration to connect the virtual machine to internet.
What’s the matter?
 
if google.com fail i think it can't resolve it to a IP
google.com = 216.58.215.238
it it possible to ping this ip?

Hi @vikozo

Thanks for your answer

No. The result is the same. The VM can't ping any external IP (like 216.58.215.238).
Probably there is an error in my configuration, but I'm not be able to find it!!

I don't know if the problem are the routing rules, the bridge config, ... I have read a lot of threads, manuals, etc, ... I'm confused

Thanks
 
Did you follow our wiki article? (e.g. use the OVH manager to create a virtual mac address for the address you want to assign)

https://pve.proxmox.com/wiki/OVH
 

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!