From owner-freebsd-questions@FreeBSD.ORG Fri Dec 6 22:34:19 2013 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DD6AA376; Fri, 6 Dec 2013 22:34:19 +0000 (UTC) Received: from mx1.fisglobal.com (mx1.fisglobal.com [199.200.24.190]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A595217B4; Fri, 6 Dec 2013 22:34:19 +0000 (UTC) Received: from smtp.fisglobal.com ([10.132.206.31]) by ltcfislmsgpa04.fnfis.com (8.14.5/8.14.5) with ESMTP id rB6MYIw9012697 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT); Fri, 6 Dec 2013 16:34:18 -0600 Received: from LTCFISWMSGMB21.FNFIS.com ([169.254.1.7]) by LTCFISWMSGHT03.FNFIS.com ([10.132.206.31]) with mapi id 14.03.0158.001; Fri, 6 Dec 2013 16:34:17 -0600 From: "Teske, Devin" To: Nikos Vassiliadis Subject: Re: ifconfig_x0="DHCP" and ifconfig_x0_alias0="a.b.c.d" Thread-Topic: ifconfig_x0="DHCP" and ifconfig_x0_alias0="a.b.c.d" Thread-Index: AQHO8tNLEfJhwngxlU+FnB3v1nRbwA== Date: Fri, 6 Dec 2013 22:34:16 +0000 Message-ID: References: <52A20652.4010809@gmx.com> In-Reply-To: <52A20652.4010809@gmx.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.132.253.120] Content-Type: text/plain; charset="us-ascii" Content-ID: Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.11.72, 1.0.14, 0.0.0000 definitions=2013-12-06_06:2013-12-06,2013-12-06,1970-01-01 signatures=0 Cc: Devin Teske , "Teske, Devin" , FreeBSD Questions X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list Reply-To: Devin Teske List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Dec 2013 22:34:19 -0000 On Dec 6, 2013, at 9:16 AM, Nikos Vassiliadis wrote: > Hi, >=20 > I am looking for a rc friendly way to set up an IP alias and DHCP > on an interface. I am after this: > ifconfig_net0=3D"DHCP" > ifconfig_net0_alias0=3D"inet 1.2.3.4/24" >=20 > I ve tried some combinations found in the manual but nothing worked > so far... >=20 What release are you on? If you're on 9.2-R or higher... there are multiple ways... First way... Use sysrc(8)... sysrc ifconfig_net0=3D"DHCP" sysrc ifconfig_net0_alias0=3D"inet 1.2.3.4/24" NOTE: See "man sysrc" for more info Need more control? Use a shell API library... # At the top of your rc... . /usr/share/bsdconfig/sysrc.subr # Then wherever you want... f_sysrc_set ifconfig_net0 DHCP f_sysrc_set ifconfig_net0_alias0 "inet 1.2.3.4/24" NOTE: Works on 9.2-R+ NOTE: If you're on 11.0-C or higher, there's an API reference... see "bsdconfig includes -d sysrc" for sysrc API references However, you'll need to be aware, that if you intend to change these values *during* the boot process... the newly modified values may not take effect for the current boot, as the values are aggressively cached (for which there is a patch by Sir Percival to address -- see SVN r258894 for additional information on that). --=20 Devin _____________ The information contained in this message is proprietary and/or confidentia= l. If you are not the intended recipient, please: (i) delete the message an= d all copies; (ii) do not disclose, distribute or use the message in any ma= nner; and (iii) notify the sender immediately. In addition, please be aware= that any message addressed to our domain is subject to archiving and revie= w by persons other than the intended recipient. Thank you.