Set a static IP address on Linux Mint 13



It is not intuitively obvious how to assign Linux Mint 13 a static IP address to one of its network adapters (such as the network adapter in an Acer laptop or an HP desktop system) from the command line. However, much of Linux administration involves the editing of text files, and assigning a static IP address is no different. You’ll 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, you’ll need to make some changes to this file.

Let’s say you want to assign a static IP of 192.168.1.2 to your eth0 network connection (the first Ethernet 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:

iface eth0 inet static
address 192.168.1.2
netmask 255.255.255.0
gateway 192.168.1.1

Once you’ve added these lines, save the interfaces file to disk, and exit your text editor.

You’ll 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 this command to force Linux Mint to re-read the configuration files:

sudo ifup eth0

Your system will then have a static IP address.

-JM

This entry was posted in Linux Mint 13. Bookmark the permalink.

5 Responses to Set a static IP address on Linux Mint 13

  1. Pingback: Static IP & Port Forwarding on Debian linux

  2. DRetta says:

    This broke my systems ability to connect using eth0 entirely.

  3. Anonymous says:

    This procedure doesn’t seem to work. Other people on other forums attest to the fact this doesn’t work. See, for example:

    http://forums.linuxmint.com/viewtopic.php?f=150&t=102603&start=0

  4. steppenwolf says:

    Works perfectly on my bitnami-plone stack (virtual appliance) [http://bitnami.org/stack/plone] which is ubunbtu 12.04 brand, however to make the modifications active make a ‘sudo ifdown eth0′ before ‘sudo ifup eth0′.

  5. ajit says:

    GUI way is the easiest which is as follows:
    1. Right click wired network connection icon at the bottom right corner of the taskbar.
    2. Select ‘edit connections’ option.
    3. It wil show the ‘Network Connections’ GUI. It will also display the contents of the ‘Wired option’ which is selected when the Network Connections GUI is opened. ‘Wired Option ‘ will display the lan cards with names ‘wired connection 1′ and ‘wired connection’ depending upon the number of network cards in your PC.
    4. Select the wired connection which you want to make static and then select IPV4 settings.
    5. Add address as 192.168.1.25 netmask as 255.255.255.0 and gateway as 192.168.1.1.
    6. Check “require IPV4 addressing for this connection to complete”.
    7. Click “Routes”.
    8. Enter all the same parameters as mentioned in the point 5 above.
    9. Save the settings.
    10. Enter ifconfig command in the terminal and you can see your static IP.
    11 Is it not simple my dear??

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>