Debian KVM host and guests interfaces configuration

interfacekvm-virtualizationnetworking

I've got dedicated Debian server with Proxmox as KVM manager and such IP example network:

IP address  175.19.59.209
Netmask     255.255.255.224
Gateway     175.19.59.193

Now I'm trying to configure subnets with such topology:

\\\\\\\\\\\\\\\\\\\\\\\\\
\\Gateway 175.19.59.193\\
\\\\\\\\\\\\\\\\\\\\\\\\\
 \
  +----------+
  | KVM-host |
  | eth0     |
  | vmbr0    |
  | vmbr1    |
  +----------+
    |
    |  +------+    +------+       +------+
    +--| vm01 |----| vm02 |--/ /--| vm09 |
       +------+    +------+       +------+

That's how my host machine interface is configurated now:

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet manual

auto vmbr0
iface vmbr0 inet static
    address  175.19.59.209
    netmask  255.255.255.224
    gateway  175.19.59.193
    bridge_ports eth0
    bridge_stp off
    bridge_fd 0

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

And this is guest machine vm01 configuration:

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
    address 10.10.11.12
    netmask 255.255.255.0
    gateway 10.10.11.1

The problem is that I can't ping vmXX out of host vice versa. Also I have no idea how to route vm01:80 to the Internet and back to make vm01 reverse proxy for 10.10.11.0/24 network.

What have I missed? Any advice for the networking "newby"?

Best Answer

1) Ensure vmbr1 contains the tap devices for each VM:

brctl add vmbr1 tapX

2) Ensure iptables on the host allows bridge traffic:

iptables -I FORWARD -m physdev --physdev-is-bridged -j ACCEPT

3) Ensure you allow NAT via vmbr0:

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