Ask Your Question

Revision history [back]

Navigate to /etc/sysconfig/network-scripts/

[root@akshay ~]#cd /etc/sysconfig/network-scripts/

[root@akshay network-scripts]#vi ifcfg-eth0
    DEVICE=eth0
    TYPE=Ethernet
    ONBOOT=yes
    BOOTPROTO=none
    IPADDR=192.168.0.100
    NETMASK=255.255.255.0
    GATEWAY=192.168.0.1
    HWADDR=00:0F:xx:xx:xx:53
    USERCTL=no
    USERCTL=no

Restart your interface to apply the changes.

[root@akshay ~]#ifdown eth0
[root@akshay ~]#ifup eth0

To update your dns server settings, modify the /etc/resolv.conf.

[root@akshay ~]#vi /etc/resolv.conf

Replace the contents of the resolv.conf file with the parameters below. The first parameter “search” is your search path followed the nameserver parameters which hold the IPs for your primary and secondary DNS servers.

search example.com
nameserver 192.168.0.5
nameserver 192.168.0.6

Note: you can change parameters according to your requirement this is just an example of "How to configure static ip"