Tuesday, November 22, 2011

Introduction to System Service and DHCP

 Introduction to System Service:-


Every computer that connect to network require some IP address assign permanently to a computer host known as static IP address and some IP address leased by DHCP server for a limited period of time known as dynamic IP address.
There are 2 standard IP address
  1. IPv4
  2. IPv6
IPv4 has a 32 bit and are in Octet-doted decimal lists
Example: 192.168.254.254
IPv6 address have 120 bits

To check the connectivity
#ping 172.24.254.254
To check the IP address
#ifconfig
To set the IP address
#netconfig
Or
#vi /etc/sysconfig/network
Or
#vi /etc/sysconfig/network-scriptd/ifcfg-eth0
Device = eth0
Boot Proto = static
Onboot = yes
IPaddr = 172.24.0.2
Netmask = 255.255.0.0
Gateway = 172.24.254.254

To make Network UP and DOWN
#ifdown eth0
#ifup eth0
We can also assign temporary IP address to a LAN card. It will remain until we restart the computer then after that it will take IP address from ifcfg-eth0
#ifconfig eth0 172.24.0.10

Introduction To System Service
According to the service management, service are divided into three category
  1. service which are managed by init command, which are not TCP/IP services
  2. service which are managed by service command
  3. service which are based on xinetd that is some back ground process services
to check the service whether ON or OFF use
#service service_name status
#chkconfig –list
#chkconfig –list service_name

Example:
#service nfs status
#chkconfig –list
#chkconfig –list nfs

To Make service ON or OFF
#chkconfig nfs on
#chkconfig nfs off

To stop the particular service for particular Run level
#chkconfig –level 3 nfs off
#chkconfig –level 3 5 on/off
To make on or off in run level 3 and 5

#ntsysv : will start /stop all the services in a particular run level. It will display the dialog box in which all the services are mentioned

 DHCP Dynamic Host Configuration Protocol:
 
DHCP provides IP address to host computer dynamically by the range of addresses or statically or fixed address by MAC address

Service Profile
Type               :           System V managed Service
Package          :           dhcp
Daemon         :           dhcpd
Script              :           dhcpd
File                  :           /etc/dhcpd.conf
Port                 :           67,68



 
First check the rpm
#rpm –q dhcp
Copy and rename dhcpd.conf.sample to dhcpd.conf in /etc
#cp /usr/share/doc/dhcp-3.0.1/dhcpd.conf.sample /etc/dhcpd.conf
Now open file
#vi /etc/dhcpd.conf

Set the following configuration
Subnet             :           172.24.0.0;
Netmask         :           255.255.0.0;
Option router :           172.24.254.254;
Option subnet-mask : 255.255.0.0;
Option nis-domain : “RHCE”;
Option domain-name : “example.com”;
Option domain-name-server : 172.24.254.254;

Range dynamic-bootp 172.24.0.1 172.24.0.10
Save and exit
Start the service

#service dhcpd restart
#service portmap retstart

#chkconfig dhcpd on
#chkconfig portmap on

Client Side
#dhclient
Dhclient is used to give the request to dhcp server to assign an address to client
Now if we want to assign the static IP address by their MAC address

#vi /etv/dhcpd.conf
Set the following configuration

host stationX {
            hardware Ethernet 00:34:e3:5r:q1:34;
fixd-address 172.24.0.54;
where
x : Station number

 Thanks ,

No comments:

Post a Comment