[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-discuss] Guest to Guest networking
From: |
Donald R Laster Jr |
Subject: |
Re: [Qemu-discuss] Guest to Guest networking |
Date: |
Sat, 28 Apr 2018 19:45:45 -0400 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0 SeaMonkey/2.49.1 |
Lars,
I am using an older version of QEMU and all of the VMs can talk to each
other. I set up the networking based upon this:
#=============================================================================#
# Ethernet Devices (Both lines are required for the interface) #
# #
# Basic format : -net nic,vlan=<n>,macaddr=<maddr>,model=<name> #
# -net tap,valn=<n>,ifname=<tapname> #
# #
# <n> : A number from 0 to say around 9 for the virtual LAN. #
# <maddr> : The MAC Address to use. Use VMWare's base of 52:54:00:xx:yy:zz #
# <name> : The device model name. Values are virtio, i82551, i82557b, #
# i82559er, ne2k_pci, ne2k_isa, pcnet, rtl8139, e1000, smc91c111, #
# lance, mcf_fec. The default is the e1000. #
# <tapname> : The name of the Bridge tap device. Typically tap0, tap1, etc. #
# #
# The recomended Ethernet MAC Address is the following: #
# #
# 52:54:00:xx:yy:zz : Where xx:yy:zz are the hexadecimal equivalent of the #
# last three octets of the IPv4 Network Address. #
# #
# IPv4 Address = 172.16.1.2 ==> MAC Address = 52:54:00:10:01:02 #
# #
# For the default helper script to be able to work properly the following #
# needs to be done first: #
# #
# chmod u+s /usr/libexec/qemu-bridge-helper #
# #
# Then insert the line "allow br0" (where br0 is the bridge device name) into #
# the file /etc/qemu/bridge.conf. #
# #
# Use the network script file to configure it and the network script dfile to #
# deconfigure it. If name is not provided, the OS automatically provides one. #
# The default network configure script is /etc/qemu-ifup and the default #
# network deconfigure script is /etc/qemu-ifdown. Use script=no or #
# downscript=no to disable script execution. #
# #
# Values for BRHELP are /usr/libexec/qemu-bridge-helper or /etc/qemu-brhelp #
# TAPBUP are /etc/qemu-ifup or the word no #
# TAPBDN are /etc/qemu-ifdown or the word no #
# Values for ETHDEV are virtio, i82551, i82557b, i82559er, ne2k_pci, #
# ne2k_isa, pcnet, rtl8139, e1000, smc91c111, lance #
# and mcf_fec. Default value is e1000. #
# #
# -net nic[,vlan=n][,macaddr=mac][,model=type] [,name=name][,addr=addr] #
# [,vectors=v] #
# -net tap[,vlan=n][,name=name][,fd=h][,ifname=name][,script=file] #
# [,downscript=dfile][,helper=helper] #
# #
#=============================================================================#
Depending upon the version you are running you might need to adjust the
options. These are how the NIC are defined from the command line. One of the
VMs has these two NIC defined:
-net nic,macaddr=52:54:00:10:01:2E,vlan=0,model=e1000 -net
tap,vlan=0,helper=/usr/libexec/qemu-bridge-helper
-net nic,macaddr=52:54:00:10:01:23,vlan=0,model=e1000 -net
tap,vlan=0,helper=/usr/libexec/qemu-bridge-helper
and other other one has this NIC defined:
-net nic,macaddr=52:54:00:10:01:1F,vlan=0,model=e1000 -net
tap,vlan=0,helper=/usr/libexec/qemu-bridge-helper
The VMs are running on the same physical machine which is running Slackware
14.0. I have another system that runs more VMs and all of the VMs can talk to
each other. Make sure that when you check the configuration insure the
physical Ethernet interface is bridging properly with the with the tap devices.
This can be checked with the brctl command:
brctl show
bridge name bridge id STP enabled interfaces
br0 8000.206a8a44186c yes eth0
tap0
tap1
tap2
Make sure the qemu-bridge-helper has the correct privileges as well:
ls -l /usr/libexec/qemu-bridge-helper
-rwsr-sr-x 1 root root 14192 Apr 28 2013 /usr/libexec/qemu-bridge-helper
It may make a difference. The two attached file are what I created when I set
the stuff up initial in 2012. There is a partial site reference where I found
useful information in the script documentation.
Hopefully, this helps.
Don
Lars Noodén wrote on 04/27/2018 08:33 AM:
> I'd like to run several qemu guest such that they can all communicate between
> each other. The pages I find, such as the Qemu Networking page [1], are all
> rather abstract. Where can I find out how to ping or SSH between qemu guests?
>
> /Lars
>
> [1] https://wiki.qemu.org/Documentation/Networking
>
rc.bridge_tuntap
Description: Text document
S10bridge_tuntap
Description: Text document