Skip to content

KVM Private Internal Network Setup


User Contributed Documentation
Credit: Brian Oliver, XFuse Solutions LLC


This chapter shows you how to set up a Private Internal Network. This guide has been tested and works with KVM nodes. It has not been tested with XEN. This will not work on OpenVZ.

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

rpm -q bridge-utils

You should get an output similar to the following:

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:

SSH

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 the guide, we will be using the bridge name of intbr0 and the IP range of 192.168.0.0/24

1. Create a new bridge file:

nano /etc/sysconfig/network-scripts/ifcfg-intbr0

2. Add the following to the file:

DEVICE=intbr0
ONBOOT=yes
TYPE=Bridge
BOOTPROTO=static
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
IPADDR=192.168.0.1
NETMASK=255.255.255.0

3. Save and exit.

4. Restart the network service:

service network restart

5. Once the restart has completed, run the following to see the new bridge:

ifconfig

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.

6. Rename config.ini.example to config.ini:

mv /usr/local/solusvm/data/config.ini.example /usr/local/solusvm/data/config.ini

7. Edit config.ini:

nano /usr/local/solusvm/data/config.ini

8. Change text in the next section with following one:

;; When writing the internal network configuration within the virtual
server
;; don't add the gateway variable
;domain_simple_internal_network = false
;; When writing the internal network configuration within the virtual
server
;; don't add the gateway variable
domain_simple_internal_network = true

9. Save and Exit.

10. In SolusVM Master go to Nodes > List Nodes.  (Don't add the Internal IP's as new IP block in SolusVM)

11. Click the name of the node that you set up the bridge for. 

12. Click  Internal IP Addresses

13. 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)

14. Click  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  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 address. You, or the customer, will need to log in as root to add the IP. The steps to do this for CentOS are below.

1. Create a new device. Replace eth1 to match the device you are creating:

nano /etc/sysconfig/network-scripts/ifcfg-eth1

2. Add the following:

DEVICE=eth1
BOOTPROTO=static
ONBOOT=yes
IPADDR=192.168.0.10
NETMASK=255.255.255.0

3. Save and exit.

4. Restart the network service:

service network restart

5. Check to see if the new device is listed by running the following. You should now see eth0, eth1, and lo:

ifconfig

6. Ping the default gateway:

ping 192.168.0.1

7. 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. Still you can log in and double check to make sure it was created correctly.

Back to top