Added support for Bridge mode networking. (#160)

* Added support for Bridge mode networking.

added config file option "bridge"
set to a correctly configured bridge device to enable qemu-bridge-helper

* Added Docs for Bridge network feature
This commit is contained in:
Adam Fairbrother 2021-10-27 14:07:14 -07:00 committed by GitHub
parent 255873c05a
commit 6e851ff1c8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 0 deletions

View File

@ -443,6 +443,13 @@ In the example above:
* Port 8123 on the host is forwarded to port 8123 on the guest.
* Port 8888 on the host is forwarded to port 80 on the guest.
# Bridged networking
Connect your virtual machine to a preconfigured network bridge.
Add an additional line to your virtual machine configuration
* `bridge="br0"`
# USB redirection
Quickemu supports USB redirection via SPICE pass-through and host pass-through.

View File

@ -815,6 +815,9 @@ function vm_boot() {
# See https://github.com/wimpysworld/quickemu/issues/115
if [ "${guest_os}" == "windows" ] && [ -n "${iso}" ]; then
args+=(-nic none)
elif [ -n "${bridge}" ]; then
# Enable bridge mode networking
args+=(-nic bridge,br=${bridge},model=virtio-net-pci)
else
# shellcheck disable=SC2054,SC2206
args+=(-device ${NET_DEVICE},netdev=nic -netdev ${NET},id=nic)
@ -965,6 +968,7 @@ function usage() {
# Lowercase variables are used in the VM config file only
boot="efi"
bridge=""
cpu_cores=""
disk_img=""
disk_size=""