VLAN : Virtual Local Area Network management
This module provides VLAN (Virtual Local Area Network) management. This module supports the IEEE 802.1Q standard, and can set a VLAN tag on any ethernet network interface of this machine.
User can use the following code to import the vlan
module.
var vlan = require('router/vlan');
Support
The following shows vlan
module APIs available for each permissions.
User Mode | Privilege Mode | |
---|---|---|
vlan.set | ● | |
vlan.get | ● |
VLAN Object
vlan.set(ifname, tag[, prio])
ifname
{String} Network interface name.tag
{Integer} VLAN id (0 ~ 4094), 0: Cancel VLAN settings.prio
{Integer} VLAN priority (0 ~ 7) default: 0.- Returns: {Boolean} Whether the setup was successful.
Set the VLAN tag and priority of the specified network interface.
Example
vlan.set('en1', 1024);
vlan.get(ifname)
ifname
{String} Network interface name.- Returns: {Object} VLAN setting.
Gets the VLAN setting information of the specified network interface. The returned object contains the following attributes:
tag
{Integer} VLAN id, 0: means no VLAN tag.prio
{Integer} VLAN priority.