set_stat_ip

Embed Size (px)

Citation preview

  • 8/8/2019 set_stat_ip

    1/6

    Help Desk Screeds

    tips, tricks, and hints for those distressed by computers

    Search

    Home

    About

    FAQ

    JMs Publications

    Reviews

    Comment policy

    Excerpts

    Disclaimer

    Recent Posts

    Install 2D Unity On Ubuntu 10.10 Maverick Meerkat In Virtualbox

    Wikipedia

    Windows to drop below 90% usage share?

    Whitesmoke Translator is actually a virus

    The iPad 2 in April?

    Pages

    About

    Comment policy

    Disclaimer

    Excerpts

    Prologue from Worlds to Conquer

    FAQ

    JMs Publications

    Reviews

    Categories

    administrata

    antique computers

    book reviews

    business of writing

    cars

    Disturbing Election Emails

    DOS

    foodgaming

    hardware

    history

    1/18/2011 Set A Static IP Address On Ubuntu 10.

    www.jonathanmoeller.com/screed/?p 1/6

  • 8/8/2019 set_stat_ip

    2/6

    interviews

    iPhone / iPod Touch

    Linux

    Linux Mint 10

    Linux Mint 9

    Mac OS X

    men and women the war that never ends

    moviesmusic

    my published works

    netbooks

    nonfiction

    other people talk about technology

    personal finance

    running

    Sword & Sorceress 22

    Sword & Sorceress 23television

    Ubuntu 10.04

    Ubuntu 10.10

    Ubuntu 11.04

    Uncategorized

    web design

    weird

    Windows

    writing

    Archives

    January 2011

    December 2010

    November 2010

    October 2010

    September 2010

    August 2010

    July 2010June 2010

    May 2010

    April 2010

    March 2010

    February 2010

    January 2010

    December 2009

    November 2009

    October 2009September 2009

    August 2009

    July 2009

    June 2009

    1/18/2011 Set A Static IP Address On Ubuntu 10.

    www.jonathanmoeller.com/screed/?p 2/6

  • 8/8/2019 set_stat_ip

    3/6

    May 2009

    April 2009

    March 2009

    February 2009

    January 2009

    December 2008

    November 2008

    October 2008September 2008

    August 2008

    July 2008

    June 2008

    May 2008

    April 2008

    March 2008

    February 2008

    January 2008December 2007

    November 2007

    October 2007

    September 2007

    August 2007

    July 2007

    June 2007

    April 2007

    March 2007

    February 2007

    January 2007

    Install Pidgin On Ubuntu 10.04 Maverick Meerkat

    Install Banshee Media Player On Ubuntu 10.10 Maverick Meerkat

    Set A Static IP Address On Ubuntu 10.10 Maverick Meerkat From The Command Line

    By Jonathan Moeller - Last updated: Friday, October 29, 2010 - Save & Share - 6 Comments

    It is not intuitively obvious how to assign Ubuntu 10.10 Maverick Meerkat a a static IP address from the

    command line. However, much of Linux administration involves the editing of text files, and assigning a static

    IP address is no different. Youll need to edit the following file:

    /etc/network/interfaces

    Initially, the file only contains information about your local loopback address:

    auto lo

    iface lo inet loopback

    To assign a static IP address, youll need to make some changes to this file.

    Lets say you want to assign a static IP of 192.168.1.2 to your eth0 network connection (the first Ethernet

    1/18/2011 Set A Static IP Address On Ubuntu 10.

    www.jonathanmoeller.com/screed/?p 3/6

  • 8/8/2019 set_stat_ip

    4/6

    adapter on your system; if you only have one, it will be eth0), with a subnet mask of 255.255.255.0 and a

    local gateway of 192.168.1.1. First, make a backup copy of the interfaces file:

    sudo cp /etc/network/interfaces ~

    This will make a backup copy in your home directory in case something goes amiss during the editing

    process. Next, fire up a text editor:

    sudo vi /etc/network/interfaces

    (Obviously you can substitue emacs or your editor of choice.)

    Once the file is open, add the following lines:

    auto eth0

    iface eth0 inet static

    address 192.168.1.2

    netmask 255.255.255.0

    gateway 192.168.1.1

    Once youve added these lines, save the interfaces file to disk, and exit your text editor. If you want to add a

    static DNS server, youll need to edit the /etc/resolv.conf file with this command:

    sudo vi /etc/resolv.conf

    To set a static DNS server with the address of 192.168.1.10, add this line to the file:

    nameserver 192.168.1.10

    Save the file, and exit your text editor.

    Youll then to need have your system load the new IP configuration. You can do that by rebooting, but if that

    takes too long, you can use these two commands to force Ubuntu to re-read the configuration files:

    sudo ifdown eth0

    sudo ifup eth0

    Your system will then have a static IP address.

    -JM

    Posted in Ubuntu 10.10 Top Of Page

    6 Responses to Set A Static IP Address On Ubuntu 10.10 Maverick Meerkat

    From The Command Line

    1/18/2011 Set A Static IP Address On Ubuntu 10.

    www.jonathanmoeller.com/screed/?p 4/6

  • 8/8/2019 set_stat_ip

    5/6

    Comment from wrightrl

    Time November 1, 2010 at 2:41 pm

    HELP!!! How do I restore my eth0 conncection? I tried your tutorial on how to static my ip address but it

    didnt work.

    Please help!!! I have a backup of it but dont know how to restore it.

    Sincerely,

    Wrightrl

    Comment from Jonathan Moeller

    Time November 1, 2010 at 9:19 pm

    Copy the backup over this file:

    /etc/network/interfaces

    And then use these commands to reset the eth0 interface:

    sudo ifdown eth0

    sudo ifup eth0

    Comment from .

    Time November 4, 2010 at 8:37 pm

    you forgot to add auto eth0

    should read

    auto eth0

    iface eth0 inet static

    address 192.168.1.2

    netmask 255.255.255.0

    gateway 192.168.1.1

    Comment from Jonathan Moeller

    Time November 4, 2010 at 8:59 pm

    1/18/2011 Set A Static IP Address On Ubuntu 10.

    www.jonathanmoeller.com/screed/?p 5/6

  • 8/8/2019 set_stat_ip

    6/6

    Whoops! Thanks for catching that.

    Comment fromjerry

    Time November 11, 2010 at 8:11 am

    How do i find the IP i am going to use to access the server from outside my network?

    Comment from Jeramy

    Time November 19, 2010 at 2:57 pm

    I am new to linux so it is possible that i did something wrong, but I tried this but got an error ifdown: interfaceeth0 not configured until I did a sudo /etc/init.d/networking restart (which I found in another document from a

    google search) then the ifdown and ifup worked fine.

    Write a comment

    Name (required)

    Mail (will not be published) (required)

    Website

    Copyright 2010 Help Desk Screeds

    Credits: Matteo Turchetto | Andreas Viklund

    1/18/2011 Set A Static IP Address On Ubuntu 10.

    www.jonathanmoeller.com/screed/?p 6/6