How to set IP in Linux Machine

Add the following Lines to ifcfg-eth0 file as below.

[root@db ~]#vi /etc/sysconfig/network-scripts/ifcfg-eth0
[root@db ~]#

update the host file as well

[root@db ~]# vi /etc/hosts localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 db
[root@db ~]#

Restart Network services

[root@db ~]# service network restart
Shutting down interface eth0: [ OK ]
Shutting down loopback interface: [ OK ]
Bringing up loopback interface: [ OK ]
Bringing up interface eth0: [ OK ]
[root@db ~]#

Test it

[root@db ~]# ping db
PING db ( 56(84) bytes of data.
64 bytes from db ( icmp_seq=1 ttl=64 time=0.371 ms
64 bytes from db ( icmp_seq=2 ttl=64 time=2.27 ms

About Sher khan

Senior Oracle DBA, Oracle 10g , Oracle 11g OCE ,Oracle 12C and Oracle 11g OPN certified Specialist, OCP Certified in Oracle 9i,10g , 11g and 12C. I am working in Oracle technology since 2004. Currently working in U.A.E Email:
This entry was posted in Linux commands for DBA. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s