Solved

Question regarding setting a static IP in Ubuntu Server 12.1

Posted on 2013-01-17
2
445 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
Comment Utility
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
Comment Utility
Thanks for the explaination.
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
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.

772 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now