You are not logged in.

#1 2011-06-28 20:29:16

troutwine
Member
From: Berkeley, CA
Registered: 2011-06-12
Posts: 12
Website

Permanent, stable networking for kvm machines with vde

I have an /etc/rc.local that looks like this:

#!/bin/bash
#
# /etc/rc.local: Local multi-user startup script.
#
/sbin/ip addr add 10.0.2.1/24 dev tap0
/sbin/ip link set dev tap0 up
vde_switch -tap tap0 -mod 660 -group kvm -daemon

sysctl -w net.ipv4.ip_forward=1

after booting vde_switch has been started, but tap0 does not exist. I have to run the first two commands manually. My /etc/iptables/iptables.rules look like so:

# Generated by iptables-save v1.4.10 on Thu Dec 23 17:11:27 2010
*filter
:INPUT ACCEPT [2355:1598474]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [2691:809720]
COMMIT
# Completed on Thu Dec 23 17:11:27 2010
# Generated by iptables-save v1.4.10 on Thu Dec 23 17:11:27 2010
*nat
:PREROUTING ACCEPT [0:0]
:INPUT ACCEPT [0:0]
-A POSTROUTING -s 10.0.2.0/24 -o eth0 -j MASQUERADE
-A POSTROUTING -s 10.0.2.0/24 -o wlan0 -j MASQUERADE
:OUTPUT ACCEPT [19:1520]
:POSTROUTING ACCEPT [19:1520]
:OUTPUT ACCEPT [0:0]
COMMIT
# Completed on Thu Dec 23 17:11:27 2010

I start a vm like this:

qemu-kvm -m 1024 -drive file=virtual_machines/codd.debian,if=virtio -boot c -netdev type=vde,id=tiny  -device virtio-net-pci,netdev=tiny

Starts up, ssh from the host machine to the vm no problem. I find ~40% of the the TCP connections I make fail to finalize their first handshake; once connected they're stable. I find today that none of my vm machines can access the outside internet. My configuration has not changed but I did reboot recently into a new kernel:  2.6.39-ARCH

Question rundown:

  • How do really bring tap0 up at boot time; rc.local isn't cutting it.

  • How do I repair the high TCP handshake failure rate?

  • For what reason might my virtual ethernet work but each VM be unable to access the outside internet and how might I correct this?

Last edited by troutwine (2011-06-28 20:30:27)

Offline

Board footer

Powered by FluxBB