Database as a Service Network Routes

Database as a Service Network Routes

If you are unable to connect to or ping your database server from a cloud server in the same datacenter as your DBaaS instance, this may be due to a missing route that is required in order to send traffic over your private network interface. How you check and modify your routes depends on the operating system on your server.


Your can check your routes by running the following command as the root user:

route -n

Your output should look similar to the following:

The rows to pay attention to are those starting with "":     UG    0      0        0 eth1     UG    0      0        0 eth1

If you have an entry with a network mask (Genmask) of (first row) but not one with (second row), then you will need to add the appropriate route to to your configuration. Take note of the gateway field for that row.

In this example, the gateway IP is, however it may be different on your server.  To add the needed route, run the following command with x.x.x.x replaced by your 10.x.x.x gateway IP:

route add -net netmask gw x.x.x.x

After running that command, the route is temporarily added to your networking configuration.  Check that you can ping and connect to your DBaaS instance.  If you now have connectivity, you'll want to make this change persistent with the following commands (run as root), dependent on the distribution you are running.  As before, replace x.x.x.x with your gateway IP.


echo "any net netmask gw x.x.x.x" >> /etc/sysconfig/static-routes


echo -e "up route add -net netmask gw x.x.x.x\ndown route del -net netmask gw x.x.x.x" >> /etc/network/interfaces

It is recommended that you reboot your server to test these changes and ensure the routes persist.  If you encounter any problems after the change, simply remove the added line(s) from your /etc/sysconfig/static-routes or /etc/network/interfaces file.


1. Open a command prompt and print routing information by running:

route print

2. The important information is in the "Persistent Routes" section. You will want to pay attention to the line that starts with

3. If the netmask is "", then you have the correct route. Anything else is incorrect.

4. Remove the erroneous route, taking note of the "Gateway Address" the route used.

route delete mask <incorrect netmask>

5. Add the correct route.

route /p add mask <your gateway address> metric 10

© 2015 Rackspace US, Inc.

Except where otherwise noted, content on this site is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License

See license specifics and DISCLAIMER