Creating VLAN links with libnl-route

Gavrilenko Eugene zhenya48.80 at mail.ru
Wed Apr 4 09:12:33 EDT 2012


Hello!
I'm novice in using libnl and libnl-route and have some questions,
but I can't find any tutorials or articles on it.

I need to perform some operations with VLAN interfaces: create, delete etc.
I created VLAN link as described in 'User's Guide' of libnl-route. 
Created link is OK, but it's always has name 
such as "vlanxxx". 
I run "sudo vconfig set_name_type DEV_PLUS_VID_NO_PAD" but rtnl_link_add(...) still
creates "vlanxxx"es. 
Is it possible to create VLAN link with name such as "eth1.xxx",
like command "vconfig" does, with function rtnl_link_add(...)?

After creating VLAN link I need it's interface index and name for future operations.
But it seems like the "xxx" part of created name is not the vlan_id.
How can I get the created "vlanxxx" name and interface index after link's creation? 

Thanx!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/libnl/attachments/20120404/8dad64f8/attachment.html>


More information about the libnl mailing list