[Xorp-users] VLAN support in XORP

Pavlin Radoslavov pavlin at icir.org
Wed Sep 26 10:29:36 PDT 2007


Kristian Larsson <kristian at spritelink.net> wrote:

> On Wed, Sep 26, 2007 at 02:01:07AM -0700, Pavlin Radoslavov wrote:
> > All,
> > 
> > The first-cut VLAN support is now committed in the CVS tree.
> > 
> > Below is some high-level information about the current configuration
> > mechanism. Nothing is final so here is your chance to suggest
> > improvements or alternative solutions.
> > 
> > Currently, the configuration looks like:
> > 
> > interfaces {
> >     interface fxp0 {
> >         vif vlan10 {
> >             vlan {
> >                 vlan-id: 10
> >             }
> >             address 10.10.10.10 {
> >                 ...
> >             }
> >             ...
> >         }
> >     }
> > }
> 
> 
> What do the actual interface look like if I check
> with `ifconfig` ?

There will be interface named "vlan10". E.g., on FreeBSD-6.2 it will
look like:

root at xorp13[7] ifconfig vlan10
vlan10: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        inet 10.10.10.10 netmask 0xffffff00 broadcast 10.10.10.255
        inet6 fe80::xxx:xxxx:xxxx:xxxx%vlan10 prefixlen 64 scopeid 0xd 
        ether xx:xx:xx:xx:xx:xx
        media: Ethernet autoselect (none)
        status: no carrier
        vlan: 10 parent interface: fxp0

> Do I manually have to make sure that the "vif
> vlan10" section doesn't collide with other
> interfaces, ie do vlan 10 have to be unique and
> will XORP or the user keep track of that?

If the system doesn't allow you to have more than one VLANs with the
same name (even if they have different parent interfaces), then you
need to manually make sure that there is only one vlan10 in your
configuration. E.g., on FreeBSD you cannot have configuration like:

interfaces {
    interface fxp0 {
        vif vlan10 {
            vlan {
                vlan-id: 10
            }
            address 10.10.10.10 {
                prefix-length: 24
            }
        }
    }
    interface sk0 {
        vif vlan10 {
            vlan {
                vlan-id: 10
            }
            address 10.44.44.44 {
                prefix-length: 24
            }
        }
    }
}

> 
> > I.e., the "vlan {}" block inside the "vif {}" block is used to
> > identify the vif as a VLAN and to apply the VLAN-specific
> > configuration. For now the VLAN-specific configuration is only the
> > VLAN ID.
> 
> Can't you put this thing under the main interface,
> like adding "vlan-tagging" or something?
> I don't want another two lines of configuration
> per sub-interface.

We could, but the reason I prefer to have an explicit "vlan {}"
block is for clarity. E.g., if we keep the above model, then in the
future all VLAN-specific parameters will go to that block rather
than cluttering everything together inside the generic "vif {}"
block.

> > To add yet another possible solution, my personal preference and
> > my original intention was to use configuration like the following:
> > 
> > interfaces {
> >     interface fxp0 {
> >         vlan vlan10 {
> >             vlan-id: 10
> >             address 10.10.10.10 {
> >                 ...
> >             }
> >             ...
> >         }
> >     }
> > }
> 
> I support this one.
> Having an extra vlan { branch just adds more lines
> and doesn't really bring anything useful, imho.

My preference is also for this one (again, for clarity reason), but
I would like to see some rough concensus before making any changes.

> > 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.
> 
> I don't think so. I think you can rename the
> interface to whatever you wish.

Which OS and OS version?
In another email, Dan Lukes said the same thing, but it doesn't seem
to be the case for FreeBSD-6.2.

> > In Linux the naming scheme can be programmed in advance using
> > ioctl(SET_VLAN_NAME_TYPE_CMD). The choices are names like:
> >  (a) vlan0005
> >  (b) eth1.0005
> >  (c) vlan5
> >  (d) eth0.5
> > 
> > Unlike FreeBSD, in Linux the integer value at the end of the name
> > must match the VLAN ID.
> 
> Are you sure?
> I'm pretty sure you can rename the interfaces in
> Linux as well. Let me get back on this.

I was looking into the ioctl() API (I was reading the source code of
vconfig(8) from Ben Greear and I was checking <linux/if_vlan.h>),
but I couldn't see anything that indicates that you could explicitly
assign your own VLAN name.

Ben, if the Linux ioctl() API allows me to specify the VLAN name to
any string, could you tell me the exact API setup I need to use.
In my testing I am using Gentoo 2006.1 with 2.6.20 kernel.

Thanks,
Pavlin

> 
> > I believe (d) is the default naming scheme (where eth0 is the parent
> > interface).
> > However, for consistency with BSD and for naming clarity, currently
> > the FEA explicitly selects (c) as the naming scheme. Therefore the
> > sample configuration in the beginning of this email should work for
> > both BSD and Linux (except that in Linux "fxp0" needs to be replaced
> > with the parent interface name, say, "eth0").
> 
> 
>   Kristian.
> 
> -- 
> Kristian Larsson                                        KLL-RIPE
> Network Engineer & Peering Coordinator      SpriteLink [AS39525]
> +46 704 910401			              kll at spritelink.net
> 
> _______________________________________________
> Xorp-users mailing list
> Xorp-users at xorp.org
> http://mailman.ICSI.Berkeley.EDU/mailman/listinfo/xorp-users



More information about the Xorp-users mailing list