db2

Configuring network on RedHat Enterprise Linux Server

Here is  a quick snippet of how to configure network for Red Hat Enterpise Linux for a server.

Here I am trying to configure eth0  to connect to the network.
First we need to ensure that network interface is turned on :

vi /etc/sysconfig/network-scripts/ifcfg-eth0

Find the line that says ONBOOT and ensure it says ONBOOT=yes   If its no then change it to yes…so it will come online when rebooted.

Now lets start the configuration.

Type setup

select network configuration

Screen Shot 2015-03-26 at 11.02.17 AM

 

 

 

 

 

 

 

select device configuration

Screen Shot 2015-03-26 at 11.02.26 AM

 

 

 

 

 

 

select eth0

Normally servers get static ip addresses and if thats the case then remove DHCP .
Fill in the gateway, net mask, DNS information

Screen Shot 2015-03-26 at 11.02.44 AM

 

 

 

 

 

 

Click OK and Save. Then select DNS Configuration . Type in all your DNS information there:

Screen Shot 2015-03-26 at 11.03.05 AM

 

 

 

 

 

 

Click Save and Save & Quit  and Quit.  This will exit the setup screen.
Now that we have configured the network, we got couple of more things to do.
Lets now setup the host files

type  vi /etc/hosts

add a line

<ipaddress>   <hostname>  <hostname.domainname>

eg:

192.1.50.1  redhat1   redhat1.techsatwork.com

Save this file.
Time to restart the network services

type  service network restart 

Ensure that all the services and network (eth0 in this case) started OK
Now lets see if the eth0 is all connected and a link is established

type ethtool eth0

and look for Link Detected : Yes

If you see Yes then that means you are now connected to the network.

Try pinging other servers on the network . Your server should now be connected to internet. One other thing you can optionally do is to stop the firewall. To do that:

type  service iptables save
type service iptables stop
type chkconfig iptables off

 

I hope this helps.  Please test these steps on a non-prod environment first.

**I do not guarantee or accept any consequences from these steps in any circumstances