VM Networking¶
How to configure an experiment network
Overview¶
minimega uses software-defined networking to connect VMs on one or more virtual networks. These networks can span a single node, a cluster, or across clusters.
See Module 14 for more information about VM networking on a cluster.
APIs¶
This module covers the following APIs:
vm config networksvlanstapbridge
Configuring networks¶
When configuring a VM, the user decides the bridge, VLAN, MAC, and driver for each VM interface. Endpoint VMs typically have a single interface while routers may have several.
Where netspec is:
Only the VLAN is mandatory -- the other fields have sane defaults.
What is a VLAN?¶
A VLAN is an extra 12-bit identifier in the MAC frame that logically separates LANs that share the same physical network.
VMs on the same VLAN are in the same LAN. VMs in different VLANs must be connected by a router that spans the VLANs.
The 12-bit identifier means that there are 4,094 possible VLANs. 0x000, 0xFFF, and 0x001 are typically reserved.
Configuring networks, examples¶
To connect a VM to VLANs 100 and 101:
To connect a VM to VLANs 100 and 101 with specific mac addresses:
To connect a VM to VLAN 100 on bridge0 and VLAN 200 on bridge1:
To connect a VM to VLAN 100 on bridge0 with a specific mac:
To specify a specific driver, such as i82559c:
VLAN aliases¶
In the previous example, we used explicit VLAN identifiers like 100 and 101. minimega support VLAN aliases to make them easier to work with:
DMZ and CORE will automatically be assigned to an available VLAN identifier on their first use. Otherwise, they will mapped to the stored value.
VLAN aliases¶
The vlans API allows users to print, add, and configure VLAN aliases:
You can manually add a VLAN using vlans add:
To limit aliases to a particular identifier range, use vlans range.
VLAN blacklist¶
You may also blacklist identifiers that minimega should not use for new aliases:
This happens automatically if you specify a VLAN identifier in
vm config networks:
Creating host taps¶
Once VMs are running, it can be useful to access the VM network from the host. This is achieved by creating a host tap on the DMZ VLAN:
This interface can be given an IP using external tools or directly in minimega:
See this article for how to connect a VM to the Internet.
Mirrors and trunks¶
Accessing the "live" VM traffic can be useful to understand what the VMs are
doing. There are two ways to do so: tap mirror and bridge trunk.
tap mirror mirrors one tap to another.
bridge trunk mirrors all traffic from the bridge to an interface.
See this article on tap mirroring for more information.
minimega also supports capturing packets. You can read up on the capture API in the API Documentation.