Solved

Question regarding setting a static IP in Ubuntu Server 12.1

Posted on 2013-01-17
2
448 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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
curl SSL certificate unable to get local issuer certificate 15 102
How to enable sync between two yum repo? 1 39
ignore other .htaccess 2 58
Intel fortran compiler (ifort) 5 38
I am a long time windows user and for me it is normal to have spaces in directory and file names. Changing to Linux I found myself frustrated when I moved my windows data over to my new Linux computer. The problem occurs when at the command line.…
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…
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…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

839 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