From owner-freebsd-questions@FreeBSD.ORG Tue Dec 9 17:19:11 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BCE6F1065677 for ; Tue, 9 Dec 2008 17:19:11 +0000 (UTC) (envelope-from Pieter.Donche@ua.ac.be) Received: from hmacs.cmi.ua.ac.be (hmacs.cmi.ua.ac.be [143.129.75.10]) by mx1.freebsd.org (Postfix) with ESMTP id 5B5E38FC16 for ; Tue, 9 Dec 2008 17:19:10 +0000 (UTC) (envelope-from Pieter.Donche@ua.ac.be) Received: from hmacs.cmi.ua.ac.be (localhost [127.0.0.1]) by hmacs.cmi.ua.ac.be (8.13.8+Sun/8.13.8) with ESMTP id mB9HJ9I9019690 for ; Tue, 9 Dec 2008 18:19:09 +0100 (CET) Received: from localhost (pdon@localhost) by hmacs.cmi.ua.ac.be (8.13.8+Sun/8.13.8/Submit) with ESMTP id mB9HJ9kq019687 for ; Tue, 9 Dec 2008 18:19:09 +0100 (CET) X-Authentication-Warning: hmacs.cmi.ua.ac.be: pdon owned process doing -bs Date: Tue, 9 Dec 2008 18:19:09 +0100 (CET) From: Pieter Donche X-X-Sender: pdon@hmacs.cmi.ua.ac.be To: "mail.list freebsd-questions" Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Subject: add/change/delete dhcpd.conf entries X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Pieter Donche List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Dec 2008 17:19:11 -0000 In a DHCP server managing fixed IP addresses, one needs to make changes often: new people need their Mac address given a IP addres, people leaving need to be deleted, people changing an old for a new computer need a Mac address change for the same IP, etc... All this information is recorded in the /usr/local/etc/dhcpd.conf file. I know, there is the omapi command shell (/usr/local/bin/omshell) but as far as I can see, you can only use it interactively. Or am I wrong? I would love to have a simple command line tool that allows you to make changes to your dhcpd.conf file without needing to use an editor or omapi. e.g. for a new entry, something like: # dhcpdmgr -A 175.134.34.128 -c "John.Adams PC" -i "00:34:1A:23:4A:0F" 175.134.34 which would add IP 175.134.34.128 in subnet 175.134.3 for mac address 00:34:1A:23:4A:0F with a comment "John.Adams PC" and with other options for delete (-D), make changes to comment, IP or Mac, etc... Does anyone have such a command line tool? With that command line tool one can easily make a wrapper script, presenting you with a menu of frequent operations, and with extensive checking of your input data. I use such a wrapper script, making use of Solaris pntadm (DHCP network table management utility) command line tool.