Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

DHCP and Name Resolution: 69-3 Nguyen Thi Nho, P9, Q.Tbinh, Tp. HCM

Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 14

Chapter 15

DHCP and Name


Resolution

SAIGONLAB 83 Nguyễn
69-3 ThịThi
Nguyen Nhỏ,Nho,
P9, Q.Tân Bình, Tp.Tp.
P9, Q.TBinh, HCMHCM LPI 102
Objectives

Install, configure a DHCP Server and Client


Identify and use command line options to
configure DHCP
Map Domain name to IP address using
/etc/nsswitch.conf and /etc/hosts
Identify three methods of DNS
configuration : /etc/hosts, NIS, BIND

SAIGONLAB 83 Nguyễn
69-3 ThịThi
Nguyen Nhỏ,Nho,
P9, Q.Tân Bình, Tp.Tp.
P9, Q.TBinh, HCMHCM LPI 102
DHCP

It stands for Dynamic Host Configuration


Protocol
It is extension of BOOTP (Bootstrap Protocol)
Provides permanent and temporary
addresses either automatically or manually
DHCP implements a “leasing” policy

SAIGONLAB 83 Nguyễn
69-3 ThịThi
Nguyen Nhỏ,Nho,
P9, Q.Tân Bình, Tp.Tp.
P9, Q.TBinh, HCMHCM LPI 102
Dynamic Host Configuration Protocol

Supports centrally located network


administration
Automates assignment of IP addresses
Reduces cost of managing networks
Provides a solution for the rapid depletion of
IP addresses

SAIGONLAB 83 Nguyễn
69-3 ThịThi
Nguyen Nhỏ,Nho,
P9, Q.Tân Bình, Tp.Tp.
P9, Q.TBinh, HCMHCM LPI 102
DHCP Client-Server

SAIGONLAB 83 Nguyễn
69-3 ThịThi
Nguyen Nhỏ,Nho,
P9, Q.Tân Bình, Tp.Tp.
P9, Q.TBinh, HCMHCM LPI 102
DHCP Client-Server

SAIGONLAB 83 Nguyễn
69-3 ThịThi
Nguyen Nhỏ,Nho,
P9, Q.Tân Bình, Tp.Tp.
P9, Q.TBinh, HCMHCM LPI 102
Setting up DHCP
For server :
 Install dhcp-2.0pl5-8.i386.rpm
Define /etc/dhcpd.conf
Run dhcpd daemon
For client :
Install dhcpcd-1.3.18pl8-13.i386.rpm
In /etc/sysconfig/network-scripts/, define (new)
ifcfg-eth0 file with following lines :
DEVICE=eth0
BOOTPROTO=dhcp
ONBOOT=yes
Or type # dhcpcd eth0

SAIGONLAB 83 Nguyễn
69-3 ThịThi
Nguyen Nhỏ,Nho,
P9, Q.Tân Bình, Tp.Tp.
P9, Q.TBinh, HCMHCM LPI 102
Configure DHCP Server

[root@localhost root]# more /etc/dhcpd.conf


server-identifier 172.16.1.228; # Or dhcp.example.org;
default-lease-time 259200; # 3 days
max-lease-time 604800; # 1 week
option subnet-mask 255.255.0.0;
option broadcast-address 172.16.255.255;
option domain-name-servers 172.16.1.228;
option lpr-servers 172.16.0.4;

SAIGONLAB 83 Nguyễn
69-3 ThịThi
Nguyen Nhỏ,Nho,
P9, Q.Tân Bình, Tp.Tp.
P9, Q.TBinh, HCMHCM LPI 102
Configure DHCP Server

# The MOST IMPORTANT


subnet 172.16.1.0 netmask 255.255.0.0 {
option routers 172.16.0.2;
option subnet-mask 255.255.0.0;
option domain-name-servers 172.16.1.228;
range 172.16.1.30 172.16.1.32;
default-lease-time 86400; # 1 days
max-lease-time 345600; # 4 days
}

SAIGONLAB 83 Nguyễn
69-3 ThịThi
Nguyen Nhỏ,Nho,
P9, Q.Tân Bình, Tp.Tp.
P9, Q.TBinh, HCMHCM LPI 102
Shared network in dhcpd.conf

{
option subnet-mask 255.255.255.0;
default-lease-time 21600;
max-lease-time 43200;
subnet 192.168.1.0 netmask 255.255.255.0 {
range 192.168.1.30 192.168.1.100;
option routers 192.168.0.1;
option domain-name-servers 192.168.1.1;
option broadcast-address 192.168.1.255
}

SAIGONLAB 83 Nguyễn
69-3 ThịThi
Nguyen Nhỏ,Nho,
P9, Q.Tân Bình, Tp.Tp.
P9, Q.TBinh, HCMHCM LPI 102
Shared network in dhcpd.conf

subnet 192.168.2.0 netmask 255.255.255.0 {


range 192.168.2.30 192.168.2.100;
option routers 192.168.0.2;
option domain-name-servers 192.168.2.1;
option broadcast-address 192.168.1.255
}}

SAIGONLAB 83 Nguyễn
69-3 ThịThi
Nguyen Nhỏ,Nho,
P9, Q.Tân Bình, Tp.Tp.
P9, Q.TBinh, HCMHCM LPI 102
BOOTP Section in dhcpd.conf

group{
use-host-names true;
host workstation1 {
hardware ethernet 00:E0:29:42:7C:56;
fixed-address 192.168.4.50;
}
host workstation2 {
hardware ethernet 00:30:19:42:7C:56;
fixed-address 192.168.4.51;
}}
SAIGONLAB 83 Nguyễn
69-3 ThịThi
Nguyen Nhỏ,Nho,
P9, Q.Tân Bình, Tp.Tp.
P9, Q.TBinh, HCMHCM LPI 102
DHCP Clients

There are 3 clients :


Dhcpcd
pump ( pump-xxx.rpm )
dhclient ( dhclient-xxx.rpm )

SAIGONLAB 83 Nguyễn
69-3 ThịThi
Nguyen Nhỏ,Nho,
P9, Q.Tân Bình, Tp.Tp.
P9, Q.TBinh, HCMHCM LPI 102
dhcpcd

It’s DHCP Client Daemon, requests


information from DHCP Server and stores in
the following files :
/etc/dhcpc/dhcpcd-<interface>.cache
/etc/dhcpc/dhcpcd-<interface>.info
/etc/resolv.conf
/var/run/dhcpcd-<interface>.pid
(See #man dhcpcd for more information)

SAIGONLAB 83 Nguyễn
69-3 ThịThi
Nguyen Nhỏ,Nho,
P9, Q.Tân Bình, Tp.Tp.
P9, Q.TBinh, HCMHCM LPI 102

You might also like