Virtual Machine Network Setup

Network configuration on your new Virtual Machine is done in a few steps. You will need a separate portable IP block for both the public and private network. For documentation process we will assume that you are using a Virtualization offering that requires Secondary on VLAN(broadcast domain) and not Routed to VLAN(without network id/gateway/broadcast) subnet. If you do not intend to use the private network on your Virtual Machine, you will only need the Public subnet. Portable IP blocks can be ordered directly through the Portal at Sales->Add IP Addresses or via the Public Network IP Manager.

After you have obtained your IP blocks, you will now be able to configure networking on the Virtual Machine. If you have not yet installed the Virtual Machine, configuration of your public network block can be performed through the Operating System installation process. This is the quickest method of configuring your public network and is recommended. If you have already install the guest Operating System, this guide does also provide instructions for configuring your public network. All network configuration steps provided will assume that the first network interface(eth0 or Local Area Connection) will always be the private network and the second network interface (eth1 or Local Area Connection 2) will be the public network.

Configuring your network is setup differently based on the OS you have installed. This guide provides detailed information on configuring your network for the following Operating Systems. Operating Systems grouped together share the same network configuration.

·Windows 2008 Server Core
·Windows 2003 Standard and Enterprise
·Windows 2008 Web, Standard, Enterprise and Datacenter
·Redhat, Fedora and CentOS
·Ubuntu and Debian

Network configuration will require the following information for both your Public and Private IP blocks. The information can be found in the portal for Public IP blocks under Public Network -> IP Manager and Private IP blocks under Private Network -> IP Manager.

-IP Address
-Gateway
-Subnet Mask
--Subnet conversion
---/29 - 255.255.255.248
---/28 - 255.255.255.240
---/27 - 255.255.255.224
---/26 - 255.255.255.192
---/25 - 255.255.255.128
---/24 - 255.255.255.0

Windows 2008 Server Core

Windows 2008 Server Core edition does not provide a graphical interface from which to configure the system network. Configuration will need to be done manually via the command line. Below are the commands you will need to run. The IP addresses used in this example will need to be replaced with the correct IP addresses from your IP Blocks. These same commands should work with older versions of Windows Server that include the netsh2 command.

Example public IP block – 192.0.2.0/29

·IP Address – 192.0.2.2
·Gateway – 192.0.2.1
·Subnet Mask – 255.255.255.248

Example private IP block – 10.0.0.0/29

·IP Address – 10.0.0.2
·Gateway – 10.0.0.1
·Subnet Mask – 255.255.255.248

Public Network

This command will create the public network connecting your server to the internet.

  • Netsh interface ip set address name=”Local Area Connection 2” static 192.0.2.2 255.255.255.248 192.0.2.1

These commands will create the DNS entries. If you are not using the private network, you will need to replace these IP addresses with working DNS servers

  • Netsh interface ip add dns “Local Area Connection 2” 10.0.80.11
  • Netsh interface ip add dns “Local Area Connection 2” 10.0.80.12

Private Network

The following 2 commands will configure the private network as well as create the persistent route for the private network. The persistent route will provide your private network access to the entire private network which includes the DNS servers in the public network configuration steps above. Please note, there is no gateway assigned to the private network. This is handled via the route statement that is provided below.

  • Netsh interface ip set address name=”Local Area Connection” static 10.0.0.2 255.255.255.248
  • Route add 10.0.0.0 mask 255.0.0.0 10.0.0.1 -p

Windows 2003 Standard and Enterprise

Windows 2003 allows you configure networking using either the command line or the graphical user interface. If you intend to use the command line, please refer to the configuration instructions for Windows 2008 Server Core, as these instructions will work for 2003. The instructions for using the graphical interface will be provided here. The IP addresses used in this example will need to be replaced with the correct IP addresses from your IP Blocks.

Example private IP block – 10.0.0.0/29

·IP Address – 10.0.0.2
·Gateway – 10.0.0.1
·Subnet Mask – 255.255.255.248

Open your network configurations

  1. Start Menu -> Settings -> Control Panel
  2. Open “Network Connections”
  • If you installed 2 network adaptors you will see “Local Area Connection” and “Local Area Connection 2

Public Network

The following instructions will provide detailed steps on configuring the public network through the windows graphical interface.

  1. Right Click on “Local Area Connection” -> Properties.
  2. Select “Internet Protocol (TCP/IP)” then click “Properties”.
  3. On the General Tab
    1. Select “Use the following IP address:
    2. Enter your public IP Address, subnet mask and gateway.
    3. Select “Use the following DNS server addresses:”. If you will be configuring the private network, use the following DNS Servers, if not, you will need to provide DNS servers
      • Preferred DNS server: 10.0.80.11
      • Alternate DNS server: 10.0.80.12
    4. -Click “OK”

Private Network

  1. Right Click on “Local Area Connection 2” -> Properties.
  2. Select “Internet Protocol (TCP/IP)” then click “Properties”.
  3. On the General Tab
    1. Select “Use the following IP address:
    2. Enter your private IP Address and subnet mask.
    3. Leave the gateway field empty
    4. Click "OK"
  4. Click “OK” again to close the network configuration window.

To provide access to the entire private network which includes the DNS servers you will need to add a custom route to the server. This is done in the next few steps.

·Start -> Run
·Enter the command “cmd” and press “OK”
·Run the following command; replace the gateway address (10.0.0.1) with your private IP block gateway.
“route add 10.0.0.0 mask 255.0.0.0 10.0.0.1 –p”

Windows 2008 Web, Standard, Enterprise and Datacenter

Windows 2008 allows you configure networking using either the command line or the graphical user interface. If you intend to use the command line, please refer to the configuration instructions for Windows 2008 Server Core, as these instructions will work for all 2008 servers. The instructions for using the graphical interface will be provided here. The IP addresses used in this example will need to be replaced with the correct IP addresses from your IP Blocks.

Example private IP block – 10.0.0.0/29

·IP Address – 10.0.0.2
·Gateway – 10.0.0.1
·Subnet Mask – 255.255.255.248

Open your network configurations

·Start Menu -> Settings -> Control Panel
·Open “Network and Sharing Center”
·Click “Manage network connections”
·If you installed 2 network adaptors you will see “Local Area Connection” and “Local Area Connection 2”

Public Network

The following instructions will provide detailed steps on configuring the public network through the windows graphical interface.

  1. Right Click on “Local Area Connection” -> Properties.
  2. Select “Internet Protocol Version 4 (TCP/IPv4)” then click “Properties”.
  3. On the General Tab
    1. Select “Use the following IP address:
    2. Enter your public IP Address, subnet mask and gateway.
    3. Select “Use the following DNS server addresses:”. If you will be configuring the private network, use the following DNS Servers, if not, you will need to provide DNS servers
      • Preferred DNS server: 10.0.80.11
      • Alternate DNS server: 10.0.80.12
  4. ·Click “OK”

Private Network

  1. Right Click on “Local Area Connection 2” -> Properties.
  2. Select “Internet Protocol Version 4 (TCP/IPv4)” then click “Properties”.
  3. On the General Tab
    1. Select “Use the following IP address:
    2. Enter your private IP Address and subnet mask.
    3. Leave the gateway field empty
  4. Click “OK
  5. Click “OK” again to close the network configuration window.

To provide access to the entire private network which includes the DNS servers you will need to add a custom route to the server. This is done in the next few steps.

  1. Start -> Run
  2. Enter the command “cmd” and press “OK”
  3. Run the following command; replace the gateway address (10.0.0.1) with your private IP block gateway.
    • route add 10.0.0.0 mask 255.0.0.0 10.0.0.1 –p

Redhat, Fedora and CentOS

Network configuration on RedHat, Fedora and CentOS is done through manually editing configuration files. In order to manually edit the files, you will need to be logged into the Virtual Machine as the root used and will require a text editor.

Example public IP block – 192.0.2.0/29

·IP Address – 192.0.2.2
·Gateway – 192.0.2.1
·Subnet Mask – 255.255.255.248

Example private IP block – 10.0.0.0/29

·IP Address – 10.0.0.2
·Gateway – 10.0.0.1
·Subnet Mask – 255.255.255.248

Public Network

The public network settings are contained in the following file, you will need to edit this file with the information provided. Replace the example IP addresses with the correct IP addresses form your public IP block. Note, the file may not exist. If the file does not exist, create the file. If it does exist, replace all data in the file with the information provided below.

·/etc/sysconfig/network-scripts/ ifcfg-eth1
DEVICE=eth1
BOOTPROTO=static
BROADCAST=192.0.2.7
IPADDR=192.0.2.2
NETMASK=255.255.255.248
NETWORK=192.0.2.0

GATEWAY=192.0.2.1
ONBOOT=yes

Private Network

The private network settings are contained in the following file, you will need to edit this file with the information provided. Replace the example IP addresses with the correct IP addresses from your Private IP block. Note, the file may not exist. If the file does not exist create it, if the file does exist, replace all data in the file with the information provided below. The private network WILL NOT have a default route, so the GATEWAY will not be defined.

·/etc/sysconfig/network-scripts/ ifcfg-eth0
DEVICE=eth0
BOOTPROTO=static
IPADDR=10.0.0.2
NETMASK=255.255.255.248
ONBOOT=yes

Finally, a new route will be required to provide private access to the entire private network including the DNS server. This is done by editing the following file. This fill will not exist and will need to be created. NOTE: replace "10.0.0.1" in the example below with your private subnet IP gateway. This is defined via the SoftLayer control panel in your Private Network.

·/etc/sysconfig/network-scripts/route-eth0
10.0.0.0/8 via 10.0.0.1

DNS Configuration

The primary and secondary DNS configuration is contained in a separate file; this fill will need to be edited with the following information. If this Virtual Machine does not have access to the private network, you will need to replace the server IP’s with the IP addresses of the DNS servers you plan to use.

·/etc/resolv.conf
nameserver 10.0.80.11
nameserver 10.0.80.12

In order for these changes to take effect, you will need to restart networking on the server. This can be done by running the following command

  • service network restart

Ubuntu and Debian

Ubuntu and Debian network configuration is done through a single configuration file. This file will need to be manually edited. To edit this file you will need to have root access to the server. The base install of Ubuntu does not provide a root login, however the user created in the installation process has access to sudo. You will need to use the sudo command to edit the file if you are running on ubuntu.

Example public IP block – 192.0.2.0/29

·IP Address – 192.0.2.2
·Gateway – 192.0.2.1
·Subnet Mask – 255.255.255.248

Example private IP block – 10.0.0.0/29

·IP Address – 10.0.0.2
·Gateway – 10.0.0.1
·Subnet Mask – 255.255.255.248

Public and Private Network

Edit the following file with any text editor. Replace example IP addresses with the correct IP’s from your Public and Private IP blocks.

·/etc/network/interfaces
auto lo
iface lo inet loopback

auto eth1
iface eth1 inet static
address 192.0.2.2
netmask 255.255.255.248
gateway 192.0.2.1

auto eth0
iface eth0 inet static
address 10.0.0.2
netmask 255.255.255.248

#Static route for backend service network
up route add -net 10.0.0.0/8 gw 10.0.0.1

DNS Configuration

The primary and secondary DNS configuration is contained in a separate file; this fill will need to be edited with the following information. If this Virtual Machine does not have access to the private network, you will need to replace the server IP’s with the IP addresses of the DNS servers you plan to use.

·/etc/resolv.conf
nameserver 10.0.80.11
nameserver 10.0.80.12

In order for these changes to take effect, you will want to restart networking on the server. This can be done by running the following command:

  • /etc/init.d/network restart

Note: 192.0.2.0/24 is used as Public IP Documentation as per RFC1166 and RFC5737.  You will not use these IP addresses on your servers at any point in time.