Installing and Configuring DHCP Server (DHCPd) on FreeBSD Cài đặt và cấu hình DHCP Server (dhcpd) trên FreeBSD

DHCP, the Dynamic Host Configuration Protocol, describes the means by which a system can connect to a network and obtain the necessary information for communication upon that network. DHCP, Dynamic Host Configuration Protocol, mô tả các phương tiện mà một hệ thống có thể kết nối đến mạng và có được những thông tin cần thiết cho việc giao tiếp theo mạng lưới đó.

When dhclient, the DHCP client, is executed on the client machine, it begins broadcasting requests for configuration information. Khi dhclient, DHCP client, được thực thi trên máy khách hàng, nó bắt đầu phát sóng yêu cầu thông tin cấu hình. By default, these requests are on UDP port 68. Theo mặc định, những yêu cầu này đang trên UDP cổng 68. The server replies on UDP 67, giving the client an IP address and other relevant network information such as netmask, router, and DNS servers. Máy chủ trả lời ngày 67 UDP, tạo cho khách hàng một địa chỉ IP và mạng thông tin khác có liên quan như: mặt nạ mạng, bộ định tuyến, và các máy chủ DNS. All of this information comes in the form of a DHCP ?lease? Tất cả các thông tin này có trong các hình thức hợp đồng thuê nhà DHCP?? and is only valid for a certain time (configured by the DHCP server maintainer). và chỉ có giá trị trong một thời gian nhất định (cấu hình bởi các nhà duy trì máy chủ DHCP). In this manner, stale IP addresses for clients no longer connected to the network can be automatically reclaimed. Theo cách này, cu địa chỉ IP cho các khách hàng không còn kết nối vào mạng có thể tự động khai hoang.

DHCP Server (or DHCPd) is the server that provides the DHCP client the information it needed, and it's the server portion of the suite is not provided as part of FreeBSD, and so it needs to install from the net/isc-dhcp3-server port to provide this service. DHCP Server (hoặc dhcpd) là các máy chủ cung cấp cho khách hàng những thông tin DHCP nó cần thiết, và đó là phần máy chủ của bộ không được cung cấp như một phần của FreeBSD, và do đó, nó cần phải cài đặt từ các net/isc-dhcp3-server cổng để cung cấp dịch vụ này.

FreeBSD comes with ISC DHCP, and it comes with FreeBSD as ports net/isc-dhcp3-server. FreeBSD đi kèm với ISC DHCP, và nó đi kèm với FreeBSD như là cổng net/isc-dhcp3-server.

To install it, change to ports net/isc-dhcp3-server directory and execute the following command: Để cài đặt nó, để thay đổi cổng net/isc-dhcp3-server thư mục và thực hiện lệnh sau:

# make install clean # Thực hiện cài đặt sạch

DHCPd is configured by using a configuration file, normally dhcpd.conf located at /usr/local/etc directory. Dhcpd được cấu hình bằng cách sử dụng một tập tin cấu hình, thường dhcpd.conf vị trí thư mục / usr / local / etc thư mục. Normally there is an example configuration file which is dhcpd.conf.example at the directory. Thông thường có một cấu hình ví dụ tập tin đó là dhcpd.conf.example ở thư mục. Copy dhcpd.conf.example to dhcpd.conf or create a new dhcpd.conf before proceeding to make changes on DHCP Server. Copy dhcpd.conf.example để dhcpd.conf hoặc tạo một dhcpd.conf mới trước khi tiến hành thay đổi trên DHCP Server.

dhcpd.conf is comprised of declarations regarding subnets and hosts, and is perhaps most easily explained using an example : dhcpd.conf bao gồm tờ khai liên quan đến các mạng con và máy chủ, và có lẽ là dễ dàng nhất giải thích cách sử dụng một ví dụ:

option domain-name “example.com”; (1) option domain-name "example.com"; (1)
option domain-name-servers 192.168.4.100; (2) option domain-name-servers 192.168.4.100; (2)
option subnet-mask 255.255.255.0; (3) option subnet-mask 255.255.255.0; (3)

default-lease-time 3600; (4) default-lease-time 3.600; (4)
max-lease-time 86400; (5) max-lease-time 86400; (5)
ddns-update-style none; (6) ddns-update-style none; (6)

subnet 192.168.4.0 netmask 255.255.255.0 { subnet 192.168.4.0 netmask 255.255.255.0 (
range 192.168.4.129 192.168.4.254; (7) phạm vi 192.168.4.129 192.168.4.254; (7)
option routers 192.168.4.1; (8) option routers 192.168.4.1; (8)
} )

host mailhost { chủ mailhost (
hardware ethernet 02:03:04:05:06:07; (9) hardware ethernet 02:03:04:05:06:07; (9)
fixed-address mailhost.example.com; (10) cố định địa chỉ mailhost.example.com; (10)
} )

(1) This option specifies the domain that will be provided to clients as the default search domain. (1) Tùy chọn này chỉ qui định những tên miền mà sẽ được cung cấp cho khách hàng là các tên miền tìm kiếm mặc định.
(2) This option specifies a comma separated list of DNS servers that the client should use. (2) tùy chọn này xác định bằng dấu phẩy tách ra một danh sách các máy chủ DNS cho các khách hàng nên sử dụng.
(3) The netmask that will be provided to clients. (3) Các mặt nạ mạng sẽ được cung cấp cho khách hàng.
(4) A client may request a specific length of time that a lease will be valid. (4) Một khách hàng có thể yêu cầu một chiều dài thời gian cụ thể mà một thuê sẽ được hợp lệ. Otherwise the server will assign a lease with this expiry value (in seconds). Nếu không thì máy chủ sẽ chỉ định cho thuê với giá trị này hết hạn (trong giây).
(5) This is the maximum length of time that the server will lease for. (5) Đây là chiều dài tối đa thời gian mà các máy chủ sẽ cho thuê. Should a client request a longer lease, a lease will be issued, although it will only be valid for max-lease-time seconds. Nên một yêu cầu khách hàng một hợp đồng thuê lâu hơn, cho thuê sẽ được ban hành, mặc dù nó sẽ chỉ có giá trị max-lease-time giây.
(6) This option specifies whether the DHCP server should attempt to update DNS when a lease is accepted or released. (6) Lựa chọn này xác định xem máy chủ DHCP nên cố gắng để cập nhật DNS khi thuê một được chấp nhận hoặc phát hành. In the ISC implementation, this option is required. Trong việc thực hiện ISC, tùy chọn này được yêu cầu.
(7) This denotes which IP addresses should be used in the pool reserved for allocating to clients. (7) này là bắt được địa chỉ IP cần được sử dụng trong hồ bơi dành riêng cho phân bổ cho các khách hàng. IP addresses between, and including, the ones stated are handed out to clients. Giữa các địa chỉ IP, và bao gồm, những người đã nêu được trao cho các khách hàng.
(8) Declares the default gateway that will be provided to clients. (8) Declares cổng mặc định sẽ được cung cấp cho khách hàng.
(9) The hardware MAC address of a host (so that the DHCP server can recognize a host when it makes a request). (9) Các phần cứng địa chỉ MAC của một host (để các máy chủ DHCP có thể nhận ra một máy chủ khi nó làm cho một yêu cầu).
(10) Specifies that the host should always be given the same IP address. (10) Xác định rằng các máy chủ phải luôn luôn được cung cấp địa chỉ IP giống nhau. Note that using a hostname is correct here, since the DHCP server will resolve the hostname itself before returning the lease information. Lưu ý rằng cách sử dụng một tên máy là chính xác ở đây, kể từ máy chủ DHCP sẽ giải quyết được tên máy chính nó trước khi trở lại các thông tin thuê.

Once you have finished writing your dhcpd.conf, you can proceed to start the server by issuing the following command: Một khi bạn đã hoàn tất văn bản dhcpd.conf của bạn, bạn có thể tiến hành để bắt đầu máy chủ bằng cách ban hành lệnh sau:

# /usr/local/etc/rc.d/isc-dhcpd.sh start # / Usr / local / etc / rc.d / ISC-dhcpd.sh bắt đầu

Should you need to make changes to the configuration of your server in the future, it is important to note that sending a SIGHUP signal to dhcpd does not result in the configuration being reloaded, as it does with most daemons. Nếu bạn cần thay đổi cấu hình của máy chủ của bạn trong tương lai, điều quan trọng cần lưu ý rằng việc gửi một tín hiệu SIGHUP để dhcpd không kết quả trong cấu hình được nạp lại, giống như với hầu hết các daemon. A SIGTERM signal to stop the process, and then restart it using the command above. Một tín hiệu SIGTERM để dừng quá trình, và sau đó khởi động lại nó bằng lệnh trên. For example: Ví dụ:

# ps wax | grep dhcpd # Ps sáp | grep dhcpd
pid of dhcpd will be shown pid của trình nền dhcpd sẽ được hiển thị

# kill -15 (pid of dhcpd) # Giết -15 (pid của trình nền dhcpd)

IMPORTANT : The page is machine translated and provided "as is" without warranty. Quan trọng: Sửa là máy dịch và cung cấp "như là" không có bảo hành. Machine translation may be difficult to understand. Máy dịch thuật có thể khó hiểu. Please refer to Vui lòng tham khảo original English article bản gốc tiếng Anh bài viết whenever possible. bất cứ khi nào có thể.


Leave a Reply Để lại một trả lời

You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> Bạn có thể sử dụng các thẻ: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime = ""> <em> <i> <q <strike> <strong>

Subscribe to comments feature has been disabled. Thuê bao với ý kiến đều đã bị vô hiệu hoá. To receive notification of latest comments posted, subscribe to Để nhận được thông báo mới nhất đăng ý kiến, đăng ký với My Digital Life Comments RSS feed My Digital Life kiến RSS feed or hoặc register to receive đăng ký để nhận được new comments in daily email digest. Các ý kiến mới trong email tiêu hàng ngày.
Custom Search

New Articles Bài viết mới

Incoming Search Terms for the Article Tìm đến các Điều khoản Điều

freebsd dhcpd freebsd dhcpd - -- freebsd dhcp freebsd dhcp - -- freebsd dhcp server freebsd dhcp server - -- dhcpd freebsd dhcpd freebsd - -- dhcp freebsd dhcp freebsd - -- freebsd restart dhcpd freebsd khởi động lại trình nền dhcpd - -- dhcp server freebsd dhcp server freebsd - -- freebsd dhcpd.conf freebsd dhcpd.conf - -- restart dhcpd freebsd khởi động lại trình nền dhcpd freebsd - -- dhcp server mysql dhcp server mysql - -- dhcp on freebsd dhcp trên freebsd - -- freebsd dhcpd restart freebsd khởi động lại trình nền dhcpd - -- freebsd dhcp restart freebsd dhcp khởi động lại - -- restart dhcp freebsd khởi động lại dhcp freebsd - -- dhcp mysql dhcp mysql - -- bsd dhcp server bsd dhcp server - -- freebsd dhcp server install freebsd dhcp cài đặt máy chủ - -- dhcpd.conf freebsd dhcpd.conf freebsd - -- freebsd dhcp configuration freebsd dhcp cấu hình - -- isc-dhcpd freebsd dhcpd ISC-freebsd - -- freebsd dhcp.conf freebsd dhcp.conf - -- bsd dhcpd bsd dhcpd - -- freebsd isc dhcp freebsd ISC dhcp - -- dhcpd bsd dhcpd bsd - -- dhcpd restart freebsd khởi động lại trình nền dhcpd freebsd - -- dhcpd on freebsd dhcpd trên freebsd - -- install dhcp server freebsd cài đặt máy chủ dhcp freebsd - -- installing and configuring DHCP cài đặt và cấu hình DHCP - -- dhcpcd freebsd dhcpcd freebsd - -- dhcp in freebsd dhcp trong freebsd - -- freebsd dhcp config freebsd dhcp config - -- install dhcp freebsd cài đặt dhcp freebsd - -- freebsd restart dhcp freebsd khởi động lại dhcp - -- isc dhcp freebsd ISC dhcp freebsd - -- dhcp+freebsd dhcp + freebsd - -- FreeBSD setup DHCP FreeBSD thiết lập DHCP - -- freebsd isc-dhcpd freebsd-dhcpd ISC - -- freebsd dhcpd server freebsd dhcpd máy chủ - -- dhcp di freebsd dhcp di freebsd - -- freebsd install dhcpd freebsd cài đặt trình nền dhcpd - -- install dhcpd freebsd cài đặt trình nền dhcpd freebsd - -- dhcp freebsd dhcp freebsd - -- setting dhcp on freebsd thiết lập dhcp trên freebsd - -- setting dhcp freebsd thiết lập dhcp freebsd - -- isc dhcpd freebsd dhcpd ISC freebsd - -- dhcp server on freebsd dhcp server trên freebsd - -- installing dhcp on freebsd cài đặt dhcp trên freebsd - -- configure DHCP on freebsd cấu hình DHCP trên freebsd - -- install dhcpd on freebsd cài đặt trình nền dhcpd trên freebsd - -- bsd restart dhcpd bsd khởi động lại trình nền dhcpd - --