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:
Your output should look similar to the following:
The rows to pay attention to are those starting with "10.176.0.0":
10.176.0.0 10.181.160.1 255.248.0.0 UG 0 0 0 eth1 10.176.0.0 10.181.160.1 255.240.0.0 UG 0 0 0 eth1
If you have an entry with a network mask (Genmask) of 255.248.0.0 (first row) but not one with 255.240.0.0 (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 10.181.160.1, 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 10.176.0.0 netmask 255.240.0.0 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 10.176.0.0 netmask 255.240.0.0 gw x.x.x.x" >> /etc/sysconfig/static-routes
echo -e "up route add -net 10.176.0.0 netmask 255.240.0.0 gw x.x.x.x\ndown route del -net 10.176.0.0 netmask 255.240.0.0 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:
2. The important information is in the "Persistent Routes" section. You will want to pay attention to the line that starts with 10.176.0.0.
3. If the netmask is "255.240.0.0", 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 10.176.0.0 mask <incorrect netmask>
5. Add the correct route.
route /p add 10.176.0.0 mask 255.240.0.0 <your gateway address> metric 10
© 2011-2013 Rackspace US, Inc.
Except where otherwise noted, content on this site is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License