CloudLink is infrastructure so it can enable many use cases. However, you will be unable to use it until you configure your servers to use static routes. The rest of this post will describe how to create a static route from one server in US-West-1 to servers in US-East-1. This assumes that you have not already assigned a private IP to the West server. This guide assumes that you have a basic knowledge of Linux and/or Windows and with the basic principles of networking.
Find your Private IPs
If you want to assign a private IP to a server in US-West-1, you would select it from the list in the screenshot – just pick one that you have not already assigned somewhere else. Take note of the subnet as you will need it later.
Assign a Private Static IP on Ubuntu / Debian
To assign a private IP, you can update the interface directly. Enter the following at the prompt or use your favorite Linux editor.
Within the file enter the following (the IP is just an example, use one of your own. Don’t enter the text in the brackets):
auto eth1 iface eth1 inet static address 10.100.10.3 [a private IP address in the West ] netmask 255.255.255.0
Save the file.
This step assigns a private IP from your West block to a single Ubuntu / Debian server. You will need to activate the new IP so restart your network interface.
and then enter:
Assign a Private IP to a Windows Server
For Windows users, you will need to do the following.
- Click on Start > Control Panel > Network Connections.
- Select Local Area Connection 2.
- Click Properties.
- Double-click TCP/IP in the scroll box.
- Enable the radio button titled Use the Following IP Address.
- Assign a PrivateIP address to this machine
- You can find your private IP block by going to the GoGrid portal, selecting the List tab and then Network.
- Under Type: Private you will see your private IP blocks. If this Windows Server is in the West, make sure to use IPs that have US-West-1 in the Datacenter column.
- Select an available private IP address and note the Subnet Mask
- Enter the subnet mask as found on your list of private IP blocks.
- Leave the gateway blank.
- You can enter GoGrid’s name servers under DNS if you are so inclined.
- Continue to click OK to exit each subsequent window.
- To confirm changes were successful, open a command prompt window and type
- Those steps will assign a private IP address to a particular machine. Make sure to enable “Local Area Connection 2”.
Create a static route on your Linux server
Once you have assigned a private IP to your server, you will then need to create a static route to your East private IP block. The IPs below are examples only, use your own IPs when you enter the command! This command will work on Ubuntu, Debian, Red Hat, and CentOS.
At the command line type:
route add -net 10.200.10.0 netmask 255.255.255.0 gw 10.100.10.1
This adds a route from your US-West-1 server to your US-East-1 private IP block (the 10.200.10.0 netmask… of the code) via the US-West-1 private gateway (10.100.10.1).
Persisting the static route on Linux
The command entered in the previous step will only keep the route while your session is active. In order to have the route stay through reboots, you will need to update configuration files on your server. Please see the wiki for instructions on how to set persistence and for configuring CentOS or Red Hat Enterprise Linux (RHEL).
Create a static route on your Windows server
- Open a command prompt by clicking on Start > Run
- Type “cmd” and click OK.
- Enter the command
route add -p 10.200.10.0 [East private IP block] mask 255.255.255.0 [West Gateway IP]
- where [West Gateway IP] is +1from your first IP address in your Private Network block available in the GoGrid user interface. If your Windows Server is in the WEST then you will want to use the Gateway IP for the US-West-1 private network. So in the screenshot above, 10.109.32.1 is the gateway NOT 10.109.32.0. You will want to connect to the East private IP block, so the number after p is the first available number in your East Private IP block.
- For example, you would enter something like:
route add -p 10.200.10.0 mask 255.255.255.0 10.109.32.1
The p flag ensures that the route is persistent across reboots.
Testing the connection
If you want to test ping, you will need to assign a private IP to the server that you want to ping and also define a static route back to the IP blocks in the other datacenter. In this example, since you have setup a Windows machine with a route from West to East, you will need to setup a static route on an East server that you want to ping back to the West.
For example, you can execute the route command if you don’t want to persist the route for Windows:
route add 10.109.32.0 mask 255.255.255.0 10.200.10.1
And for Linux machines:
route add -net 10.109.32.0 netmask 255.255.255.0 gw 10.200.10.1
This command sets a static route to your West private IP block through your East gateway.
If you can successfully ping that configured US-East-1 private IP from your Windows server in US-West-1 then this has been configured correctly.