vconfig 的使用

http://man.cx/vconfig%288%29

vconfig 作用: (802.1q)VLAN配置程序

 

root@hbg:/# vconfig --help
BusyBox v1.22.1 (2016-02-24 11:41:04 CST) multi-call binary.

Usage: vconfig COMMAND [OPTIONS]

Create and remove virtual ethernet devices

        add             IFACE VLAN_ID                                        // 增加vlan接口
        rem             VLAN_NAME               // 删除vlan接口
        set_flag        IFACE 0|1 VLAN_QOS
        set_egress_map  VLAN_NAME SKB_PRIO VLAN_QOS
        set_ingress_map VLAN_NAME SKB_PRIO VLAN_QOS
        set_name_type   NAME_TYPE

 

1)增加vlan接口:

     使用方法:vconfig  add [interface-name] [vlan-id]

root@hbg:/# vconfig add eth0 20                           
root@hbg:/# ifconfig -a | grep eth0
eth0      Link encap:Ethernet  HWaddr 78:C2:C0:E3:00:4D 
eth0.20   Link encap:Ethernet  HWaddr 78:C2:C0:E3:00:4D 

 

2)删除vlan接口

    使用方法: vconfig rem [vlan-device]

root@hbg:/# vconfig rem eth0.20
root@hbg:/# ifconfig -a | grep eth0
eth0      Link encap:Ethernet  HWaddr 78:C2:C0:E3:00:4D 

 

 

 

涉及到的文件

/proc/net/vlan/config 
/proc/net/vlan/[vlan−device]

 

posted @ 2016-04-20 11:23  hbg-rohens  阅读(5730)  评论(0编辑  收藏  举报