KVM/XEN Internal Private Network

XFS_Brian

New Member
Verified Provider
This guide shows you how to setup a Private Internal Network on a KVM node.


This guide presumes that you already have bridge-utils installed. To check, run the following:

rpm -q bridge-utils
You should get an output similar to the following:
Code:
bridge-utils-1.2-9.el6.x86_64
If you did not get any output like this, then it needs to be installed. Run the following:
Code:
yum install bridge-utils -y
Before setting up your Private Network, you will need to know the bridge name that you will use and the IP address range. In this guide, we will be using the bridge name of intbr0 and the IP range of 192.168.0.0/24

Create a new bridge file:
Code:
nano /etc/sysconfig/network-scripts/ifcfg-intbr0
Add the following to the file:
Code:
DEVICE=intbr0
ONBOOT=yes
TYPE=Bridge
BOOTPROTO=static
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
IPADDR=192.168.0.1
NETMASK=255.255.255.0
Save and exit.

Restart the network service:

Code:
service network restart
Once the restart has completed, run the following to see the new bridge:
Code:
ifconfig
This next step is very important. If it is not done, any VPS that has a Private IP Address assigned to it, during creation, will not reach the internet. This is due to the standard that only one default gateway can be used at any given time. This change has to be made on the server that you are creating the private network on.

Rename config.ini.example to config.ini:
Code:
mv /usr/local/solusvm/data/config.ini.example /usr/local/solusvm/data/config.ini
Edit config.ini:
Code:
nano /usr/local/solusvm/data/config.ini
Change the following section:
Code:
;; When writing the internal network configuration within the virtual server
;; don't add the gateway variable
;;domain_simple_internal_network = false
To look like this:
Code:
;; When writing the internal network configuration within the virtual server
;; don't add the gateway variable
domain_simple_internal_network = true
Save and exit.

In SolusVM Master, goto Nodes > List Nodes. Click the name of the node that you setup the bridge for. Click on Internal IP Addresses. Fill the boxes using the information you used in your bridge.

Default Gateway = 192.168.0.1 (this is the IP address of the bridge)
Netmask = 255.255.255.0
Bridge = initbr0 (replace with the bridge name you used)

Click on Save.

Now you can add a single IP or a range of IP addresses. Do not add 192.168.0.1 as this is your default gateway.

To assign an IP to a virtual, this has to be done from the properties of that virtual. Once you are there, click on Internal IP. The new IP will not be assigned to the virtual until it has been rebooted. Once it is rebooted, the guest OS will not be able to use the new IP. You will need to log in as root to add the IP Address. The steps to do this for CentOS are below.

Create a new device. Replace eth1 to match the device you are creating:
Code:
nano /etc/sysconfig/network-scripts/ifcfg-eth1
In this file, add the following:
Code:
DEVICE=eth1
BOOTPROTO=static
ONBOOT=yes
IPADDR=192.168.0.10
NETMASK=255.255.255.0
Save and exit.

Restart the network service:
Code:
service network restart
Check to see if the new device is listed by running the following. You should now see eth0, eth1, and lo:
Code:
ifconfig
Ping the bridge IP Address on the Host Node:
Code:
ping 192.168.0.1
If you followed this guide to the letter, you should see your pings being returned as delivered  If you see anything other then that, please check over your settings.

If the Internal IP is assigned to the virtual before you re-install the OS, there is no need to create the new device. SolusVM does this for you. It does not hurt to still log in and double check to make sure it was created correctly.
 
Top