VLAN support in rcNG [PATCH]

Adam C. Migus adam at migus.org
Sat Apr 17 13:55:41 PDT 2004

Quoting Ruslan Ermilov <ru at freebsd.org>:

> On Sat, Apr 17, 2004 at 04:25:06PM -0400, Adam C. Migus wrote:
> > The following is a patch that adds support for vlan creation and
> > destruction within rcNG.  Using the patch it's possible, for
> example,
> > to create a vlan, `vlan0' with the following directives in
> rc.conf:
> > 
> > vlan_interfaces="vlan0"
> > ifconfig_vlan0="DHCP"
> > ifconfig_vlan0_vlan_dev="xl0"
> > ifconfig_vlan0_vlan_tag="2"
> > 
> > Is this patch of general interest?  Should I submit a PR?
> > 
> This is from the vlan(4) manpage:
> : Each vlan interface is created at runtime using interface cloning. 
> This
> : is most easily done with the ifconfig(8) create command or using
> the
> : cloned_interfaces variable in rc.conf(5).
> So, how your patch is different from the existing functionality?
> Cheers,
> -- 
> Ruslan Ermilov
> ru at FreeBSD.org
> FreeBSD committer

Hmmm, well, it's not.  In fact the code is almost a copy of the cloned
interfaces stuff.  The thing is when you try to use the existing cloned
interfaces stuff to create a vlan interface, the lack of the _tag and
_dev stuff in combination with things like this:

/etc/network.subr:318:    _tmplist="${_tmplist} ${cloned_interfaces}"

creating vlans as cloned interfaces tends to be more of a crude hack
than an easy, one-step configuration.

If you can show me how I can create a vlan, using the existing stuff
with the functionality I want (DHCP or static IP, etc.) without writing
any code beyond declarations in rc.conf, show me, otherwise I'm
suggesting this patch as it makes it easy.

FWIW, cloned_interfaces and vlan_interfaces could be collapsed down in
future but the existing stuff as I see it doesn't do everything needed
for both.  The former simply creates the device.

Adam C. Migus -- http://people.migus.org/~adam/

More information about the freebsd-current mailing list