TurnKey Linux Virtual Appliance Library

How do I manually configure a static IP address?

olddirt's picture

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 Davis'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 Davis'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.

Guest's picture

DHCP IN STATIC IP

How to Assign a permanent Ip address Through DHCP SERVER?

Jeremy Davis's picture

Depends on your DHCP server...

Each DHCP server will essentially do it differently but the general way they do it is read the MAC address and match that to an IP.
Guest's picture

ASSIGN STATIC IP IN DHCP

can you please explain the procedure about this

Jeremy Davis's picture

No because it depends on what your DHCP server is

And if you know what your DHCP server is then you can google it yourself, instead of me doing it for you! :)

And if you don't know what your DHCP server is then you probably need to do lots more reading and research or pay someone who can work it out for you...

Guest's picture

$. ./ .bashrc

what happens when we run $. ./.bashrc

Jeremy Davis's picture

The dot ('.') is essentially an alias for "source'

If you want to find out more about a Linux command try 'help', e.g.
$ help .
.: . filename [arguments]
    Execute commands from a file in the current shell.
    
    Read and execute commands from FILENAME in the current shell.  The
    entries in $PATH are used to find the directory containing FILENAME.
    If any ARGUMENTS are supplied, they become the positional parameters
    when FILENAME is executed.
    
    Exit Status:
    Returns the status of the last command executed in FILENAME; fails if
    FILENAME cannot be read.
So it basically runs ./.bashrc Your bashrc file does things like set global variables...

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)