0

I want to create a basic Ubuntu 12.04 LAMP server under VBox. Once I have it configured with a base Data set I want to Snapshot that and be able to hand it off to my development partners to use. Basically I want to be able to clone/snapshot a ready to use LAMP server.

I am under the impression I would want to assign a static IP / Hostname and then open port 3306 using iptables. I would then provide this info to anyone using this database server.

To that end I am installing Ubuntu Server 12.04 and LAMP and then following the standard tutorials on setting a static IP. I have etc/network/interfaces configured but when it comes to writing the nameserver entries in resolv.conf, I open it but the first two lines state not to edit that changes will be lost.

here is what I have in /etc/network/interfaces

auto eth0
iface etho inet static
    address 192.168.1.155
    netmask 255.255.255.0   
    network 192.168.1.1
    gateway 50.43.32.1
    broadcast 192.168.1.255
    nameserver 184.16.33.54 184.16.4.22

When I attempt to restart the network I get an error stating:

Reconfiguring network interfaces
RTNETLINK answers: File exists
Failed to bring up eth0
                                                       [OK]

What would I edit to effect the hostname changes and better yet might there be an easier way to accomplish what I am after. I know I can edit my internal network to assign a static IP and I am doing that for a network storage device, but I would rather not rely on that interface to be there for others in this case.

Thanks for any the input and advice in advance.

3
  • What do you mean by "effect the hostname changes"?
    – jdthood
    Mar 19, 2013 at 9:32
  • Thanks for the info in your answer. etho in my question is a typo. In my /etc/network/interfaces file it is eth0 as I only changed dhcp to static on that line and then added the network addressing, etc. below. I had tried dns-nameserver at one point. I went ahead and made the dns-nameserver change and restarted but got the same error. I will take a better look at your advice against what I have already tried. To answer your question regarding hostname changes. More or less how I bind the servername to the static IP addressing. Thanks for all your help.
    – apesa
    Mar 19, 2013 at 14:05
  • Note that the option name is dns-nameservers, not dns-nameserver.
    – jdthood
    Mar 19, 2013 at 21:06

1 Answer 1

2
  1. The correct syntax for specifying nameserver addresses in /etc/network/interfaces is

    iface eth0 inet static
        ...
        dns-nameservers 1.1.1.1 2.2.2.2
    
  2. In your /etc/network/interfaces as quoted in your question you have named the interface etho rather than eth0.

  3. You can omit the network option in /etc/network/interfaces. It is no longer needed or used.

After editing /etc/network/interfaces do the following to activate the changes.

    sudo ifdown eth0
    sudo ifup eth0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .