Solved

Question regarding setting a static IP in Ubuntu Server 12.1

Posted on 2013-01-17
2
451 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Is Your Team Achieving Their Full Potential?

74% of employees feel they are not achieving their full potential. With Linux Academy, not only will you strengthen your team's core competencies but also their knowledge of of the newest IT topics.

With new material every week, we'll make sure that you stay ahead of the game.

Question has a verified solution.

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

Fine Tune your automatic Updates for Ubuntu / Debian
In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
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…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

691 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