Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have two servers (VPS at Linode) of which one (db) has only one static private IP, so I need to access it via the other one (web). Now that works fine, but I discovered that I cannot access anything on the Internet from the db server... and running some updates would by now be nice :)

config /etc/network/interfaces is

auto lo
iface lo inet loopback

auto eth0

iface eth0 inet static
 address (private IP)
 netmask (netmask)

Wouldn't the db server have Internet access because it is on the same private LAN? What do I need to change?

share|improve this question

3 Answers 3

The database server needs a gateway, and that gateway needs to handle whatever NAT between the private IP address and the "real" IP address it uses to reach the internet.

On the database server side, for your configuration snippet there, you'd need to add

   gateway (gateway)

after address and netmask for eth0. If Linode doesn't provide gateways already set up for this, then you'll probably be using the internal address of your other server as the gateway, then setting up your other server for Masquerading, which allows it to share its connection with other computers.

share|improve this answer

You need to make sure that the router on your subnet is configured to run NAT(or masquerade) for your IP.

What is your default gateway on the 2nd server? Can you ping that IP? If you can ping the gateway, but not outside then it is a config problem on the gateway which you may need to talk to your provider for.

share|improve this answer

Linode provides a public address for each instance. For your DB instance, log into your Linode account and click the instance, then check the Network tab (I think, I am doing this from memory). If you want the db to have internet access, set the public address to eth0, and this entry will have a gateway listed as DerfK says. Set the private address on eth1. You then should still be able to access the db from your web server on the private network, and access the internet on the public network.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.