Subject: A suggestion for the vlan(4) man page
To: None <tech-net@netbsd.org>
From: Alaric Snell-Pym <alaric@snell-pym.org.uk>
List: tech-net
Date: 01/15/2007 22:16:43
Hi there!

I've just set up 802.1Q VLANs on my NetBSD 3.0 box (alas, with a vr0
interface that doesn't do the big MTUs, but never mind).

I was stuck with some head-scratching for quite a while since it
didn't seem to work with the following configuration:

/etc/ifconfig.vlan0:
create
vlan 1 vlanif vr0
inet 192.168.1.5 netmask 0xffffff00

/etc/ifconfig.vlan1:
create
vlan 2 vlanif vr0
inet 212.18.243.163 netmask 0xfffffff8

/etc/ifconfig.vlan2:
create
vlan 3 vlanif vr0
inet 192.168.0.2 netmask 0xffffff00

However, a lucky accident (switching back to non-VLAN mode with an
inet address on vr0 then back to VLANs, whereupon it worked) led me
to realise I had to add:

/etc/ifconfig.vr0:
up

...I'd sort of assumed that adding a VLAN to an interface would
automatically bring it up, like adding an IP address does. In
hindsight this would probably be undesirable behaviour, so I wouldn't
suggest it be done that way, but I would suggest a minor addition to
the vlan(4) man page - I was a bit uneasy about the fact that it
didn't say *anything* about the desired state of the parent interface
(or, out of interest, what would happen if I assigned an IP to
it...). Perhaps it should include something like:

PHYSICAL INTERFACE

        Unless explicitly configured, physical interfaces are in the
'down' state
        upon booting. If a physical interface is to be used for
vlans, it should
        be configured up:

                ifconfig tlp0 up

...

EXAMPLES

      The same VLAN can be created at system startup time by placing
the fol-
      lowing in /etc/ifconfig.vlan0:

            create
            vlan 6 vlanif tlp0

      To correctly configure tlp0, the following should be placed in
      /etc/ifconfig.tlp0:

            up

Does that seem reasonable?

--
Alaric Snell-Pym
Work: http://www.snell-systems.co.uk/
Play: http://www.snell-pym.org.uk/alaric/
Blog: http://www.snell-pym.org.uk/?author=4