Bước 1: Cài đặt DHCP
# yum -y install dhcp
Bước 2: Sao chép tập tin cấu hình DHCP mẫu đến thư mục /etc
# cp -f /usr/share/doc/dhcp-3.0.5/dhcpd.conf.sample /etc/dhcpd.conf
Bước 3: Chỉnh sửa tập tin cấu hình DHCP
Mã:
|
ddns-update-style interim;
ignore client-updates;
# Scope 1
# Lop mang muon cap phat
subnet 192.168.2.0 netmask 255.255.255.0 {
# Dia chi cua default gateway can cap phat
option routers 192.168.2.114;
# Subnet mask
option subnet-mask 255.255.255.0;
# Ten NIS domain
option nis-domain "vinacis.local";
# Ten domain name
option domain-name "vinacis.local";
# Dia chi IP cua DNS server can cap phat
option domain-name-servers 192.168.2.114;
option time-offset -18000; # Eastern Standard Time
# option ntp-servers 192.168.1.1;
# option netbios-name-servers 192.168.1.1;
# --- Selects point-to-point node (default is hybrid). Don't change this unless
# -- you understand Netbios very well
# option netbios-node-type 2;
# Khoang IP se cap cho Client
range dynamic-bootp 192.168.2.128 192.168.2.254;
default-lease-time 21600;
max-lease-time 43200;
# Nhung may luon nhan IP co dinh
host duyendang {
hardware ethernet 08:00:20:15:5d:6f;
fixed-address 192.168.2.1;
}
host xinhxinh {
hardware ethernet 00:03:93:5e:6d:4w;
fixed-address 192.168.2.2;
option host-name "xinhxinh";
}
# Them dau comment vao cac dong ben duoi
# we want the nameserver to appear at a fixed address
#host ns {
# next-server marvin.redhat.com;
# hardware ethernet 12:34:56:78:AB:CD;
# fixed-address 207.175.42.254;
#}
} |
Bước 4: Khởi động dịch vụ DHCP
# /etc/rc.d/init.d/dhcpd start
Bước 5: Cấu hình để dịch vụ DHCP khởi động cùng với hệ điều hành
# chkconfig dhcpd on