KEMBAR78
Linux Network Configuration Guide | PDF | Communications Protocols | Network Protocols
0% found this document useful (0 votes)
62 views7 pages

Linux Network Configuration Guide

This document provides instructions for setting the IP address, hostname, and host entry for a server. It involves: 1) Using netconfig to set the IP address. 2) Editing /etc/hosts to add an entry mapping the IP address to the hostname. 3) Editing /etc/sysconfig/network to set the hostname. 4) Restarting the network for changes to take effect.

Uploaded by

sdebb srg
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
62 views7 pages

Linux Network Configuration Guide

This document provides instructions for setting the IP address, hostname, and host entry for a server. It involves: 1) Using netconfig to set the IP address. 2) Editing /etc/hosts to add an entry mapping the IP address to the hostname. 3) Editing /etc/sysconfig/network to set the hostname. 4) Restarting the network for changes to take effect.

Uploaded by

sdebb srg
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

HOSTNAME AND IP SETTING

1. Setting IP Address

2. Making host entry

3. Changing the Host name.

Note: Lines in pink color represent the commands to be entered by user

Lines in blue color represent the comment lines to understand.

Lines in black color represent the system generated lines.


STEP 1: SETTING IP ADRESS

<Login as super user;>

[root@EMS-1 ~]#netconfig

<Above command will open one ip configuration window. Like below>

Press return(enter) button to enter the ip address. It will open another window like
below;

2
Press tab key to move cursor to IP address field and enter the IP address like below

3
Using tab key fill the required information, keep the correct default gateway IP if
required or you can delete it and primary DNS server IP.

Move cursor to “OK” button using tab key and press return (enter) key. It will take you
to the command prompt again.

[root@EMS-1 ~]#

STEP 2: MAKING HOST ENTRY

[root@EMS-1 ~]#vi /etc/hosts

<it will open one vi editor which shows like below>

Press i button and move cursor to end of line 127.0.0.1 localhost.localdomain


localhost and press return (enter) key. Bottom of above line, add the following
entry:

Type IP address (ex: 192.168.21.52) and press tab button and type Hostname (ex EMS)

<Now it should look like below>

4
Now press Esc key and type :wq! to save the file. It will take you to command prompt
again.

[root@EMS-1 ~]#

STEP 3: CHANGING THE HOSTNAME

[root@EMS-1 ~]# vi /etc/sysconfig/network

<It will open vi editor which looks like below>

5
<here you need to delete localhost.localdomain and have to give EMS( same name
mentioned in “/etc/hosts” inplace of it.. to do this,>

Press i button, move cursor to end of line HOSTNAME=localhost.localdomain and


delete “localhost.localdomain” in place of that type EMS. Now it look like

6
<Now to save this file, >

Press Esc button and type :wq! And press return (enter) key.

<Now to reflect whole things do the following>

[root@EMS-1 ~]#service network restart

Shutting down interface eth0: [ OK ]

Shutting down loopback interface: [ OK ]

Setting network parameters: [ OK ]

Bringing up loopback interface: [ OK ]

Bringing up interface eth0: [ OK ]

[root@EMS ~]#

< Now to confirm whether hostname and ip setting are proper, do the following>

[root@EMS ~]#hostname

<it should show you here the name you given in /etc/sysconfig/network.>

[root@EMS ~]#hostname -i

<it should show you here the server IP.>

< If above both are showing properly, hostname and ip settings are done>

Document made by:

Lakshmaiah.G

09886401921

mailto:lakshmaiah@india.tejasnetworks.com

You might also like