KVM - The Linux Kernel-Based Virtual Machine
News, Blogs and Resources on the Linux (KVM) Kernel-Based Virtual Machine

Switched networking (VDE)

7 replies [Last post]
greno
User offline. Last seen 1 year 43 weeks ago. Offline
Joined: May 11 2008
Points: 0

Need examples of using VDE with KVM guests to bridge guests on to LAN. What I want to do is have like VMware in that I want to start the VDE switch at host bootup. This should then make tap0 VLAN0 available to guests. Then when the guests start up they should be able to have either static/dhcp address on LAN. So right now I have VDE2 running. But how can I have the VMM gui start a guest and have the guest use the switch on tap0? Do I need to change the .xml files for the guests? Some examples would be helpful for those of us somewhat new to virtual networking.

Regards,
Gerry

Also, maybe there should be a category in the forum dedicated to the virtual networking.

Haydn Solomon
User offline. Last seen 1 day 15 hours ago. Offline
Joined: Mar 7 2008
Points: 204
Hi Gerry, I did seriously

Hi Gerry,

I did seriously consider adding a category for networking in the forum as there have been quite a lot of feedback with respect to KVM networking. I thought that it might be ok to fall under a more general category but your request for this tips the scale for me.

VDE switching was also on my list of topics to start writing about but I would also welcome community participation.

Haydn

greno
User offline. Last seen 1 year 43 weeks ago. Offline
Joined: May 11 2008
Points: 0
I would like to use the VMM

I would like to use the VMM gui to manage the guests. But I also need the gui to support changing the networking options. Or does this have to be done by undefining guest and changing .xml then redefining guest??? Still a little confusing as to how you do all these types of things.

Regards,
Gerry

greno
User offline. Last seen 1 year 43 weeks ago. Offline
Joined: May 11 2008
Points: 0
Struggling to get KVM and VDE

Struggling to get KVM and VDE working together. I spent about eight hours on this with no success. I am able to get the libvirt bridge (virbr0) to work but I cannot figure out how to get the VDE2 tap0 interface working. Here are things that I have tried:

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

# my LAN is 192.168.1.0

tunctl
ifconfig tap0 192.168.1.254 netmask 255.255.255.0
vde_switch -tap tap0 (in another terminal)
vdekvm -hda TEST1.img -m 512

ifcfg-eth0 (guest):
BOOTPROTO=static
IPADDR=192.168.1.89
NETMASK=255.255.255.0
GATEWAY=192.168.1.254

In guest, I cannot ping anything on LAN, not even the gateway.

Here is ifconfig (host):
eth0 Link encap:Ethernet HWaddr 00:1A:4D:5E:F6:36
inet addr:192.168.1.15 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::21a:4dff:fe5e:f636/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:74482 errors:0 dropped:0 overruns:0 frame:0
TX packets:23208 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:55338133 (52.7 MiB) TX bytes:2089252 (1.9 MiB)
Interrupt:19 Base address:0x4000

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:61305 errors:0 dropped:0 overruns:0 frame:0
TX packets:61305 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:99360931 (94.7 MiB) TX bytes:99360931 (94.7 MiB)

tap0 Link encap:Ethernet HWaddr 00:FF:19:44:D3:13
inet addr:192.168.1.254 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::2ff:19ff:fe44:d313/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:2 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:23 overruns:0 carrier:0
collisions:0 txqueuelen:500
RX bytes:106 (106.0 b) TX bytes:0 (0.0 b)

virbr0 Link encap:Ethernet HWaddr 00:00:00:00:00:00
inet addr:192.168.122.1 Bcast:192.168.122.255 Mask:255.255.255.0
inet6 addr: fe80::c4ee:d7ff:fe1d:6b15/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:4534 errors:0 dropped:0 overruns:0 frame:0
TX packets:7831 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:258603 (252.5 KiB) TX bytes:11633607 (11.0 MiB)

If possible does someone have a working config for KVM w/VDE that I could examine?

Regards,
Gerry

greno
User offline. Last seen 1 year 43 weeks ago. Offline
Joined: May 11 2008
Points: 0
I am seeing this in the

I am seeing this in the terminal where I'm running vde_switch:

# vde_switch -tap tap0
vde_switch: MAC 00:ff:c7:0c:f3:a1 moved from port 1 to port 2
vde_switch: MAC 00:ff:c7:0c:f3:a1 moved from port 1 to port 2
vde_switch: MAC 00:ff:c7:0c:f3:a1 moved from port 1 to port 2
vde_switch: MAC 00:ff:c7:0c:f3:a1 moved from port 1 to port 2
vde_switch: MAC 00:ff:c7:0c:f3:a1 moved from port 1 to port 2
vde_switch: MAC 00:ff:c7:0c:f3:a1 moved from port 1 to port 2

This is the MAC address for tap0 that it is moving. What does this mean?

Regards,
Gerry

Anonymous
does this fix the problem?

> Here is ifconfig (host):
> eth0 Link encap:Ethernet HWaddr 00:1A:4D:5E:F6:36
> inet addr:192.168.1.15 Bcast:192.168.1.255 Mask:255.255.255.0
....
> tap0 Link encap:Ethernet HWaddr 00:FF:19:44:D3:13
> inet addr:192.168.1.254 Bcast:192.168.1.255 Mask:255.255.255.0

It seems that eth0 and tap0 are on the same network on the host.
Please try to change the subnet used on the VDE (tap0 and eth0 on guest).

renzo

Anonymous
VDE and KVM HowTo

I've been successfully using VDE as the network connection for VMs for a long time now and as part of some additions to the management side I thought I should document how VDE is configured and used before I forget the nuances.

I've written it up in my Wiki, in the article "Virtual Machines With VDE Networking"

I hope it helps - I remember how much brain-ache it caused me initially because all I could find was documentation fragments, clues, and lots of misleading generalisations.

IntuitiveNipple
User offline. Last seen 1 year 31 weeks ago. Offline
Joined: Aug 2 2008
Points: 0
Twas me!

I've registered an account here after posting the previous comment about my Wiki tutorial, so if you have questions you know where to find me.

Post new comment

The content of this field is kept private and will not be shown publicly.