NetBSD-Users archive

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

Re: Internet access to qemu guest via bridge0



On Mon, 22 Jun 2020 at 19:30, Mayuresh <mayuresh%acm.org@localhost> wrote:
>
> On Mon, Jun 22, 2020 at 07:09:51PM +0100, Ottavio Caruso wrote:
> > Do you get Internet access if you just use "-nic user"?
>
> Yes. So I enabled both and kind of managed to get internet as well as host
> access. But I wish just bridge could do both.
>
> > Mind you, you cannot ping or traceroute out if you use standard user
> > mode.
>
> Yes, I'm aware. Watching apt commands on the host unable to resolve
> address (if I have only bridge).
>
> Mayuresh

The referred setup in the original message seems strange to me. I run
a number of qemu-nvmm guests under NetBSD-current, they all have
perfect Internet access through the bridge. The setup is as follows:

The physical host interface is set (/etc/ifconfig.wm0):

inet 192.168.0.29 netmask 255.255.255.0 up description "My LAN"

The bridge and the tap devices are established (/etc/ifconfig.bridge0):

create
!ifconfig tap0 create up description "LxMint"
!ifconfig tap1 create up description "MXLinux"
!ifconfig tap2 create up description "FreeBSD12"
!ifconfig tap3 create up description "NBSDc"
!ifconfig tap4 create up description "OpenBSD"
!ifconfig tap5 create up description "Windows10"
!brconfig $int add wm0
!brconfig $int add tap0
!brconfig $int add tap1
!brconfig $int add tap2
!brconfig $int add tap3
!brconfig $int add tap4
!brconfig $int add tap5
up

The qemu commands to start the guests include:

...
-net tap,fd=6 6<>/dev/tap5 -net nic

(make sure the dev/tap? devices are not duplicated between different
guests running at the same time, of course).

I haven't tried, but I believe that if I were to use a wireless
interface instead of the wired wm0 this would not work (this certainly
was the case when I was using Xen and the same host was the DOM0).

Chavdar

-- 
----


Home | Main Index | Thread Index | Old Index