Solved

Question regarding setting a static IP in Ubuntu Server 12.1

Posted on 2013-01-17
2
447 Views
Last Modified: 2013-01-18
Hello Linux Gurus,
I have decided to teach myself to use Linux.  I purchased the book “The Ubuntu Beginner’s Guide” and have started reading and working through the examples put forth in the text.  I have just installed Ubuntu server 12.1.  I have configured a static IP on that server.  I did this using the following steps:
1.  Open the interfaces file using the following command:  sudo vi /etc/network/interfaces
2.  I changed/added the following to the file (using vi):
            Iface eth0 inet static
            address 10.0.0.5
            netmask 255.255.255.0
            broadcast 10.0.0.255
            gateway 10.0.0.1
3.  I saved the changes and quit vi.
4.  At the command prompt I typed the following command to have the OS re-read the         config file:  sudo ifup eth0
5.  After running the command above, I receive a message that states interface eth0 is already configured.
6.  When I run ifconfig, I see the IP settings that were pulled from DHCP.
7.  If I run the following command my changes to the interfaces file are reflected when I run ifconfig:
sudo /etc/init.d/networking restart

My question is why didn’t the sudo ifup eth0 force Linux to re-read the config file?

Thanks in advance for your help.

Nick
0
Comment
Question by:ndalmolin_13
2 Comments
 
LVL 11

Accepted Solution

by:
techhealth earned 500 total points
ID: 38790308
If your eth0 is already up, doing ifup on it does nothing - it doesn't refresh settings.  You can do ifdown first, but networking restart does it nicer anyways.
0
 
LVL 1

Author Closing Comment

by:ndalmolin_13
ID: 38792893
Thanks for the explaination.
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Best way to virtualise a remote Linux server 2 66
How to make a Bash alias that takes parameters 5 53
AWS ELB 5 75
how to configure linux OS using Ubuntu 7 36
Network Interface Card (NIC) bonding, also known as link aggregation, NIC teaming and trunking, is an important concept to understand and implement in any environment where high availability is of concern. Using this feature, a server administrator …
The purpose of this article is to demonstrate how we can use conditional statements using Python.
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

785 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question