qemu-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-discuss] How to use tap for qemu guest network?


From: Aleksei
Subject: Re: [Qemu-discuss] How to use tap for qemu guest network?
Date: Fri, 16 Dec 2016 11:15:10 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1

On the host:

Add "allow bridge0" line to /etc/qemu/bridge.conf.

Assign an IP to bridge and bring it up. I do it with NetworkManager, so I'm not sure which "ip x x" commands are needed, but the result looks like this (with VM not running):

$ ip a l bridgevm
5: bridgevm: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default qlen 1000
    link/ether ee:39:4b:c9:ba:ed brd ff:ff:ff:ff:ff:ff
    inet 192.168.122.1/24 brd 192.168.122.255 scope global bridgevm
       valid_lft forever preferred_lft forever
    inet6 fe80::ec39:4bff:fec9:baed/64 scope link
       valid_lft forever preferred_lft forever

On the guest, OS must be able to work with virtio NIC and you'll have to assign static IP to it.

I struggled with host-only bridged network for Qemu/libvirt myself a little while ago and described my solution here, you may want to take a look: https://alekseikovura.blogspot.ru/2016/09/libvirt-and-networkmanagers-bridges.html


--Regards, Aleksei



From: Shiyao Ma
Sent: Friday, December 16, 2016 7:49AM
To: Aleksei
Cc: Qemu-discuss
Subject: Re: [Qemu-discuss] How to use tap for qemu guest network?
Hi Aleksei,

I did the following, 

sudo ip link add dev bridge0 type bridge

sudo ip link set bridge0 up

# after the above commands, when doing a `ip link show', the bridge0 is in state UNKNOWN.



I then run, 
sudo kvm -m 256 eva.qcow2 -curses -vga virtio -device virtio-net,netdev=internet -netdev bridge,br=bridge0,id=internet,helper=/usr/lib/qemu/qemu-bridge-helper

After login into the sytem, I run:
ip link show
I got:
                                address@hidden:/home/introom# ip addr
                                                                1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group defaul
                                                                t
                                                                    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
                                                                    inet 127.0.0.1/8 scope host lo
                                                                       valid_lft forever preferred_lft forever
                                                                    inet6 ::1/128 scope host
                                                                       valid_lft forever preferred_lft forever
                                                                2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP gr
                                                                oup default qlen 1000
                                                                    link/ether 52:54:00:12:34:56 brd ff:ff:ff:ff:ff:ff
                                                                    inet 10.0.2.15/24 brd 10.0.2.255 scope global eth0
                                                                       valid_lft forever preferred_lft forever
                                                                    inet6 fec0::5054:ff:fe12:3456/64 scope site mngtmpaddr dynamic
                                                                       valid_lft 86343sec preferred_lft 14343sec
                                                                    inet6 fe80::5054:ff:fe12:3456/64 scope link
                                                                       valid_lft forever preferred_lft forever



The above is all I got.

What additional step should I do?
For example, to achieve the goal as,  ping between the guest and the host.

Thanks.




On Thu, Dec 15, 2016 at 9:10 PM, Aleksei <address@hidden> wrote:

This works for me (you have to set up the bridge "bridge0" on the host side):

-device virtio-net,netdev=internet \
-netdev bridge,br=bridge0,id=internet,helper=/usr/lib/qemu/qemu-bridge-helper


--Regards, Aleksei



From: Shiyao Ma
Sent: Thursday, December 15, 2016 3:34PM
To: Qemu-discuss
Subject: [Qemu-discuss] How to use tap for qemu guest network?
Hi,

I'd like to use a tap for the network between the host and the guest.

There are some materials on the internet, but none working for me.

Anybody successful setting up the tap based network?

What commands/setup do you use?

Thanks.






--

吾輩は猫である。ホームーページはhttps://introo.me


reply via email to

[Prev in Thread] Current Thread [Next in Thread]