From owner-freebsd-questions@FreeBSD.ORG Tue Dec 10 09:48:33 2013 Return-Path: Delivered-To: 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 2CB50C1D for ; Tue, 10 Dec 2013 09:48:33 +0000 (UTC) Received: from mail-oa0-x247.google.com (mail-oa0-x247.google.com [IPv6:2607:f8b0:4003:c02::247]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id EB0E2184F for ; Tue, 10 Dec 2013 09:48:32 +0000 (UTC) Received: by mail-oa0-f71.google.com with SMTP id i4so18669255oah.10 for ; Tue, 10 Dec 2013 01:48:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:message-id:date:subject:from:to:content-type; bh=sFE+6W+7oS+oAyc1+qN0gwkZglpX0RQUlKpG/sXKOjg=; b=tZKjbHboefB0l8ck6SieBhIrwWKbrXZT6cZf2EDmczZkMRNiMOJcp7j3eEo/XPuvwI 7/4Bv2vYuPV0jCwb1o002rSI3lsJR2JBK/pqC2Txwz0QdHBWOc2zdrJdwmqhhLcD+Mob guOcEGn5ouUEkZP+f0AlHl/W6obGqfFdq84Nyv4i9y8cluLvGf4I3yzkvG9SHALtsR1B A2Jvtrexol0CetA2j6AR+hLm7E6Opg+qQu6Ud6Qew6/2+xBp6WRAAZwR1zeig8SLYoLU Pppza09C9ZIBCi0PNn6is0xMURBiLr+CvoyCP7tgS6+SN8Y7OylB0DWVXXxQ8WCAEx0t 1a3A== MIME-Version: 1.0 X-Received: by 10.43.74.133 with SMTP id yw5mr30093281icb.15.1386668912248; Tue, 10 Dec 2013 01:48:32 -0800 (PST) Message-ID: <001a11c3a890ef8d8c04ed2b03bc@google.com> Date: Tue, 10 Dec 2013 09:48:32 +0000 Subject: www.freebsd.org From: Jill Patterson To: questions@freebsd.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed; delsp=yes Content-Transfer-Encoding: base64 X-Content-Filtered-By: Mailman/MimeDel 2.1.17 X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Dec 2013 09:48:33 -0000 PGRpdiBkaXI9Imx0ciI+SGksPGJyPkFyZSB5b3UgaW50ZXJlc3RlZCBpbiBnZXR0aW5nIGVzdGlt YXRlcyBvbiBkZXNpZ25pbmcgIA0KeW91ciB3ZWJzaXRlIG9yIGEgd2Vic2l0ZSByZWRlc2lnbj8g V2UgYWxzbyBjYW4gZ2V0IHlvdSBlc3RpbWF0ZXMgb24gU0VPICANCihTZWFyY2ggRW5naW5lIE9w dGltaXphdGlvbikgbWFya2V0aW5nIGF0IG5vIGNvc3QuIElmIHlvdSBhcmUgaW50ZXJlc3RlZCwg IA0KcmVwbHkgYmFjayB0byB0aGlzIGVtYWlsIHdpdGggdGhlIHNlcnZpY2VzIHRoYXQgeW91IGFy ZSBpbnRlcmVzdGVkIGluIGFuZCAgDQp3ZSB3aWxsIGdldCB5b3UgZXN0aW1hdGVzIGluIHRoZSBu ZXh0IDI0IGhvdXJzLjxicj4NCkJlc3QgcmVnYXJkcyw8YnI+SmlsbCBQYXR0ZXJzb248YnI+U0VP L1dFQiBTcGVjaWFsaXN0PGJyPkU6IDxhICANCmhyZWY9Im1haWx0bzpqaWxsd3BhdHRlcnNvbkBn bWFpbC5jb20iICANCnRhcmdldD0iX2JsYW5rIj5qaWxsd3BhdHRlcnNvbkBnbWFpbC5jb208L2E+ IDxicj48YnI+PGJyPqCgoCAgDQo8YnI+oKCgoKCgoKCgoKAgU6CgIEWgIE+goKCgoKCgoKCgoCA8 YnI+U2VhcmNoIEVuZ2luZSBPcHRpbWl6YXRpb248YnI+PGJyPg0KV2UgcmVzcGVjdCB5b3VyIHBy aXZhY3kgYW5kIHdhbnQgdG8gbWFrZSBzdXJlIHlvdSBhcmUgYXdhcmUgb2YgYSBmZXcgIA0KdGhp bmdzLiBCeSByZXBseWluZyB0byB0aGlzIGVtYWlsLCB5b3UgYXV0aG9yaXplIG91ciBBdXN0cmFs aWFuIGFmZmlsaWF0ZXMgIA0KdGhhdCBjYW4gaGVscCB3aXRoIHlvdXIgcHJvamVjdCB0byBjYWxs IHlvdSBhdCB0aGUgbnVtYmVyIHlvdSBwcm92aWRlZCwgYW5kICANCnlvdSB1bmRlcnN0YW5kIHRo YXQgdGhleSBtYXkgdXNlIGF1dG9tYXRlZCBwaG9uZSB0ZWNobm9sb2d5IHRvIGNhbGwgeW91LiBB dCAgDQpubyB0aW1lIGFyZSB5b3UgcmVxdWlyZWQgdG8gbWFrZSBhIHB1cmNoYXNlLjxicj4NClVu c3Vic2NyaWJlPGJyPjwvZGl2Pg0K From owner-freebsd-questions@FreeBSD.ORG Tue Dec 10 09:58:21 2013 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9A3A2F40 for ; Tue, 10 Dec 2013 09:58:21 +0000 (UTC) Received: from mout.gmx.net (mout.gmx.net [212.227.15.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 338AF190A for ; Tue, 10 Dec 2013 09:58:21 +0000 (UTC) Received: from [192.168.68.134] ([79.110.95.2]) by mail.gmx.com (mrgmx101) with ESMTPSA (Nemesis) id 0M97Nh-1Virou1Nin-00COAG for ; Tue, 10 Dec 2013 10:58:13 +0100 Message-ID: <52A6E5AC.5050100@gmx.com> Date: Tue, 10 Dec 2013 10:58:04 +0100 From: Nikos Vassiliadis User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.1.1 MIME-Version: 1.0 To: Devin Teske Subject: Re: ifconfig_x0="DHCP" and ifconfig_x0_alias0="a.b.c.d" References: <52A20652.4010809@gmx.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:YoCB5XHLh4xtBK+meFUmW0kuUh/yKp4Ki1bx6VHWWZVN9d5RWJJ Sbi6rr9RwiTObBTi3CdElv5L0+De0Q+nkeEiLbeFBIwbnahSTKotoZLR7pL4M1vVSq0xAPM 4cVEG6eRt+ugcuF/A76YnWtjI1jZxL4KxkZ/L0gZ6TWpm36lAlW0jW6sFfc6IIPymw5jivT LLL7XEV7bbRcyHNjVxkvQ== Cc: "Teske, Devin" , FreeBSD Questions X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Dec 2013 09:58:21 -0000 On 06.12.2013 23:34, Teske, Devin wrote: > > On Dec 6, 2013, at 9:16 AM, Nikos Vassiliadis wrote: > >> Hi, >> >> 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="DHCP" >> ifconfig_net0_alias0="inet 1.2.3.4/24" >> >> I ve tried some combinations found in the manual but nothing worked >> so far... >> > > 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="DHCP" > sysrc ifconfig_net0_alias0="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). > Yes, it works great. Good to know about sysrc, I didn't know about it... Sorry for the delayed answer, I was offline. Nikos