From owner-freebsd-questions@freebsd.org Sat Aug 15 05:00:04 2015 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4FB7E9BA78A for ; Sat, 15 Aug 2015 05:00:04 +0000 (UTC) (envelope-from herbert@oslo.ath.cx) Received: from oslo.ath.cx (oslo.ath.cx [IPv6:2a01:4f8:200:42e4::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0CC451C38 for ; Sat, 15 Aug 2015 05:00:03 +0000 (UTC) (envelope-from herbert@oslo.ath.cx) Received: from oslo.ath.cx (localhost [IPv6:::1]) by oslo.ath.cx (Postfix) with SMTP id 86DD418C1; Sat, 15 Aug 2015 06:59:51 +0200 (CEST) Date: Sat, 15 Aug 2015 06:59:51 +0200 From: "Herbert J. Skuhra" To: Jim Long Cc: freebsd-questions@freebsd.org Subject: Re: rc.conf, ifconfig, VLANs and named interfaces Message-ID: <20150815045951.GA40785@oslo.ath.cx> References: <20150814221855.GB71219@ns.umpquanet.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150814221855.GB71219@ns.umpquanet.com> User-Agent: Mutt/1.5.23+116 (55ea6e829b46) (2014-03-12) X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Aug 2015 05:00:04 -0000 On Fri, Aug 14, 2015 at 03:18:56PM -0700, Jim Long wrote: > I am trying to figure out what to put into my rc.conf to yield the following > configuration: > > # ifconfig public > public: flags=8843 metric 0 mtu 1500 > options=103 > ether 00:1a:6b:35:05:9a > inet 10.0.1.10 netmask 0xffffff00 broadcast 10.0.1.255 > media: Ethernet autoselect > status: no carrier > vlan: 4 parent interface: em0 > > If I use these rc.conf entries: > > # head -6 /etc/rc.conf > hostname="host.example.com" > IP="10.0.0.10/24" > > vlans_em0='4' > ifconfig_em0="inet $IP" > ifconfig_em0_4='inet 10.0.1.10/24' > > I get: > > t60 : 20:18:37 /root# ifconfig em0.4 > em0.4: flags=8843 metric 0 mtu 1500 > options=103 > ether 00:1a:6b:35:05:9a > inet 10.0.1.10 netmask 0xffffff00 broadcast 10.0.1.255 > media: Ethernet autoselect > status: no carrier > vlan: 4 parent interface: em0 > > That's very close! Now I just need /etc/rc.d/netif to rename the interface. > But the interface name has a dot in it. I'm going to guess that if I replace > that dot with an underscore, rc.conf and netif will know what I mean. > > Unfortunately, > > # head -8 /etc/rc.conf > hostname="host.example.com" > IP="10.0.0.10/24" > > vlans_em0='4' > ifconfig_em0="inet $IP" > ifconfig_em0_4='inet 10.0.1.10/24' > > ifconfig_em0_4_name='public' > > Yields no 'public' interface: > > # ifconfig -l > em0 wpi0 lo0 em0.4 wlan0 > # ifconfig em0.4 > em0.4: flags=8843 metric 0 mtu 1500 > options=103 > ether 00:1a:6b:35:05:9a > inet 10.0.1.10 netmask 0xffffff00 broadcast 10.0.1.255 > media: Ethernet autoselect > status: no carrier > vlan: 4 parent interface: em0 > > The renaming doesn't happen. Manually renaming the interface DOES work, so I > know it's possible: > > # ifconfig -l > em0 wpi0 lo0 em0.4 wlan0 > # ifconfig em0.4 name public > # ifconfig -l > em0 wpi0 lo0 public wlan0 > # ifconfig public > public: flags=8843 metric 0 mtu 1500 > options=103 > ether 00:1a:6b:35:05:9a > inet 10.0.1.10 netmask 0xffffff00 broadcast 10.0.1.255 > media: Ethernet autoselect > status: no carrier > vlan: 4 parent interface: em0 > > But how can I get netif to do it automatically, so that I can boot up with a > named, vlan-tagged interface? Try: vlans_em0="public" create_args_public="vlan 4" ifconfig_public="inet 10.0.1.10/24" -- Herbert