Skip to content

Adds support for bridged networking.#1

Open
brenns10 wants to merge 1 commit intog2p:masterfrom
brenns10:master
Open

Adds support for bridged networking.#1
brenns10 wants to merge 1 commit intog2p:masterfrom
brenns10:master

Conversation

@brenns10
Copy link
Copy Markdown

This PR adds the ability to create multiple guest interfaces using a bridge interface on the host. Basically, on the host, you do something like this:

# First create a bridge.
$ sudo brctl addbr bridge0
# Then connect it to the host's ethernet interface.
$ sudo brctl addif bridge0 eth0

Then, you can launch the kernel vm with vido:

$ vido --kvm --kernel arch/x86_64/boot/bzImage --bridge bridge0 -- sh

In the stub script, a dhcp client server will be launched for each interface created.

This also supports creating multiple guest interfaces that either share the same bridge or use different bridges:

$ vido --kvm --kernel arch/x86_64/boot/bzImage --bridge bridge0 bridge0 -- sh

The resulting VM has eth0 and eth1 which behave as completely independent NICs.

This is implemented using Qemu's bridge helper, which will create the required TAP device and add it to your bridge. You may need to edit /etc/qemu/bridge.conf to include the bridge device you created, as described in the link.

I figured you might want to at least see this functionality, even if you don't end up merging it. It's very important for my use case, but I can always keep using my fork!

The user may create bridges and connect them to host interfaces. Then,
they can specify a bridge with the --bridge option, and qemu will create
a tap device and connect it to that bridge. You can pass the same bridge
multiple times to create several guest interfaces on the same bridge.
The startup script requests a DHCP lease on all interfaces.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant