Setting up Network (Red Hat based System)

Segment 1
The easiest way to setup network is by using the following commands-
# setup > network settings

Used for setting up network parameters
# system-config-network

Used for setting up network parameters
# service network restart
Restarts the network service
# ifconfig
Check the network parameters

Network related files


This directory contains a single file for each network adapter named ifcfg-eth0, ifcfg-eth1, ifcfg-eth2 and so on. The contents of the file are:
NAME= eth0
name of the device
Device id
BOOTPRO= none/static/dhcp
none/static are used for static IP address. dhcp is used for automatic IP address.
4 bit IP address
Netmask of the provided IP address
IP address of the gateway server/router
USERCTL= yes/no
Whether normal users are able to change IP address


DNS IP is set in this file. Keep in mind that the there are some International free DNS that can be used such as,,
nameserver X.X.X.X


This file is primarily used to set hostname.


This file is used in case the hostname has to be resolved locally. The following line should be added-


When troubleshooting any network, the following commands can be used.
# mii-tool
Note that there is no space in the command. Used for checking whether the cable is connected to the Network Interface Card.
# ping X.X.X.X
If physical connection is okay, you should get a reply with information like latency and TTL.
# traceroute X.X.X.X
Used for tracing the path to a specific IP or domain.
Segment 2

Virtual Interfaces

Each NIC card in Linux can be used to create virtual interfaces which contain separate IP addresses. As a result, one can use a single LAN card to create multiple virtual LAN cards with specific IP address.


1.     Create a copy of the LAN card configuration file and make changes as necessary. The following example contains minimum configuration-
# cd /etc/sysconfig/network-scripts/
# cp ifcfg-eth0  ifcfg-eth0:1
# vim ifcfg-eth0:1
      IPADDR= Y.Y.Y.Y
      SUBNET= Y.Y.Y.Y
2.  # service network restart

Check whether you can find the IP address of the virtual interface with ifconfig. If you’re successful, try pinging the IP address from local, as well as remote machines.