Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Bridge Networking VM
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
risq
Tux's lil' helper
Tux's lil' helper


Joined: 03 Dec 2004
Posts: 75

PostPosted: Sun May 17, 2015 10:22 am    Post subject: Bridge Networking VM Reply with quote

Hi gentoo-people,

i once figured out howto setup qemu bridge networking, but im lost now.

My current setup is this

Code:
s1 ~ # ifconfig
br0: flags=4419<UP,BROADCAST,RUNNING,PROMISC,MULTICAST>  mtu 1500
        inet 10.0.0.10  netmask 255.255.0.0  broadcast 10.0.0.255
        inet6 fe80::200:ff:fe00:1  prefixlen 64  scopeid 0x20<link>
        ether 00:00:00:00:00:01  txqueuelen 0  (Ethernet)
        RX packets 864323  bytes 3091316402 (2.8 GiB)
        RX errors 0  dropped 12  overruns 0  frame 0
        TX packets 429060  bytes 122861116 (117.1 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

enp0s25: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet6 fe80::be5f:f4ff:fefb:d5a5  prefixlen 64  scopeid 0x20<link>
        ether bc:5f:f4:fb:d5:a5  txqueuelen 1000  (Ethernet)
        RX packets 2488202  bytes 3195913307 (2.9 GiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 571631  bytes 138547949 (132.1 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 20  memory 0xf0400000-f0420000

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 0  (Local Loopback)
        RX packets 1514  bytes 277957 (271.4 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 1514  bytes 277957 (271.4 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

tap0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        ether 00:00:00:00:00:01  txqueuelen 500  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

tap1: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        ether 00:00:00:00:00:02  txqueuelen 500  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0


with

Code:
s1 ~ # vi /etc/conf.d/net
# This blank configuration will automatically use DHCP for any net.*
# scripts in /etc/init.d.  To create a more complete configuration,
# please review /usr/share/doc/openrc*/net.example* and save your configuration
# in /etc/conf.d/net (this file :]!).
brctl_br0="setfd 0 sethello 0 stp off"
rc_net_br0_need="net.tap0 net.tap1 net.tap2 net.tap3"
bridge_br0="enp0s25 tap0 tap1 tap2 tap3"
# To add ports to bridge br0
# Finally give the bridge an address - dhcp or a static IP
config_br0=("10.0.0.10 netmask 255.255.0.0 brd 10.0.0.255")
routes_br0=("default via 10.0.0.1")
dns_servers_br0=("10.0.0.1")

config_tap0="null"
tuntap_tap0="tap"
tunctl_tap0="-u risq"
mac_tap0="00:00:00:00:00:01"

config_tap1="null"
tuntap_tap1="tap"
tunctl_tap1="-u risq"
mac_tap1="00:00:00:00:00:02"


i can now start a virtual machine by

Code:
qemu-system-x86_64 -enable-kvm -cpu host -drive file=/virt/v1.img,if=virtio -net nic -net bridge,br=br0  -m 1G -name v1


it will get a DHCP adress in my network (10.0.0.23), everythings fie.

question is how i can run other VMs, if i use -net bridge,br=br0 they will get the same 10.0.0.23 adress...

any help appreciated, thx in advance!
Back to top
View user's profile Send private message
nativemad
Developer
Developer


Joined: 30 Aug 2004
Posts: 918
Location: Switzerland

PostPosted: Tue Jun 02, 2015 6:54 pm    Post subject: Reply with quote

Hi,

you should use the bridged tap devices in the qemu command and not the bridge device itself! :wink:

HTH, Cheers
_________________
Power to the people!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum