Log In Registration

Setting Static IP Address on LINUX

  • Sharebar

At some point in your life, you may find it a need to manually assign an IP address to your computer. What if it’s LINUX? You’d better have an idea of what you’re going to do or shame on you. Assuming, you only know the basic commands on a Linux system, here’s a quick how-to to help you out.
Here’s how to do it and you should be logged in as a root user. Type the following on your CLI (Command Line Interface)

ifconfig eth0 192.168.100.1 netmask 255.255.0.0 up

ifconfig – declares the command.

eth0 – is the interface card. This depends on how many interfaces you have and which interface you are using.

192.168.100.1 – the IP address we are trying to assign statically. You can change it, of course.

netmask – option for a subnet mask.

255.255.0.0 – the subnet mask. You can change this too.

up – the state of the interface after the command execution

Here’s another way. Make changes on the actual interface configuration. Type the following command to open the interface card configuration.

vi /etc/sysconfig/network-scripts/ifcfg-eth0

This is what you should see after entering the command above:

#
DEVICE=eth0
HWADDR=00:8A:63:D7:54:C3
ONBOOT=yes
IPADDR=172.20.60.244
NETMASK=255.255.0.0
GATEWAY=172.20.1.1
DNS1=4.2.2.2
DNS2=4.2.2.1
BOOTPROTO=none
USERCTL=no

Change the IPADDR, NETMASK and GATEWAY. Save it and restart the network services by typing:

service network restart

That’s it! You’re good to go.

Related posts:

  1. Dynadot’s New Face
  2. How To Get An @MSN.Com Email Address
  3. Is Android Compatible with Linux?
  4. Setting Off On CatCocos Ferry
This entry was posted in Tutorials and tagged , , , , , , , , , , , , , , . Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.
  • Support sabrinasabino.com!

No Comments

(Required)
(Required, will not be published)

CommentLuv badge

  • RSS Featured Software

  • Categories

  • Archives

  • About Me

    WYSIWYG! I'm a simple person trying to live the simplest life possible - it seems to be the most difficult thing to achieve! I'm an internet enthusiast and I've been a webmaster since early 2007. I like: blogging, developing sites using open source software, social media, computer games, '80s music, comedy & horror, animals, crunching on M&Ms peanut and Smarties!
More in Tutorials (56 of 78 articles)


The sure-fire way of knowing whether or not someone has blocked and deleted you on Facebook is to find out manually, as opposed to using invasive web tools.  If someone ...