Creating VLAN links with libnl-route

Thomas Graf tgraf at infradead.org
Thu Apr 5 04:12:25 EDT 2012


On Thu, Apr 05, 2012 at 11:41:19AM +0400, Gavrilenko Eugene wrote:
> Hello!
> As I realized 'vconfig' utitlity uses ioctl(...) interface rather than Netlink messages.
> To create  VLAN link with name "eth1.xxx" we just need to call function rtnl_link_set_name() before calling rtnl_link_add().
> For examle:   rtnl_link_set_name(link, "eth1.1");
> After that we can obtain interafce index by calling  rtnl_link_get_kernel(sock, 0, "eth1.1", &link) and rtnl_link_get_ifindex(link).
> The problem is solved.

Excactly, the kernel does not care how you name your interfaces.



More information about the libnl mailing list