Configure an IP Address

  1. Modify the /etc/sysconfig/network-scripts/ifcfgeth0 file and provide a static IP address as a root user in Redhat.
    It should be displayed as follows:
    • DEVICE=eth0
    • BOOTPROTO=STATIC
    • IPADDR=192.168.0.5
    • NETMASK=255.255.255.0
    • GATEWAY=192.168.0.1
    • ONBOOT=yes
  2. After saving the file, execute the following commands to restart the network daemon:
    $ /etc/init.d/network stop
    $ /etc/init.d/network start
    This will provide the IP address to the eth0 interface and also, the ifconfig command will list eth0.