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

Re: Network connection of a qemu guest.



	Hi.

On Thu, Mar 11, 2021 at 02:19:28PM -0800, peter@easthope.ca wrote:
> There's no mention of shutting off the built-in DHCP server.

That's because there's no need to.
Unless guess OS requests a DHCP less, a DHCP server will remain dormant.

> Maybe a specific ip address shuts it off. 

No, it does not work that way.

> > If you don't like guest OS to be configured by DHCP, you're welcome to
> > use /e/n/i snippet that I referenced in my previous e-mail.
> 
> I added this stanza to /e/n/i .
> 
> # An interface for subnet to qemu guest.
> auto qemunic

It should not work this way, and it did not.

You're supposed to use the interface name your guest OS sees (as in -
"ifconfig", "ip a"), not QEMU label ("qemunic" in this case). 

> The qemu -nic option above has "id=qemunic" and the stanza above 
> has qemunic.

An "id" option has nothing to do with guest OS interface name. It's
merely a label to distinguish between several instances of virtual
hardware of the same type.
For instance, one can specify several NICs for the quest this way:

qemu-system-x86_64 -name ... \
-netdev tap,id=hostnet0,fd=3 -device \
	virtio-net-pci,netdev=hostnet0,id=net0,mac=$MAC0 \
-netdev tap,id=hostnet1,fd=4 -device \
	virtio-net-pci,netdev=hostnet1,id=net1,mac=$MAC1 \
-netdev tap,id=hostnet2,fd=5 -device \
	virtio-net-pci,netdev=hostnet2,id=net2,mac=$MAC2 \
-netdev tap,id=hostnet3,fd=6 \
	-device virtio-net-pci,netdev=hostnet3,id=net3,mac=$MAC3 \

And it does not make guest OS network interfaces to be called hostnet0
or net0, for instance.

Reco


Reply to: