Networking
You can set up communications between the host and guests, between guests, and between guests and the outside world.
When you design a network interface for a guest, you can use:
- a virtio-net vdev connected to another virtio-net vdev, usually in another guest
- a virtio-net vdev connected to a devnp-vdevpeer-net.so driver instance running in the hypervisor host
- a pass-through device
A virtio-net vdev offers peer-to-peer communication;
for more information, see vdev virtio-net in the Virtual Device Reference
chapter.
The devnp-vdevpeer-net.so driver runs in the hypervisor host.
It enables the iopkt-* service in the host to
communicate with guests through appropriately configured vdevs in
the qvm process instances that host the guests.
For more information, see devnp-vdevpeer-net.so in the Utilities and
Drivers Reference
chapter.
MAC addresses in a hypervisor system
Note the following about assigning MAC addresses:
- MAC addresses must be unique in any given Ethernet segment. There can be multiple Ethernet segments on a target board, and a target board may share a segment with some external entity.
- If you don't specify MAC addresses, the vdev and the devnp-vdevpeer-net drivers will generate them for you. Since these addresses are generated, they will change each time you restart the networking manager (io-pkt-*) or the VM.
- When assigning MAC addresses, you should set the locally assigned bit (see IEEE 802.3-2015 Section 1, paragraph 3.2.3, item b).
Enabling peer-to-peer networking
To support connectivity between guests in your hypervisor system, and between guests and the outside world, peer-to-peer networking must be enabled in the host, along with a network driver (e.g., e1000).
You can do this by starting io-pkt-* in the host, using the -d vdevpeer-net option, specifying a physical network driver and the peer interfaces you want to create. You can use the command line to start io-pkt-* after the host has booted, or you can add the io-pkt-* startup instructions to the hypervisor host's startup scripts.
The following command starts the host network driver that will be shared, and creates one interface for each of three guests in a hypervisor system:
io-pkt-v6-hc -d e1000 -d vdevpeer-net \
peer=/dev/qvm/qnx7-guest1/p2p,bind=/dev/vdevpeers/vp0,\
peer=/dev/qvm/qnx7-guest2/p2p,bind=/dev/vdevpeers/vp1,\
peer=/dev/qvm/linux-guest/p2p,bind=/dev/vdevpeers/vp2
The io-pkt-*
-d option starts devnp-* drivers (see io-pkt-v4-hc, io-pkt-v6-hc in
the QNX Neutrino Utilities Reference).
In the example above, the
e1000 driver is required only if your system needs to connect
to the outside world (see Guest-to-world
in this chapter).
If you only need to connect guests to each other, you can omit this driver.
