Bridge and tap interfaces

To facilitate creation of an inter-guest and guest-host network, the QNX Hypervisor reference images include a bridge on the host, and tap interfaces that are associated with the two guests included in the images.

If you assign IP addresses to the hypervisor host and to the guests, this mechanism allows the guests to ping each other, and ping the host.

Each guest needs its own tap interface, and each guest should be added to the bridge if it needs to communicate with other guests or the host. The taps included in the the reference images are as follows:

You can of course add more taps, or change these default configurations (see Adding taps below).

For more information about configuring networks in a QNX system, see the Core Networking Stack User's Guide.

Note:

Tap interfaces are included in the hypervisor reference images because they are a convenient way establish network connections.

In a production system, however, you should use the devnp-vdevpeer.so io-pkt-* driver. It is more efficient and offers performance superior to that available with tap interfaces.

Adding taps

If you need more tap devices for additional guests, in the hypervisor host domain:

  1. Use the ifconfig utility to see what tap devices are currently being used.
  2. Add a tap with a number higher than the number of the highest tap being used. For example, if the highest tap used in tap3, create a new one (tap4) and add it to the bridge, as follows:

    ifconfig tap4 create
    if_up -p tap4
    ifconfig tap4 up
    brconfig bridge0 add tap4
  3. Make this new tap device available to the guest by adding it the qvm configuration file for the VM in which the guest will run, as follows:

    vdev vdev-virtio-net
    tapdev tap4

See Assembling and configuring VMs in the Configuration chapter.

Giving a guest access beyond the hypervisor host domain

To give guests access beyond the hypervisor host domain, you need to include the host's Ethernet interface in the bridge, then get an IP address you can use:

  1. In the hypervisor host domain, add the host's Ethernet interface to the bridge; for example:

    brconfig bridge0 add wm0
  2. Make sure that both the host and the guest are connected to a DHCP server.
  3. On the guest, run dhclient to get an IP address.

Remember that tap interfaces are in the host hypervisor domain, which launches the qvm process that creates the VM in which the guest runs. The qvm process creates an Ethernet interface in the VM for each tap device that is to be associated with that VM (e.g., for a QNX guest, vt0: the first virtual Ethernet interface in the guest).

The tap interface appears differently when seen from the hypervisor host domain than when seen from a guest. Each guest sees only the interfaces in its VM. It knows nothing of the others. For example, in the following, each guests only knows about the single tap interface in its VM:

Host's perspective VM Guest Guests' perspective
tap0 vm0 Guest 0 vt0
tap1 vm1 Guest 1 vt0
tap2 vm2 Guest 2 vt0

Thus, from the guest (i.e., inside the VM), once you have started networking, to get a valid TCP address you would use the tap, not as seen by the host, but as seen from the guest. For example:

dhclient -nw vt0
Note:

In a Linux (or other) OS guest, the virtio-net interface name may be different from the name in a QNX guest.

In the table above, the tap interface number is only coincidentally the same as the guest number.