10 окт. 2014 г.

on 1 comment

Setup IP-address in Linux

1. Change the ifcfg-eth1 file
Open the ifcfg-eth1 file by using the editor "VI"
[root@oracledb01 ~]# vi /etc/sysconfig/network-scripts/ifcfg-eth1


Add the following lines to ifcfg-eth0 file as below:
ONBOOT=yes
IPADDR=10.0.0.6 # type IP-address according to your needs
NETWORK=10.0.0.0
NETMASK=255.255.255.0
GETWAY=10.0.0.1

Save changes and exit from file:
:wq!
2. Update the HOSTS file
Open the hosts file file by using the editor "VI":
[root@oracledb01 ~]# vi /etc/hosts

Add the following lines to hosts file as below:127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
10.0.0.6    oracledb01 oracledb01.nik

Save changes and exit from file:
:wq!
3. Restart Network services
[root@oracledb01 ~]# /etc/init.d/network restart
4. Check the results
[root@oracledb01 ~]# ifconfig

                              ...
eth1      Link encap:Ethernet  HWaddr 08:00:27:39:A8:7F
          inet addr:10.0.0.6  Bcast:10.0.0.255  Mask:255.255.255.0
                              ...

[root@oracledb01 ~]# ping oracledb01

PING oracledb01 (10.0.0.6) 56(84) bytes of data.
64 bytes from oracledb01 (10.0.0.6): icmp_seq=1 ttl=64 time=0.024 ms
64 bytes from oracledb01 (10.0.0.6): icmp_seq=2 ttl=64 time=0.030 ms
64 bytes from oracledb01 (10.0.0.6): icmp_seq=3 ttl=64 time=0.034 ms
64 bytes from oracledb01 (10.0.0.6): icmp_seq=4 ttl=64 time=0.030 ms

1 комментарий:

Технологии Blogger.