2016年6月13日 星期一

vlanctl command for Broadcom

Set vlan operations interface suffix, if not set ,the default value is "."
    vlanctl --if-suffix      

change real interface name mode,if not set , default mode is RG.
    vlanctl --if <--set-if-mode-rg>|<--set-if-mode-ont>

create vlan operations interface eg. vlanctl --if-create eth0 0 => generate eth0.0 with eth0
    vlanctl --if-create [--routed] [--mcast]
   
create vlan operations interface and specify name
    vlanctl --if-create-name [--routed] [--mcast]

delete vlan operations interface with name
    vlanctl --if-delete

-- NOTIFY start-----------------------------
--------------------------------------------
when create a vlan interface,it will create 10 tables about this vlan interface automatically.
              interface -- -- < 0 tag | 1 tag | 2 tags | 3 tags | 4 tags > 
A tagging rule table determined by and
when a table is created,the default values are set to: TPID(0x8100), pbits(0),vid(1),cfi(0)
and DSCP-TO-PBITS table are set by copying the lowest 3 bits of each DSCP value as the pbits value,
eg. DSCP=5 PBITS=5, DSCP=15 PBITS=7.
--------------------------------------------
-- NOTIFY end-------------------------------

change default actions of a vlan tag rules table,
    vlanctl --if --tags  
        [--default-tpid ] [--default-pbits ] [--default-vid ] [--default-cfi ]

change DSCP to Pbits translation
    vlanctl --if [--cfg-dscp2pbits ]
   
change Tpid table
    vlanctl --if --cfg-tpid  

--------------------------------------------
display a rule table.   eg. vlanctl --if eth0 --rx --tags 0 --show-table
    vlanctl --if --tags --show-table

dispaly DSCP to Pbits table
    vlanctl --if --show-dscp2pbits

display TPID table
    vlanctl --if --show-tpid

display device local stats
    vlanctl --local-stats |

--------------------------------------------
runtest
    vlanctl --run-test

--------------------------------------------

delete all tag rules
    vlanctl --rule-remove-all

delete a tag rule
    vlanctl --if --tags --rule-remove

---------------------------------------------

Add a tag rule
    vlanctl --if --tags [filters] [commads]

    filters:
     --filter-skb-prio                    match the SKB priority 
     --filter-skb-mark-flowid              match the Flow ID subfiled of SKB Mark filed.         
     --filter-skb-mark-port                   match the port subfiled of SKB Mark filed.     
     --filter-ethertype                  match the Ethertype filed in the Ethernet Header of incoming frames 
     --filter-ipproto                  match the IP protocol type of incoming frames 
     --filter-dscp                            match the DSCP value in the IPv4 Header of incoming frames 
     --filter-dscp2pbits                     match the DSCP traslate from pbits which in the VLAN Header by dscp2pbits table  
     --filter-vlan-dev-mac-addr 0: match all recive frames dest MAC addr against the recive virtual interface
                                                      1: match unicast recive frames dest MAC addr against the recive virtual interface    
     --filter-pbits              match the PBITS value of VLAN Header number of incoming frames 
     --filter-cfi                  match the CFI value of VLAN Header number of incoming frames 
     --filter-vid                  match the VID value of VLAN Header number of incoming frames 
     --filter-tag-ethertype  match the Ethertype value of VLAN Header number of incoming frames 
     --filter-txif             match the transmitting vlan interface                                

    commands:
     --pop-tag                                       remove the outermost VLAN tag.
     --push-tag                                      add default VLAN tag of the corresponding Tagging rule Table as the new outer tag.
     --drop-frame                                    drop the frame
     --continue                                      pass the frame
     --set-rxif                forward frames in the RECEIVE direction that match this rule to the VOPI specified in vlan interface name                        
     --dscp2pbits                        translate the IPv4 DSCP into a PBITS ,and write the translated PBITS value in the VLAN Header which number is index 
     --set-dscp                               set the DSCP value in the IPv4 Header 
     --set-skb-prio                       set the SKB priority 
     --set-skb-mark-port                      set the port subfiled of SKB Mark filed. 
     --set-skb-mark-queue                    set the queue subfiled of SKB Mark filed. 
     --set-skb-mark-flowid                 set the Flow ID subfiled of SKB Mark filed
     --set-ethertype                     set the ethertype value of the Ethernet Header 
     --set-pbits                 set the PBITS value of the VLAN header number
     --set-cfi                     set the CFI bit of the VLAN header number to
     --set-vid                     set the VID of the VLAN header number to
     --set-tag-ethertype     set the ethertype of the VLAN header number to
     --copy-pbits   copy the PBITS value from VLAN header number to VLAN header number
     --copy-cfi     copy the CFI value from VLAN header number to VLAN header number
     --copy-vid     copy the VID value from VLAN header number to VLAN header number
     --copy-tag-ethertype   
                                                     copy the Ethernet type value from VLAN header number to VLAN header number
   
    position: <--rule-append> | <--rule-insert-before rule-id=""> |<--rule-insert-after rule-id="">
     --rule-append                      insert as a last rule
     --rule-insert-before     insert before the role whose id is matches the rule-id in the table
     --rule-insert-after      insert after the role whose id is matches the rule-id in the table

2 則留言:

  1. 這是上cpu用Software去做vlan嗎?

    回覆刪除
  2. 我家的情况是,光猫和VLAN交换机在多媒体箱,一根网线连接无线路由器。单线复用实现WIFA全覆盖。为了实现这项功能,采用VLAN交换机建立VLAN分组,同时无线路由器建立VLAN分组的方式。
    最近升级华硕AC86U无线路由器,发现这款路由器不支持robocfg功能,仅支持博通自有vlanctl设置。我对vlanctl完全不熟悉,网上找不到相关博文,请楼主帮忙实现以下robocfg相对应的vlanctl脚本。谢谢!
    robocfg vlans reset vlan 1 ports "0u 1u 2u 3u 4u 5t" vlan 41 ports "0t 5u"

    回覆刪除

How to repair and clone disk with ddrescue

  ddrescue  is a tool that can be used to repair and clone disks on a  Linux system . This includes hard drives, partitions, DVD discs, flas...