[Top][All Lists]

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

Re: Connection of a qemu guest to the 'net.

From: Berto Furth
Subject: Re: Connection of a qemu guest to the 'net.
Date: Tue, 16 Mar 2021 21:18:08 +1100
User-agent: Cyrus-JMAP/3.5.0-alpha0-206-g078a48fda5-fm-20210226.001-g078a48fd

Hi Peter,

I'm assuming you're also using dynamically created "tap" interfaces in your 
setup. That is, when QEMU starts it's creating a tap interface to funnel 
Ethernet traffic to and from the guest...so a command line something like

-netdev type=tap,id=testnet,script="./qemu-tap-up",downscript="./qemu-tap-down"

You can do routing, but you would still need to use a bridge interface for the 
dynamically created "tap" interface to connect to!! It's just that rather than 
setting up the bridge interface to do bridging between the tap and the "real" 
ethernet of the host, you'd set up the bridge interface to be a separate routed 
interface on your host.

Routing is a bit more difficult to setup than simple bridging because you have 
to first make sure your host is configured for routing (most aren't by default) 
and then you have to make sure your "real" networking infrastructure knows 
about the new QEMU guest subnet and how to route to it (via your host).

See the following URL for an example script to run when your QEMU tap interface 
is created that allows routing and you'll see how much extra effort it is to 
get routing (in this case with NAT) working compared to simple bridging.


If you just want QEMU to do simple NAT between the guest and the "real" network 
then just use "SLIRP" as per


(I haven't tested it...I always use tap and bridging)

Good luck!

On Tue, 16 Mar 2021, at 15:34, peter@easthope.ca wrote:
> Hi,
> Every mention of a network connection I've seen involves a bridge.  Is 
> a bridge necessary?  If so, why?  Why not route to the guest, analogous 
> to routing to a machine on a subnet connected by an Ethernet cable?
> Thx,                     ... Peter E.
> -- 
> cell: +1 236 464 1479            Bcc: peter at easthope. ca
> VoIP: +1 604 670 0140

reply via email to

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