Thursday, July 3, 2014

Configure/change IP in CentOS/Linux

From command line run following command:

ifconfig
e.g. ifconfig 10.10.10.10 eth0

This will immediately assign the IP to the system. But this will be removed after reboot.

To make it permanent, edit below file:

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


DEVICE=eth0
BOOTPROTO=static
DHCPCLASS=yes
IPADDR=10.10.10.10
NETMASK=255.255.255.0
ONBOOT=yes
.....

Now define gateway in file:

/etc/sysconfig/network

NETWORKING=yes
HOSTNAME=manutablet
GATEWAY=192.168.1.254
 ..

Once these are defined, restart network services:
service network restart

Note: Do not stop/start service. Only restart it otherwise after stop you will lose your connection and you will need to go to the server and start the services from console.

7 comments:

Anonymous said...

It's very trouble-free to find out any matter on net as compared
to books, as I found this post at this site.

Also visit my site ... Dragon City Gold Hack

Anonymous said...

Theyy key to dissipating that belief is an understanding of
the inner workings of assksted living centers and wwhy they can help
seniors and families alike. A houhse goes through several problems
like leakagye of attic, mildew growth, blistering of
paint, cracked shingles, and decay of siding that needs tto be
spotted oon time and remodeled so that it become safe for living.
If you ever work with an Oxford architecture company then it is worth asking
to see their certificates and make sure they are legitimate.


Stop by my blog; Cincinnati Roofing Pros

Anonymous said...

Thanks for your personal marvelous posting! I seriously enjoyed reading it, you are
a great author. I will be sure to bookmark your blog and will come back at some point.
I want to encourage you to ultimately continue your great
job, have a nice day!

Also visit my web site - clear pores

Anonymous said...

My developer is trying to convince me to move to .net from PHP.

I have always disliked the idea because of the costs. But he's tryiong none the less.
I've been using Movable-type on various websites for about a year
and am nervous about switching to another platform. I have heard
good things about blogengine.net. Is there a way I can import
all my wordpress posts into it? Any kind of help would be greatly
appreciated!

My site - points fifa 14 gratuit

Anonymous said...

Howdy! This blog post could not be written much better! Reading through this article reminds me of my previous roommate!
He always kept talking about this. I most certainly will forward this post to him.
Fairly certain he'll have a good read. I appreciate
you for sharing!

Also visit my page theme vs studiopress

Unknown said...

It was very nice article and it is very useful to Linux learners.We also provide Linux online training

Unknown said...

It was so nice article.i was really satisfied by seeing this article it is very useful for Linux learners and we are also provides linux online training for more info click here

 

Blogger news

Blogroll