From owner-freebsd-questions@freebsd.org Fri Aug 14 22:18:57 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 51D309B9CE7 for ; Fri, 14 Aug 2015 22:18:57 +0000 (UTC) (envelope-from list@museum.rain.com) Received: from ns.umpquanet.com (ns.umpquanet.com [98.158.10.80]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1676913B4 for ; Fri, 14 Aug 2015 22:18:56 +0000 (UTC) (envelope-from list@museum.rain.com) Received: from ns.umpquanet.com (localhost [127.0.0.1]) by ns.umpquanet.com (8.14.9/8.14.9) with ESMTP id t7EMIuwn071373 for ; Fri, 14 Aug 2015 15:18:56 -0700 (PDT) (envelope-from list@museum.rain.com) Received: (from james@localhost) by ns.umpquanet.com (8.14.9/8.14.9/Submit) id t7EMIulh071372 for freebsd-questions@freebsd.org; Fri, 14 Aug 2015 15:18:56 -0700 (PDT) (envelope-from list@museum.rain.com) Date: Fri, 14 Aug 2015 15:18:56 -0700 From: Jim Long To: freebsd-questions@freebsd.org Subject: rc.conf, ifconfig, VLANs and named interfaces Message-ID: <20150814221855.GB71219@ns.umpquanet.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.23 (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: Fri, 14 Aug 2015 22:18:57 -0000 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? Thanks! Jim