Cấu hình dịch vụ DHCP on CentOS 5.2
Posted by admin, under DHCP Server(linux), SYSTEMSNội dung liên kết hay
Cấu hình DHCP ( Dynamic Host Configuration Protocol ) Server.
Chú ý: Nên tắt dịch vụ DHCP này của Router hay modem trước khi test.
[root@ns ~]#yum -y install dhcp
Hoặc down hẳn package này về:
[root@ns ~]# rpm -ivh dhcp-3.0.5-13.el5.rpm
[root@ns ~]#cp -f /usr/share/doc/dhcp-3.0.5/dhcpd.conf.sample /etc/dhcpd.conf
[root@ns ~]#vi /etc/dhcpd.conf
# line 4: Khai báo mạng và subnet
subnet 192.168.0.0 netmask 255.255.255.0
{
# line 7 : Khai báo IP default gateway
option routers 192.168.0.1;# line 8: subnetmask
option subnet-mask 255.255.255.0;# line 10: specify NIS domain name iy you using.
# make it comment if you don not use.option nis-domain “vietsystem.org”;
# line 11: specify domain name
option domain-name “vietsystem.org”;# line 12: Khai bái IP address của máy chủ DNS
option domain-name-servers 192.168.0.200;# line 14: make it comment
option time-offset -18000;# line 21: Khai báo dãy địa chỉ cấp phát cho Clients.
range dynamic-bootp 192.168.0.128 192.168.0.254;# line 22: default’s terms of lease
default-lease-time 21600;# line 23: maximun terms of lease
max-lease-time 43200;# line 26: make following 5 lines comment
# host ns {
# next-server marvin.redhat.com;
# hardware ethernet 12:34:56:78:AB:CD;
# fixed-address 207.175.42.254;
# }[root@ns ~]# /etc/init.d/dhcpd start
Starting dhcpd: [ OK ][root@ns ~]# chkconfig dhcpd on
Phía client cấu hình để nhận IP động.


Khi dhcpd chạy thì nó sẽ sinh ra 1 bản ghi trong file:
vi /var/lib/dhcpd/dhcpd.leases
lease 192.168.0.254 {
starts 2 2009/03/03 18:12:21;
ends 3 2009/03/04 00:12:21;
binding state active;
next binding state free;
hardware ethernet 00:14:85:44:5d:88;
uid “\001\000\024\205D]\210″;
client-hostname “vnc”;
}
The end!
Các bài viết gần đây nhất:
- Fundamentals of Windows Server 2008 Active Directory
- Giải pháp VPN cho công ty nhiều chi nhánh (Multi site to site vpn)
- Video VPN ISA cấu hình nhanh “client to site và site to site”
- Microsoft Windows Server 2008
- Windows Vista Training Package
- Windows Vista Training Videos – Video Tutorials
- Windows 2008 Server Security
- [Hot] Kho VIDEO học MCSA, MCSE, CCNA, CCNP, SECURITY
- How to install and config phpMyAdmin on CentOS 5.
- Bikini









