Network configuration for VM

Okoolarnik

New Member
May 4, 2017
8
0
1
45
Hello,

I have a Proxmox 4.4 Node with three LXCs configured for OVH Vrack, but not connected to any cluster yet, since it's only node. One IP block is attached to the server.

LXCs run fine. I decided to try a VM. I downloaded couple of Debian minimal iso images and created a VM using debian 7 for start (tried 8 and 9 as well). After I create VM and install Debian, I can't "see outside world" (I mean id doesn't even ping host's IP). Only thing I can ping from VM's console are 3 IP adresses that are being used by working LXCs.

I have been searching through internet (also here), but either I couldn't find or missed tips on that matter.

Can anyone tell me exactly, step by step how to configure networking so that VM (VMs) could be visible in internet and so they could see internet?
 
Last edited:
Hello,

Can you show us the network configuration of the KVM VM?
Remember that you have to add post up routed manually since the gateway is not inside the subnet.
 
In Proxmox panel I have set "vmbr0" for "Bridge", "VirtIO" for model and I have entered OVH Virtual MAC Adress.

Here's /etc/network/interfaces for VM:

Code:
# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
allow-hotplug eth0
iface eth inet static
        address 91.122.255.4
        netmask 255.255.255.240
        network 91.122.255.0
        broadcast 91.122.255.15
        gateway 147.136.137.254
        dns-nameservers 8.8.8.8 8.8.4.4
# --- BEGIN PVE ---
        post-up ip route add 147.136.137.254 dev eth0
        post-up ip route add default via 147.136.137.254 dev eth0
        pre-down ip route del default via 147.136.137.254 dev eth0
        pre-down ip route del 147.136.137.254 dev eth0
# --- END PVE ---

Here's /etc/hosts for VM:

Code:
127.0.0.1       localhost
91.122.255.4 my.hostname.tld my

::1             localhost ip6-localhost ip6-loopback
ff02::1         ip6-allnodes
ff02::2         ip6-allrouters
 
I have just removed gateway definition and restarted. Now on VM when I ping anything else than IPs mentioned earlier and gateway's IP I get:

Code:
connect: Network is unreachable
 
Your default gateway must be in the same network space as
91.122.255.4 or 147.136.137.254. Use traceroute to see where is the problem not ping.
 
I'm sorry, it is wrong only here, I couldn't copy from proxmox console so I retyped it here. On the server it's exactly as You wrote.

Still no matter what I try, in most cases I can not even ping the gateway (phisical node's IP but with 254 at the end).

I started to think if my node's /etc/network/interfaces is right (still it works well for LXC). Here it is:

Code:
# The loopback network interface
auto lo
iface lo inet loopback

# vmbr0: Bridging. Make sure to use only MAC adresses that were assigned to you.
auto vmbr0
iface vmbr0 inet static
        address 147.136.137.107
        netmask 255.255.255.0
        network 147.136.137.0
        broadcast 147.136.137.255
        gateway 147.136.137.254
        bridge_ports eth0
        bridge_stp off
        bridge_fd 0

iface vmbr0 inet6 static
        address 2001:xxxx:xxxx:xxxx::
        netmask 64
        post-up /sbin/ip -f inet6 route add 2001:xxxx:xxxx:xxxx:ff:ff:ff:ff dev vmbr0
        post-up /sbin/ip -f inet6 route add default via 2001:xxxx:xxxx:xxxx:ff:ff:ff:ff
        pre-down /sbin/ip -f inet6 route del default via 2001:xxxx:xxxx:xxxx:ff:ff:ff:ff
        pre-down /sbin/ip -f inet6 route del 2001:xxxx:xxxx:xxxx:ff:ff:ff:ff dev vmbr0

# Bridge to Ovh Vrack
auto vmbr2
iface vmbr2 inet static
    address  172.16.0.1
    netmask  255.240.0.0
    network 172.31.255.255
    bridge_ports eth1
    bridge_stp off
    bridge_fd 0
    post-up /sbin/ip addr add 172.16.0.100/12 dev vmbr2
    post-down /sbin/ip addr del 172.16.0.100/12 dev vmbr2

auto vmbr1
iface vmbr1 inet manual
        post-up /etc/pve/kvm-networking.sh
        bridge_ports dummy0
        bridge_stp off
        bridge_fd 0
 
Sorry to possibly be necroposting, but I have this exact problem. I run my host off a SoYouStart Dedicated server, and have two extra failover ips with virtual macs. I started up an lxc with the details of one, and it's fine, but the VM does not connect to the internet.
 
Same problem here.
The big problem is that this is on my second node. The other with proxmox 4 works well, the one with proxmox 5 can connect vm to internet.
I'm using brigde network.
 
In this thread not yet stated if proxmox host and the proxmox guest use the same physical network interface card port.

Let's say they are on the physical NIC port.
What allows the corresponding switch port? Is it happy with seeing more that 1 MAC address from the NIC??

See also https..//en.wikipedia.org/wiki/MAC_filtering#Port_security
 
My problem was solved after calling my provider OVH, they need a specific mac address for every public address, and I need to generate then on their management UI. A silly step that take me almost a day to figure out. It's called the RTFM :-|
 

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!