Creating a virtual network#

OpenNebula allows users to create virtual networks to connect virtual machines too. There are many types of virtual networks available on OpenNebula including Bridged, VLAN, VXLAN and Open Vswitch.

On our OpenNebula installation we have created a VXLAN network template that can be used to create virtual networks.

There is also a virtual network that we have created for public use called “Internet VLAN” this network can be used by anyone and will allow any VMs connected to it to access the internet and the Surrey Network.

Step by step guide#

This guide will take you through the steps required to create your own virtual network.

  • To get started click on “Network” > “Virtual Networks” on the left-hand menu.

  • This will display the virtual networks screen.

The “Virtual Networks” screen#

../../_images/virtual-networks.png
  • On the virtual networks screen click on the green + button and then click “Instantiate”

  • This will open the “Instantiate Virtual Network” screen

The “Instantiate Virtual Network” screen#

../../_images/instantiate-vnet.png
  • On this screen you will be presented with the available network templates you can use, in this example there is only one template called “Private VXLAN Network”.

  • Click on the template and the menu below will appear for you to customise the network before you instantiate it.

  • Give your network a Name (make it something useful to help yourself or others identify it).

  • Specify one or multiple IP address ranges for your virtual network

  • Click on the green + Address Range button

  • This will open the “new address range” menu

New address range#

../../_images/a-new-address-range.png
  • Here you can specify the first IP address you want in a range of IP addresses. Followed by the size of that range.

  • The IP range is completely up to you. This network you create will be entirely new and separate from any other virtual networks existing on OpenNebula. You do not need to worry about clashing with existing IP addresses on other virtual networks.

  • Click on the green add button to add this IP range to your virtual network.

Note

The above example uses a class B sized IPV4 private network starting with the IP address 10.0.0.1 and ending in 10.0.255.254 which is a range of 65534 usable IP Addresses

  • If you want to add another IP address range to the Virtual network repeat the above process.

  • Once all the IP ranges have been added click on the “Context” drop-down at the bottom of the page to reveal the Context Menu

Network configuration context menu#

../../_images/network-context.png
  • The context section allows you to complete 6 different fields containing important information about your network. This information will be used to automatically configure the VM’s network interface when the virtual machine is instantiated.

  • These fields are optional and their contents will depend on how you want to set up your network.

Network Address: The Networks address written in an IP/CIDR format

Network Mask: The subnet mask

Gateway: The IP address of the network gateway

IPv6 Gateway: The IPv6 address of the network gateway

DNS: The IP addresses of any DNS servers (written in a white space separated list).

MTU of the Guest interfaces: The maximum transmission unit size in bytes

Note

The above example specifies the network as 10.0.0.0/16, which is our class B sized network of roughly 65500 IP’s. I have decided to implement a subnet mask of 255.255.255.0 which means that the network will be carved up into private subnets of 254 addresses each and machines will not be able to communicate from one subnet to another. This could be useful if for example I wanted to assign each student in a class their own private subnet to work in. So student A can connect all their instances to 10.0.1.X and student B 10.0.2.X. Student A’s VM’s and students B’s VM’s cannot communicate with each other as they can’t connect to any machines outside of their own subnet.

  • Once the context section is complete click the green create button at the top of the page.

  • This will take you back to the “Virtual Network” screen, you should now see your Network in the list.

My demo network#

../../_images/demo-network.png

You have created a virtual network!

To use your network you will need to create an instance and configure one of the network interfaces to connect to it.

Permissions#

Note

The Virtual Network you have created is currently owned by your user, and by default you are the only user permitted to use it.

If you want to allow others to connect to the network you will need to edit its permissions.

  • On the networks screen click on your Virtual Network.

  • This will open the Networks “info” screen

Virtual network info screen#

../../_images/network-perm.png
  • In the top right corner you can see the current permissions for the network. To allow others to use the network you need to tick the “Use” box in the Row for “Other”

  • The virtual network is now public so other users can connect their instances to it.