network configuration

sunghost

Active Member
May 27, 2011
168
1
38
[solved] network configuration

Hello,
i dont understand the network default configuration for the host and vm. i configure the host lan like it is descripted in the wiki, but i cant connect to the host.
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet manual

auto vmbr0
iface vmbr0 inet statitc
address 10.100.20.86
netmask 255.255.255.0
gateway 10.100.20.1
bridge_ports none
bridge_stp off
bridge_fd 0
if i use dhcp for eth0, i can connect to the host, but the client (win7) gets no ip adress via bridge from the dhcp. if i configure a static ip for both eth0 and vmbr0 i cant connect.
 
Last edited:
after configure the network vmbr0 over the gui it looks like this
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp

auto vmbr0
iface vmbr0 inet static
address 10.100.20.86
netmask 255.255.255.0
gateway 10.100.20.1
bridge_ports none
bridge_stp off
bridge_fd 0
now i can connect via ssh to the host, but my vm win7 gets now ip from the dhcp. what is wrong? i installed the virtio network red hat driver.
 
I dont know how to configure this. My settings for the vm are: bridge mode with vmbr0 and virtio for the network card. at my hostsystem i configure the vmbr0 with static ip and let the eth0 unchanged with no entries.
 
Hi ,
i dont mean to point out the obvious but you dont have any intefaces attached to the bridge

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet manual

auto vmbr0
iface vmbr0 inet statitc
address 10.100.20.86
netmask 255.255.255.0
gateway 10.100.20.1
bridge_ports eth0 # this attaches the Inteface/s to the bridge
bridge_stp off
bridge_fd 0



hope this helps

D
 
sunghost;

In order for your Win7 machine to talk to the world it needs to pass through the PVE machine. For this to happen, the most common setup is to have your eth0 bridged with the virtio interface (the bridge acts as a layer-2 switch) which makes the virtio appear to be plugged into your eth0 (kind of). In order for this to happen, your /etc/network/interfaces must have the "bridge_ports none" line changed to "bridge_ports eth0", or if you want to go for a more elaborate setup you must set up routing on your PVE box. It's up to you, but the way you have it set up right now the Win7 box can talk to the PVE box but not to the outside world.

Hope this helps.
JoelC
 
What worked for me is the following.

auto lo
iface lo inet loopback


auto eth0
iface eth0 inet static
address #HOSTIP
netmask 255.255.255.255
gateway #GATEWAY
broadcast #BROADCAST
pointopoint #GATEWAY


auto vmbr0
iface vmbr0 inet static
address #HOSTIP
netmask 255.255.255.255
broadcast #BROADCAST
bridge_ports none
bridge_stp off
bridge_fd 0


up ip route add #VMIP/32 dev vmbr0
 
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet manual

auto vmbr0
iface vmbr0 inet statitc
address 10.100.20.86
netmask 255.255.255.0
gateway 10.100.20.1
bridge_ports none
bridge_stp off
bridge_fd 0

For this configuration, your vmbr0 is not connected to any real network interface, so virtual machines cannot see the outside world. By adding eth0 to bridge ports, you will allow the bridge to talk to the outside world directly.

If you setup bridge_ports eth0 in the example above (pretty sure this is default) then you can connect to the hypervisor on the address for vmbr0, you don't give eth0 an IP address, it is simply virtually connected up to your internal virtual networking. This saves your machine from having to do routing.

This means that your initial vmbr0 can be thought of like a switch with extra ports on the switch your computer is connected to, so any IPs you give will be in the same subnet and using the same gateway. Your switch will effectively think it has another switch connected to it.

If you want to have your VMs on a different network to your other machines, you may be able to route (if you can set the rest of the network up to allow it) or you may have to NAT (which will work the same way as NAT behind a linux router at home)

It sounds as though you are trying to have a DHCP server assign an IP on the same range to your VMs, so this will work fine, if you just plumb your eth0 back into the vmbr0 as a bridge port: think of it as the uplink port on your internal switch.

With only one network interface, things are pretty straight forward. It gets more hairy with multiple interfaces.
 
Many thx for your answers.
Thats it:
bridge_ports eth0
And iam sure its not default. In pve 1.9 i enabled it in the network settings an it seems that i overloocked it in 2.0. Sorry my fault. Now all is fine. I used static IP for the host and dynamic by dhcp for the vm. thx
 

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!