一般像bcm和qca生产的CPU芯片都内置一个switch(交换芯片),但内置的switch不能满足要求,所以就要在外面加了一个1000Mbps外置switch芯片QCA8337。本文讲的是关于qca芯片外置switch的上层配置方式。
cpu芯片有一个gmac,它通过sgmii与外置switch芯片qca8337相连,默认连接在port 0。8337有7个port口,分别是0~6,我们将wan口置为port 1,lan 口置为port 2~5。
1)现划分两个vlan,vid分别为1与2。vid=1对应lan,包含port 0,2,3,4,5。 vid=2对应wan,包含port 0,1。命令如下:
ssdk_sh vlan entry create <vlan_id>
ssdk_sh vlan member add <vlan_id> <port_id> <unmodified|untagged|tagged> #其中每个vlan中port 0对应tagged,其他为untagged.
2)vlan有两种模式,一是802.1q VLAN模式(这种模式下通过vlan table实现port隔离),另一种是port-based VLAN模式(这种模式下不同的port有自己的port-membership,不同VLAN之间的port没有这种membership关系,即实现了隔离)。802.1q VLAN使用vlan table,即前面配置的vlan entry;而port-based VLAN使用portVlan进行配置。通过配置portVlan的ingress模式