[Xorp-users] VLAN support in XORP

Pavlin Radoslavov pavlin at icir.org
Wed Sep 26 10:02:07 PDT 2007


Dan Lukes <dan at obluda.cz> wrote:

> Pavlin Radoslavov napsal/wrote, On 09/26/07 11:01:
> > The first-cut VLAN support is now committed in the CVS tree.
> ...
> > In term of VLAN naming, the situation is the following.
> > In FreeBSD (and I believe in other BSDs as well, but I haven't
> > double-checked it yet), the vlan name has to be "vlan%d". However,
> > the integer after "vlan" doesn't need to match the VLAN ID. E.g.,
> > vlan10 could have VLAN ID of, say, 20.
> 
> 	Unfortunately, no. It is "default" name, but the real interface name 
> can be set to anything the administrator wish.
> 
> 	On out network, the number after 'vlan' often match the VLAN ID. But I 
> have interface named DEVILLAN also.

What system are you using?
On FreeBSD-6.2 the name of the interface that is created by the user
needs to follow some pattern.
As you can see from the example below, both "vlanfoo" and "DEVILLAN"
couldn't be created, but the "vlan51" creation was successful:

root at xorp13[1] ifconfig vlanfoo create
ifconfig: SIOCIFCREATE: Invalid argument
Exit 1
root at xorp13[2] ifconfig DEVILLAN create
ifconfig: SIOCIFCREATE: Invalid argument
Exit 1
root at xorp13[3] ifconfig vlan51 create
root at xorp13[4] 

> 	You shall not derive any information about interface type nor 
> underlying configuration from it's name.
> 
> 	If you need specific information about a interface (as a type, VLAN ID 
> or parent interface), you need to use os-specific routines to obtain it.

Actually this is exactly how it is done currently inside the FEA.
We try to use only OS-specific routines to configure VLANs, etc.

The VLAN naming restrictions I described above are imposed by the OS
itself.
Currently, the model in XORP is to use same VLAN name in the XORP
configuration as it would appear in the system. The reason for this
is to avoid any confusion if you are looking into the XORP
configuration and by using system tool like "ifconfig".

> 	By the way, configuration file shall contain configuration, not 
> description of the OS that can be obtained from OS itself. 
> Dis-synchronisation between real system configurations and it's 
> description in xorp.conf is common source of problems.
> 
> 	I mean - why I need to encode that interface vlan10 is virtual 
> interface derived from parent fxp0 into xorp.conf ? It's information 
> that can be extracted from OS (if you really need it), so it shall be 
> extracted from OS, not from configuration file. The BSD make those 
> informations available for application. I'm sure the Linux does it also 
> as well.

Probably I don't understand your question here, but when you create
a VLAN you need to explicitly specify two things: its parent
interface and its VLAN ID.
The same is true even if you use UNIX command line tools. E.g., in
case of FreeBSD-6.2 you need to do the following:

ifconfig vlan0 create
ifconfig vlan0 vlan 34 vlandev sk0
ifconfig vlan0 10.11.11.11 netmask 0xffffff00

In XORP, the parent interface information is naturally specified by
the virtue of the the "interface/vif" hierarchy. Of course, there
are other ways of specifying the parent information, but the point
is you (the user) have to do it one way or another.
Of course, all this applies in case you want XORP to create the
VLANs for you.

If you have already created the VLANs before XORP was started, then
you can still use them as any other network interface by using
configuration like:

interfaces {
    interface vlan10 {
        vif vlan10 {
            address 10.10.10.10 {
                ...
            }
        }
    }
}
You could do this even without the recent VLAN support in XORP.
The new addition to XORP is that you can have XORP itself create the
VLANs for you instead of using the system tools.

Please let me know if I misunderstand something.

Thanks,
Pavlin



More information about the Xorp-users mailing list