?
Solved

Question regarding setting a static IP in Ubuntu Server 12.1

Posted on 2013-01-17
2
Medium Priority
?
452 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 2000 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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

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

How many times have you wanted to quickly do the same thing to a list but found yourself typing it again and again? I first figured out a small time saver with the up arrow to recall the last command but that can only get you so far if you have a bi…
If you have a server on collocation with the super-fast CPU, that doesn't mean that you get it running at full power. Here is a preamble. When doing inventory of Linux servers, that I'm administering, I've found that some of them are running on l…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
Suggested Courses
Course of the Month13 days, 4 hours left to enroll

777 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