尋找一個實用程式來測試 DHCP 設定

尋找一個實用程式來測試 DHCP 設定

我最近isc-dhcp-server在我的工作場所安裝了 DHCP 伺服器 ( )。

我正在尋找一個實用程式來測試遠端電腦的網路 DHCP 設定(不是透過使用dhclient/iptables /renew)。

  • 回應伺服器的指示(有時我的同事錯誤地安裝了 DHCP 服務)
  • 能夠提供 MAC 位址(用於測試池預留)
  • 簡單顯示響應

例如:

$> [utility name] [source mac address | optional] ...

RESPONSE (DHCP Server is 192.168....)
    IP: 192.168.....
    SUBNET: 255.255.....
    DEFAULT GATEWAY: 192.168.....
    ...

答案1

您可以嘗試“dhcping”實用程式。在 CentOS/RHEL 上,在連線到 EPEL 儲存庫後,您可以選擇「yum install it」。查看命令選項。它們看起來確實適合您的需求。

dhcping(8)                  General Commands Manual                 dhcping(8)

NAME
   dhcping - send a DHCP request to DHCP server to see if it’s up and running

SYNOPSIS
   dhcping [-v] [-q] [-i] [-r] -t maxwait -c client-IP-address -s server-IP-address -h client-hardware-address [-g gateway-
   IP-address]

DESCRIPTION
   This command allows the system administrator to check if a remote DHCP server is still functioning.

   Options are:

   -v   Verbose, print some information.

   -i   Use DHCPINFORM packets.

   -r   Use DHCPREQUEST packets (default behaviour).

   -q   Quiet, print nothing on the screen.

   -t maxwait
        Maximum time to wait for an answer from the server in seconds.  Default is 3 seconds.

   -c client-IP-address
        Request this IP address. Note that this is also the IP address the answer will be sent to.

   -s server-IP-address
        Send the DHCP packet to this IP address.

   -h client-hardware-address
        Use this hardware-address in the DHCP request. It can be up to sixteen octets seperated by colons (i.e. 01:02:03:04)

   -g gateway-IP-address
        Use this IP address for the gateway IP address in the DHCP packet.  This option is currently broken

一切順利!

+丹尼爾。

答案2

這是一個舊線程,但就其價值而言,我投票給http://blog.thecybershadow.net/2013/01/10/dhcp-test-client/ 來自部落格:

在嘗試設定我的家庭網路時,我對沒有簡單的方法來測試 DHCP 伺服器感到沮喪。窺探資料包僅限於檢查現有流量。

DHCP 測試工具是存在的(DHCPing 和 dhquery),但是它們都已經過時,無法滿足最新版本的要求,而且都無法在 Windows 上運作。

我編寫了一個簡單的 DHCP“客戶端”,它可以接收和解碼廣播的 DHCP 回复,以及發送 DHCP“發現”資料包。該工具是跨平台的,應該可以在 Windows 和主要 POSIX 系統上運行。

我已經從那裡下載了https://github.com/Cyber​​Shadow/dhcptest並編譯它。他提供了針對 Windows 的編譯版本,但在 Linux 上你必須自己編譯它,這非常容易,而且有很好的說明。

相關內容