Date: Tue, 11 May 1999 12:24:11 -0700 (PDT) From: "William R. Somsky" <somsky@annwn.phys.washington.edu> To: FreeBSD-gnats-submit@freebsd.org Cc: somsky@annwn.phys.washington.edu Subject: misc/11653: patch to allow DHCP configuration of interfaces through rc.conf Message-ID: <199905111924.MAA00397@annwn.phys.washington.edu>
next in thread | raw e-mail | index | archive | help
>Number: 11653 >Category: misc >Synopsis: patch to allow DHCP configuration of interfaces through rc.conf >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Tue May 11 12:30:00 PDT 1999 >Closed-Date: >Last-Modified: >Originator: William R. Somsky >Release: FreeBSD 3.1-STABLE i386 >Organization: University of Washington, Department of Physics >Environment: Workstations in a DHCP environment with fixed (not PCMCIA/removable) ethernet cards. >Description: In some instances, it is desireable to have a workstation with fixed (not PCMCIA/removable) ethernet cards to use DHCP for its interface configuration. This patch allows an entry of ifconfig_<ifn>="DHCP" in the rc.conf file to mark the interface to be configured via DHCP and to do so upon system booting. >How-To-Repeat: >Fix: This patch takes the code for starting DHCP from etc/pccard_ether, and places a copy of it, with appropriate "if"'s into rc.network. Once this patch is installed, an interface such as xl0 may be configured using DHCP by putting ifconfig_xl0="DHCP" in the rc.conf file. *** rc.network.orig Tue May 11 12:10:26 1999 --- rc.network Tue May 11 12:11:11 1999 *************** *** 57,63 **** fi # Do the primary ifconfig if specified eval ifconfig_args=\$ifconfig_${ifn} ! if [ -n "${ifconfig_args}" ] ; then ifconfig ${ifn} ${ifconfig_args} fi # Check to see if aliases need to be added --- 57,79 ---- fi # Do the primary ifconfig if specified eval ifconfig_args=\$ifconfig_${ifn} ! if [ "${ifconfig_args}" = "DHCP" ] ; then ! if [ -f /sbin/dhclient ] ; then ! if [ -s /var/run/dhclient.pid ] ; then ! kill `cat /var/run/dhclient.pid` ! rm /var/run/dhclient.pid ! fi ! /sbin/dhclient ! elif [ -f /usr/local/sbin/dhcpc ] ; then ! if [ -s /var/run/dhcpc.pid ] ; then ! kill `cat /var/run/dhcpc.pid` ! rm /var/run/dhcpc.pid ! fi ! /usr/local/sbin/dhcpc $* ! else ! echo "DHCP client software not available (isc-dhcp2)" ! fi ! elif [ -n "${ifconfig_args}" ] ; then ifconfig ${ifn} ${ifconfig_args} fi # Check to see if aliases need to be added >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199905111924.MAA00397>