[Xorp-users] VLAN support in XORP

Ben Greear greearb at candelatech.com
Wed Sep 26 10:49:38 PDT 2007


Pavlin Radoslavov wrote:

> Renaming the interfaces internally by XORP is one possibility.
> The reason we currently chose to keep same name inside the XORP
> configuration and what you see by "ifconfig" is to make it easier to
> the user in case they want to match the XORP configuration with the
> system's view of the interface names. Otherwise we have to provide
> somewhere a map between those names which makes things more
> complicated.

If you rename the interface, it will show up in ifconfig with the new
name as well.

> As I mentioned in my earlier email I was looking exactly into the
> VLAN-related ioctl() API, but I couldn't see any indication that you
> could use that particular API to change the VLAN name.
> Could you provide me with an example of how to do that.

Linux allows any interface to be renamed:

[root at fc7-build ~]# ifconfig eth1
eth1      Link encap:Ethernet  HWaddr 00:30:48:5B:6E:F1
           inet addr:10.0.0.1  Bcast:10.0.0.255  Mask:255.255.255.0
           inet6 addr: fe80::230:48ff:fe5b:6ef1/64 Scope:Link
           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
           RX packets:20065 errors:0 dropped:0 overruns:0 frame:0
           TX packets:119353 errors:0 dropped:0 overruns:0 carrier:0
           collisions:0 txqueuelen:1000
           RX bytes:6722385 (6.4 MiB)  TX bytes:9838070 (9.3 MiB)
           Base address:0x5000 Memory:ed300000-ed320000

[root at fc7-build ~]# ip link set dev eth1 name vlan-sort-of
SIOCSIFNAME: Device or resource busy
[root at fc7-build ~]# ip link set eth1 down
[root at fc7-build ~]# ip link set dev eth1 name vlan-sort-of
[root at fc7-build ~]# ifconfig vlan-sort-of
vlan-sort-of Link encap:Ethernet  HWaddr 00:30:48:5B:6E:F1
           inet addr:10.0.0.1  Bcast:10.0.0.255  Mask:255.255.255.0
           BROADCAST MULTICAST  MTU:1500  Metric:1
           RX packets:20066 errors:0 dropped:0 overruns:0 frame:0
           TX packets:119356 errors:0 dropped:0 overruns:0 carrier:0
           collisions:0 txqueuelen:1000
           RX bytes:6722731 (6.4 MiB)  TX bytes:9838316 (9.3 MiB)
           Base address:0x5000 Memory:ed300000-ed320000


> I wasn't aware of the effort to add VLAN support to Netlink. I was
> looking into the iproute source code but I didn't see any reference.
> Please let us know when the Netlink support is available, and we
> will try to add Netlink-based VLAN plugin at the bottom of the FEA.

I think it's in kernel 2.6.23 and the latest iproute package from the
git repository.  I was just using the similar API to support mac-vlans
a few days ago.

Here's another idea for you as well:

802.1Q VLANs are just some of the possible virtual interfaces
that Xorp could support.  Instead of having a vlan { foo } section
in your config, you could have something like:

interface eth0
   virtual-dev vlan0.5 {
     type: vlan
     vid: 5
   }
   virtual-dev eth0#0 {
     type: macvlan
     mac: 00:11:22:33:44:55
   }
   ...
}

With the netlink api, you can create the new device with a specified
name, so you don't even have to rename it later.  Using the 802.1Q VLAN
ioctls, you would have to rename it after creation, but you can guess the
initial name based on the naming-scheme, VID, and the parent interface.

Thanks,
Ben

-- 
Ben Greear <greearb at candelatech.com>
Candela Technologies Inc  http://www.candelatech.com



More information about the Xorp-users mailing list