TurnKey Linux Virtual Appliance Library

How do I manually configure a static IP address?

The package loaded fine and worked well..  However, when the package loaded, there was no place to set a static IP address. The program used the next availible IP address from my DNS server.  How do you change the dynamic IP address to a static IP address.?

Alon Swartz's picture

Static IP Address

We are currently working on a configuration console to be included in the next release which will let you configure the network without having to log in and mess around with the command line.

In the meantime, you can log in with the default root password and configure you IP the old fashioned way:
joomla login: root
password: turnkey

ifconfig eth0 192.168.0.10 netmask 255.255.255.0 up

This sets the IP until reboot. If you want the IP configuration to be persistent, edit /etc/network/interfaces like this:
editor /etc/network/interfaces

    auto eth0
    iface eth0 inet static
        address 192.168.0.10
        netmask 255.255.255.0
For further details...
man interfaces

And here's everything you ever wanted to know about network configuration on Debian/Ubuntu but were afraid to ask:

http://www.debian.org/doc/manuals/reference/ch-gateway.en.html

Jeremy's picture

This is a really old post

Hi Lars, this is a really old post and all TKL appliances now have the confconsole (that Alon was talking about in is post above). So whilst all his info is still relevant and should still work, it is somewhat redundant (unless you want to learn how to do it the 'old school' way).

If you could update VM tools then you obviously have network conection. Or at least you did before you followed the steps above. My guess from your limited info is that 192.168.0.6 is not a good IP for you to use (it was given as an example - not as a strict suggestion).

Possibly the easiest way to fix this is to open the confconsole. If you are using the VM image then you may need to do that manually (I know it auto starts by default when installed from ISO but not sure about VM images). To manually start confconsole, at the command line (in TKL appliance), type:

/usr/bin/confconsole

then select to automatically set IP (using DHCP). This should give you a useable IP. Probably the safest thing to do is to set this automatically asigned IP as static. To do this you can follow the intructions above again (but using this new IP address rather than 192.168.0.6) or better still you can use the confconsole (seeing as you have it open already) , take note of the current (automatic/DHCP) IP displaye in confconsole and then manually set the IP to the same one it was asigned automatically.

Once you have done this, can you ping your appliance using the new IP?

Jeremy's picture

Ahh! That'd do it!

Sounds like I was barking up the wrong tree. Although the instructions I gave should also allow you to set a static IP while maintaining bridged networking. NAT can be very cool though if you wish to have all your TKL appliances available from the same IP.

Glad to hear you got it sorted.

Post new comment

The content of this field is kept private and will not be shown publicly. If you have a Gravatar account, used to display your avatar.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <p> <span> <div> <h1> <h2> <h3> <h4> <h5> <h6> <img> <map> <area> <hr> <br> <br /> <ul> <ol> <li> <dl> <dt> <dd> <table> <tr> <td> <em> <b> <u> <i> <strong> <font> <del> <ins> <sub> <sup> <quote> <blockquote> <pre> <address> <code> <cite> <strike> <caption>

More information about formatting options

Leave this field empty. It's part of a security mechanism.
(Dear spammers: moderators are notified of all new posts. Spam is deleted immediately)