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

Adrian Ban bluelightning at mantech.ro
Wed May 1 14:06:24 BST 2013


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.





More information about the Quagga-dev mailing list