[quagga-dev 10498] Re: Adding "encapsulation dot1q" option to interfaces

Adrian Ban bluelightning at mantech.ro
Thu May 2 00:30:22 BST 2013

I've checked the sources of ifconfig of NetBSD. Also I've made a source 
code for creation of a new interface and VLAN in NetBSD.
Indeed the naming in the NetBSD of the interfaces are limited to this list:

agr bridge vlan stf gif gre tap tun strip sl pppoe ppp lo

 From my point of view is a drawback for this OS because it doesn't 
permit to set a custom name for the interface. Fortunately we can create 
a lot of vlans name which they shouldn't match the ID of the real VLAN :).

Starting from this point I can tell that I can do the "encapsulation 
dot1q" command for both Linux and BSD OSes with the additional command 
"binding physical interface" command.
I will split the code in two logical parts:

1. Linux part using interface naming: eth0.123 which the "binding 
physical interface" command will be optional and will overwrite the 
physical interface token from interface name.
2. Linux and BSD OSes using specific names and force to use "binding 
physical interface" command and obvious will skip the part that is 
taking the physical interface from interface name.

For Solaris instead I don't know anything for the moment in source 
coding of VLANs. From what I saw is using dladm and ipadm to create 
vlans and here in this document
they tell that the:

    Specifies the name of the VLAN, which can also be an
    administratively-chosen name.

But until I will install a Solaris OS on a VM and take a look into the 
dladm sources I can't say anything.

Also I think that a Port-Channel should be welcome from a first look in 
the sources code.

It's good in this way? Any suggestions? :)

Best regards,

On 5/1/2013 4:06 PM, Adrian Ban wrote:
> Thanks for the info.
> I saw that the ifconfig is the main target for BSD.
> The naming of the subinterface can be reconfigured as well. Only the 
> problem remains if we can't create a custom name interface in BSD I 
> should add a new command like:
> binding physical interface tlp0
> encapsulation dot1q 6
> This is a solution which can work on both OS Linux and BSD also. In 
> Linux if the first command is given will not do the sanity check for 
> interface name, just check if the interface name is free in system, 
> check the if the VLAN id is not already on the physical interface and 
> create the VLAN.
> If is not given will do sanity check, extract the physical interface, 
> check the VLAN on that physical interface and create the VLAN.
> In BSD is the first command is not given the "encapsulation dot1q 6" 
> will return an error something like this:
> %% no physical interface binding. Please configure "binding physical 
> interface" subcommand.
> Any suggestions are welcome :).
> Best regards,
> Adrian
> After I'm finish the Linux part I will install a BSD based OS on a VM 
> and change the VLAN configuration for it.
> About Solaris .. hope I will find some "ifconfig" parts there too or 
> the tool which is creating the VLANs.
> On 5/1/2013 3:50 PM, Greg Troxel wrote:
>> Adrian Ban <bluelightning at mantech.ro> writes:
>>> I don't know if the BSD supports creating the VLAN via kernel netlink,
>>> not 100% sure. Maybe somebody with more experience in BSD programming
>>> can give me a hint.
>> netlink is a Linux-only interface.  BSD systems use the routing socket
>> for learning about things and ioctl for configuring.
>>> For example in this document:
>>> http://www.openbsd.org/cgi-bin/man.cgi?query=vlan&sektion=4 seems that
>>> the creating of vlan is done via IOCTL.
>>> What I'm trying to implement is with netlink/rtnellink socket in Linux
>>> kernel for beginning. If everything is fine I will document how to do
>>> the same think on the BSD.
>> Sure, stepwise implementation is ok.  But you will be defining
>> interfaces that will later have to be implemented on multiple systems,
>> and it's important to get them right the first time.  Otherwise behavior
>> may end up changing to accomodate portability, which is awkward.
>> Because of that, I would be not in favor of merging vlan patches until
>> at least Linux and BSD are supported.  (And perhaps *solaris; I'm not
>> clear on how they configure vlans.)
>> The sources for ifconfig(8) on *BSD will be pretty straightforward;
>> that is basically a command-line wrapper around the ioctls.
>> The basic paradigm is
>>             ifconfig vlan0 create
>>             ifconfig vlan0 vlan 6 vlanif tlp0
>> to create a vlan interface and associate it with a particular id on a
>> parent (physical) interface.  After that it can be treated as any other
>> interface.
>> It sounds like the Linux naming scheme may be different, and how to
>> reconcile all this is important to get right before implementing.
>>> I want to do this because by default Quagga is a routing software so
>>> this can be interpreted like "a routing box" not "a switching box" and
>>> the "encapsulation dot1q" is available only in Cisco routes.
>> Understood that at least people would like this.
> _______________________________________________
> Quagga-dev mailing list
> Quagga-dev at lists.quagga.net
> http://lists.quagga.net/mailman/listinfo/quagga-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.quagga.net/pipermail/quagga-dev/attachments/20130502/29fe6dd0/attachment-0001.html>

More information about the Quagga-dev mailing list