host network config linux

Upload: ravi-kumar-lanke

Post on 03-Apr-2018

234 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/28/2019 Host Network Config Linux

    1/26

    PREPARED BY RAVI KUMAR LANKE Page 1

    SERVER DETAILS

    NAME : bias20

    OS : OEL 5.4

    ip address: 172.16.12.222

    port no: 5906

    To find the host name of the current linux machine

    #hostname

    output: bias.chserver1.com

    bias : is our computer name or host name

    chserver1 : is our dns domain name

    bias.chserver1.com : computer name with fully qualified domain name

  • 7/28/2019 Host Network Config Linux

    2/26

    PREPARED BY RAVI KUMAR LANKE Page 2

    To see the domain part of the dns domain name

    #dnsdomainname

    output: chserver1.com

  • 7/28/2019 Host Network Config Linux

    3/26

    PREPARED BY RAVI KUMAR LANKE Page 3

    To change the host name of the current linux machine the syntax is

    #hostname newhostname.dnsdomain name

    #hostname biashyd.chserver1.com

    output: biashyd.chserver1.com

    the old host name is changed to new host name we mentioned i.e biashyd.chserver1.com

  • 7/28/2019 Host Network Config Linux

    4/26

    PREPARED BY RAVI KUMAR LANKE Page 4

    NETWORK CONFIGURATION:

    After changing the host name we have to modify the old host name with new host name in host files

    /etc/sysconfig/network and /etc/hosts

    /etc/sysconfig/network :-

    The "/etc/sysconfig/network" file holds top-level networking configuration

    This includes the host name and gateway settings

    #cat /etc/sysconfig/network

  • 7/28/2019 Host Network Config Linux

    5/26

    PREPARED BY RAVI KUMAR LANKE Page 5

    To modify the host name in the network configuration file

    #vi /etc/sysconfig/network

  • 7/28/2019 Host Network Config Linux

    6/26

    PREPARED BY RAVI KUMAR LANKE Page 6

    In the configuration file change the host name with new host name

  • 7/28/2019 Host Network Config Linux

    7/26

    PREPARED BY RAVI KUMAR LANKE Page 7

    save the file and exit

    now run the command below to check whether the file is modified or not

    #cat /etc/sysconfig/network

  • 7/28/2019 Host Network Config Linux

    8/26

    PREPARED BY RAVI KUMAR LANKE Page 8

  • 7/28/2019 Host Network Config Linux

    9/26

    PREPARED BY RAVI KUMAR LANKE Page 9

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

    This file holds the network configuration for the "eth0" adapter

    If we have multiple network adapters, we would expect additional configuration files eth1, eth2 etc.

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

    This shows the type of network adapter, device info , mac address and type of ip provided whether

    dynamic or static

  • 7/28/2019 Host Network Config Linux

    10/26

    PREPARED BY RAVI KUMAR LANKE Page 10

    /etc/hosts :-

    This file contains the information for local name resolution

    #cat /etc/hosts

  • 7/28/2019 Host Network Config Linux

    11/26

    PREPARED BY RAVI KUMAR LANKE Page 11

    /etc/resolv.conf : -

    This file is used to configure the location of the DNS servers to be used for name resolution.

    There can be multiple "nameserver" lines, one for each nameserver

    #cat /etc/resolv.conf

  • 7/28/2019 Host Network Config Linux

    12/26

    PREPARED BY RAVI KUMAR LANKE Page 12

    /etc/sysconfig/network-scripts :-

    This directory contains a number of network related scripts and commands

    #ls /etc/sysconfig/network-scripts

  • 7/28/2019 Host Network Config Linux

    13/26

    PREPARED BY RAVI KUMAR LANKE Page 13

    The ifdown and ifup commands are used to stop and start the specified network adapters

    #ifdown eth0 : stops the network adapter eth0

    #ifup eth0 : starts the network adapter eth0

  • 7/28/2019 Host Network Config Linux

    14/26

    PREPARED BY RAVI KUMAR LANKE Page 14

    ifconfig :-

    This is the command used to display the current network settings

  • 7/28/2019 Host Network Config Linux

    15/26

    PREPARED BY RAVI KUMAR LANKE Page 15

    system-config-network-tuiand system-config-network : -

    The system-config-network-tuiand system-config-networkcommands start a text-based

    network configuration tool

    After entering this command a text based screen will appear

  • 7/28/2019 Host Network Config Linux

    16/26

    PREPARED BY RAVI KUMAR LANKE Page 16

    select edit devices and press enter

  • 7/28/2019 Host Network Config Linux

    17/26

    PREPARED BY RAVI KUMAR LANKE Page 17

    select the network adapter uyou have and select save

  • 7/28/2019 Host Network Config Linux

    18/26

    PREPARED BY RAVI KUMAR LANKE Page 18

    select edit dns configuration and press enter

  • 7/28/2019 Host Network Config Linux

    19/26

    PREPARED BY RAVI KUMAR LANKE Page 19

    provide host name, primary dns, secondary dns, tertiary dns and press ok

  • 7/28/2019 Host Network Config Linux

    20/26

    PREPARED BY RAVI KUMAR LANKE Page 20

    press save and exit to finish the network configuration

  • 7/28/2019 Host Network Config Linux

    21/26

    PREPARED BY RAVI KUMAR LANKE Page 21

    configuring network connections using gui

    Go to systems -> preferences -> more preferences -> network connections

  • 7/28/2019 Host Network Config Linux

    22/26

    PREPARED BY RAVI KUMAR LANKE Page 22

    Highlight the device and click the "Edit" button to view or alter the configuration of a device

    if you want to edit , edit the ip address, netmask, gateway, and then click apply and click ok

  • 7/28/2019 Host Network Config Linux

    23/26

    PREPARED BY RAVI KUMAR LANKE Page 23

    neat :-

    this command is used to config the network very easily

    #neat

    select the network adapter and press edit to modify

  • 7/28/2019 Host Network Config Linux

    24/26

    PREPARED BY RAVI KUMAR LANKE Page 24

    here we can give the ip address

    if we want to give static ip select statically set ip addresses otherwise select dhcp and then press ok

  • 7/28/2019 Host Network Config Linux

    25/26

    PREPARED BY RAVI KUMAR LANKE Page 25

    To give dns server addresses select dns

    provide necessary information and then click ok

    save the configuration and close

  • 7/28/2019 Host Network Config Linux

    26/26

    goto terninal and restart the network