Setting Static IP Address on LINUX

Be Sociable, Share!

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.

Be Sociable, Share!
This entry was posted in Tutorials and tagged , , , , , , , , , , , , , , . Bookmark the permalink. Both comments and trackbacks are currently closed.
  • Support sabrinasabino.com!

No Comments

(Required)
(Required, will not be published)

  • Stalk Me On Facebook

  • Categories

More in Tutorials (62 of 84 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 ...